PageSourceSearch

https://hanami-zh.ch/assets/index-NsG2Fu6R.js

js hanami-zh.ch collected 2026-10-08 08:30:33 UTC 1,574,208 bytes, 831 lines download raw bytes

vendor: 6,845 bytes, line 1
1(function(){const P=document.createElement("link").relList;if(P&&P.supports&&P.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))R(N);new MutationObserver(N=>{for(const E of N)if(E.type==="childList")for(const T of E.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&R(T)}).observe(document,{childList:!0,subtree:!0});function D(N){const E={};return N.integrity&&(E.integrity=N.integrity),N.referrerPolicy&&(E.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?E.credentials="include":N.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function R(N){if(N.ep)return;N.ep=!0;const E=D(N);fetch(N.href,E)}})();function xy(j){return j&&j.__esModule&&Object.prototype.hasOwnProperty.call(j,"default")?j.default:j}var $g={exports:{}},nm={};var z_;function ov(){if(z_)return nm;z_=1;var j=Symbol.for("react.transitional.element"),P=Symbol.for("react.fragment");function D(R,N,E){var T=null;if(E!==void 0&&(T=""+E),N.key!==void 0&&(T=""+N.key),"key"in N){E={};for(var u in N)u!=="key"&&(E[u]=N[u])}else E=N;return N=E.ref,{$$typeof:j,type:R,key:T,ref:N!==void 0?N:null,props:E}}return nm.Fragment=P,nm.jsx=D,nm.jsxs=D,nm}var L_;function lv(){return L_||(L_=1,$g.exports=ov()),$g.exports}var te=lv(),Xg={exports:{}},ki={};var D_;function uv(){if(D_)return ki;D_=1;var j=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),X=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),ye=Symbol.iterator;function Se(ze){return ze===null||typeof ze!="object"?null:(ze=ye&&ze[ye]||ze["@@iterator"],typeof ze=="function"?ze:null)}var Ie={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Te=Object.assign,ve={};function lt(ze,rt,Et){this.props=ze,this.context=rt,this.refs=ve,this.updater=Et||Ie}lt.prototype.isReactComponent={},lt.prototype.setState=function(ze,rt){if(typeof ze!="object"&&typeof ze!="function"&&ze!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ze,rt,"setState")},lt.prototype.forceUpdate=function(ze){this.updater.enqueueForceUpdate(this,ze,"forceUpdate")};function Tt(){}Tt.prototype=lt.prototype;function dt(ze,rt,Et){this.props=ze,this.context=rt,this.refs=ve,this.updater=Et||Ie}var Bt=dt.prototype=new Tt;Bt.constructor=dt,Te(Bt,lt.prototype),Bt.isPureReactComponent=!0;var Vt=Array.isArray;function ui(){}var Ft={H:null,A:null,T:null,S:null},vi=Object.prototype.hasOwnProperty;function Kt(ze,rt,Et){var Pt=Et.ref;return{$$typeof:j,type:ze,key:rt,ref:Pt!==void 0?Pt:null,props:Et}}function qt(ze,rt){return Kt(ze.type,rt,ze.props)}function Ht(ze){return typeof ze=="object"&&ze!==null&&ze.$$typeof===j}function Xt(ze){var rt={"=":"=0",":":"=2"};return"$"+ze.replace(/[=:]/g,function(Et){return rt[Et]})}var si=/\/+/g;function ii(ze,rt){return typeof ze=="object"&&ze!==null&&ze.key!=null?Xt(""+ze.key):rt.toString(36)}function Vi(ze){switch(ze.status){case"fulfilled":return ze.value;case"rejected":throw ze.reason;default:switch(typeof ze.status=="string"?ze.then(ui,ui):(ze.status="pending",ze.then(function(rt){ze.status==="pending"&&(ze.status="fulfilled",ze.value=rt)},function(rt){ze.status==="pending"&&(ze.status="rejected",ze.reason=rt)})),ze.status){case"fulfilled":return ze.value;case"rejected":throw ze.reason}}throw ze}function Ke(ze,rt,Et,Pt,St){var Ct=typeof ze;(Ct==="undefined"||Ct==="boolean")&&(ze=null);var ri=!1;if(ze===null)ri=!0;else switch(Ct){case"bigint":case"string":case"number":ri=!0;break;case"object":switch(ze.$$typeof){case j:case P:ri=!0;break;case ce:return ri=ze._init,Ke(ri(ze._payload),rt,Et,Pt,St)}}if(ri)return St=St(ze),ri=Pt===""?"."+ii(ze,0):Pt,Vt(St)?(Et="",ri!=null&&(Et=ri.replace(si,"$&/")+"/"),Ke(St,rt,Et,"",function(vr){return vr})):St!=null&&(Ht(St)&&(St=qt(St,Et+(St.key==null||ze&&ze.key===St.key?"":(""+St.key).replace(si,"$&/")+"/")+ri)),rt.push(St)),1;ri=0;var wi=Pt===""?".":Pt+":";if(Vt(ze))for(var Wi=0;Wi<ze.length;Wi++)Pt=ze[Wi],Ct=wi+ii(Pt,Wi),ri+=Ke(Pt,rt,Et,Ct,St);else if(Wi=Se(ze),typeof Wi=="function")for(ze=Wi.call(ze),Wi=0;!(Pt=ze.next()).done;)Pt=Pt.value,Ct=wi+ii(Pt,Wi++),ri+=Ke(Pt,rt,Et,Ct,St);else if(Ct==="object"){if(typeof ze.then=="function")return Ke(Vi(ze),rt,Et,Pt,St);throw rt=String(ze),Error("Objects are not valid as a React child (found: "+(rt==="[object Object]"?"object with keys {"+Object.keys(ze).join(", ")+"}":rt)+"). If you meant to render a collection of children, use an array instead.")}return ri}function mt(ze,rt,Et){if(ze==null)return ze;var Pt=[],St=0;return Ke(ze,Pt,"","",function(Ct){return rt.call(Et,Ct,St++)}),Pt}function gt(ze){if(ze._status===-1){var rt=ze._result;rt=rt(),rt.then(function(Et){(ze._status===0||ze._status===-1)&&(ze._status=1,ze._result=Et)},function(Et){(ze._status===0||ze._status===-1)&&(ze._status=2,ze._result=Et)}),ze._status===-1&&(ze._status=0,ze._result=rt)}if(ze._status===1)return ze._result.default;throw ze._result}var Yt=typeof reportError=="function"?reportError:function(ze){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var rt=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof ze=="object"&&ze!==null&&typeof ze.message=="string"?String(ze.message):String(ze),error:ze});if(!window.dispatchEvent(rt))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",ze);return}console.error(ze)},It={map:mt,forEach:function(ze,rt,Et){mt(ze,function(){rt.apply(this,arguments)},Et)},count:function(ze){var rt=0;return mt(ze,function(){rt++}),rt},toArray:function(ze){return mt(ze,function(rt){return rt})||[]},only:function(ze){if(!Ht(ze))throw Error("React.Children.only expected to receive a single React element child.");return ze}};return ki.Activity=ne,ki.Children=It,ki.Component=lt,ki.Fragment=D,ki.Profiler=N,ki.PureComponent=dt,ki.StrictMode=R,ki.Suspense=V,ki.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ft,ki.__COMPILER_RUNTIME={__proto__:null,c:function(ze){return Ft.H.useMemoCache(ze)}},ki.cache=function(ze){return function(){return ze.apply(null,arguments)}},ki.cacheSignal=function(){return null},ki.cloneElement=function(ze,rt,Et){if(ze==null)throw Error("The argument must be a React element, but you passed "+ze+".");var Pt=Te({},ze.props),St=ze.key;if(rt!=null)for(Ct in rt.key!==void 0&&(St=""+rt.key),rt)!vi.call(rt,Ct)||Ct==="key"||Ct==="__self"||Ct==="__source"||Ct==="ref"&&rt.ref===void 0||(Pt[Ct]=rt[Ct]);
vendor: 11,357 bytes, line 1
1var Ct=arguments.length-2;if(Ct===1)Pt.children=Et;else if(1<Ct){for(var ri=Array(Ct),wi=0;wi<Ct;wi++)ri[wi]=arguments[wi+2];Pt.children=ri}return Kt(ze.type,St,Pt)},ki.createContext=function(ze){return ze={$$typeof:T,_currentValue:ze,_currentValue2:ze,_threadCount:0,Provider:null,Consumer:null},ze.Provider=ze,ze.Consumer={$$typeof:E,_context:ze},ze},ki.createElement=function(ze,rt,Et){var Pt,St={},Ct=null;if(rt!=null)for(Pt in rt.key!==void 0&&(Ct=""+rt.key),rt)vi.call(rt,Pt)&&Pt!=="key"&&Pt!=="__self"&&Pt!=="__source"&&(St[Pt]=rt[Pt]);var ri=arguments.length-2;if(ri===1)St.children=Et;else if(1<ri){for(var wi=Array(ri),Wi=0;Wi<ri;Wi++)wi[Wi]=arguments[Wi+2];St.children=wi}if(ze&&ze.defaultProps)for(Pt in ri=ze.defaultProps,ri)St[Pt]===void 0&&(St[Pt]=ri[Pt]);return Kt(ze,Ct,St)},ki.createRef=function(){return{current:null}},ki.forwardRef=function(ze){return{$$typeof:u,render:ze}},ki.isValidElement=Ht,ki.lazy=function(ze){return{$$typeof:ce,_payload:{_status:-1,_result:ze},_init:gt}},ki.memo=function(ze,rt){return{$$typeof:X,type:ze,compare:rt===void 0?null:rt}},ki.startTransition=function(ze){var rt=Ft.T,Et={};Ft.T=Et;try{var Pt=ze(),St=Ft.S;St!==null&&St(Et,Pt),typeof Pt=="object"&&Pt!==null&&typeof Pt.then=="function"&&Pt.then(ui,Yt)}catch(Ct){Yt(Ct)}finally{rt!==null&&Et.types!==null&&(rt.types=Et.types),Ft.T=rt}},ki.unstable_useCacheRefresh=function(){return Ft.H.useCacheRefresh()},ki.use=function(ze){return Ft.H.use(ze)},ki.useActionState=function(ze,rt,Et){return Ft.H.useActionState(ze,rt,Et)},ki.useCallback=function(ze,rt){return Ft.H.useCallback(ze,rt)},ki.useContext=function(ze){return Ft.H.useContext(ze)},ki.useDebugValue=function(){},ki.useDeferredValue=function(ze,rt){return Ft.H.useDeferredValue(ze,rt)},ki.useEffect=function(ze,rt){return Ft.H.useEffect(ze,rt)},ki.useEffectEvent=function(ze){return Ft.H.useEffectEvent(ze)},ki.useId=function(){return Ft.H.useId()},ki.useImperativeHandle=function(ze,rt,Et){return Ft.H.useImperativeHandle(ze,rt,Et)},ki.useInsertionEffect=function(ze,rt){return Ft.H.useInsertionEffect(ze,rt)},ki.useLayoutEffect=function(ze,rt){return Ft.H.useLayoutEffect(ze,rt)},ki.useMemo=function(ze,rt){return Ft.H.useMemo(ze,rt)},ki.useOptimistic=function(ze,rt){return Ft.H.useOptimistic(ze,rt)},ki.useReducer=function(ze,rt,Et){return Ft.H.useReducer(ze,rt,Et)},ki.useRef=function(ze){return Ft.H.useRef(ze)},ki.useState=function(ze){return Ft.H.useState(ze)},ki.useSyncExternalStore=function(ze,rt,Et){return Ft.H.useSyncExternalStore(ze,rt,Et)},ki.useTransition=function(){return Ft.H.useTransition()},ki.version="19.2.4",ki}var I_;function Cg(){return I_||(I_=1,Xg.exports=uv()),Xg.exports}var Qe=Cg();const o_=xy(Qe);var Yg={exports:{}},rm={},Wg={exports:{}},Kg={};var k_;function cv(){return k_||(k_=1,(function(j){function P(Ke,mt){var gt=Ke.length;Ke.push(mt);e:for(;0<gt;){var Yt=gt-1>>>1,It=Ke[Yt];if(0<N(It,mt))Ke[Yt]=mt,Ke[gt]=It,gt=Yt;else break e}}function D(Ke){return Ke.length===0?null:Ke[0]}function R(Ke){if(Ke.length===0)return null;var mt=Ke[0],gt=Ke.pop();if(gt!==mt){Ke[0]=gt;e:for(var Yt=0,It=Ke.length,ze=It>>>1;Yt<ze;){var rt=2*(Yt+1)-1,Et=Ke[rt],Pt=rt+1,St=Ke[Pt];if(0>N(Et,gt))Pt<It&&0>N(St,Et)?(Ke[Yt]=St,Ke[Pt]=gt,Yt=Pt):(Ke[Yt]=Et,Ke[rt]=gt,Yt=rt);else if(Pt<It&&0>N(St,gt))Ke[Yt]=St,Ke[Pt]=gt,Yt=Pt;else break e}}return mt}function N(Ke,mt){var gt=Ke.sortIndex-mt.sortIndex;return gt!==0?gt:Ke.id-mt.id}if(j.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var E=performance;j.unstable_now=function(){return E.now()}}else{var T=Date,u=T.now();j.unstable_now=function(){return T.now()-u}}var V=[],X=[],ce=1,ne=null,ye=3,Se=!1,Ie=!1,Te=!1,ve=!1,lt=typeof setTimeout=="function"?setTimeout:null,Tt=typeof clearTimeout=="function"?clearTimeout:null,dt=typeof setImmediate<"u"?setImmediate:null;function Bt(Ke){for(var mt=D(X);mt!==null;){if(mt.callback===null)R(X);else if(mt.startTime<=Ke)R(X),mt.sortIndex=mt.expirationTime,P(V,mt);else break;mt=D(X)}}function Vt(Ke){if(Te=!1,Bt(Ke),!Ie)if(D(V)!==null)Ie=!0,ui||(ui=!0,Xt());else{var mt=D(X);mt!==null&&Vi(Vt,mt.startTime-Ke)}}var ui=!1,Ft=-1,vi=5,Kt=-1;function qt(){return ve?!0:!(j.unstable_now()-Kt<vi)}function Ht(){if(ve=!1,ui){var Ke=j.unstable_now();Kt=Ke;var mt=!0;try{e:{Ie=!1,Te&&(Te=!1,Tt(Ft),Ft=-1),Se=!0;var gt=ye;try{t:{for(Bt(Ke),ne=D(V);ne!==null&&!(ne.expirationTime>Ke&&qt());){var Yt=ne.callback;if(typeof Yt=="function"){ne.callback=null,ye=ne.priorityLevel;var It=Yt(ne.expirationTime<=Ke);if(Ke=j.unstable_now(),typeof It=="function"){ne.callback=It,Bt(Ke),mt=!0;break t}ne===D(V)&&R(V),Bt(Ke)}else R(V);ne=D(V)}if(ne!==null)mt=!0;else{var ze=D(X);ze!==null&&Vi(Vt,ze.startTime-Ke),mt=!1}}break e}finally{ne=null,ye=gt,Se=!1}mt=void 0}}finally{mt?Xt():ui=!1}}}var Xt;if(typeof dt=="function")Xt=function(){dt(Ht)};else if(typeof MessageChannel<"u"){var si=new MessageChannel,ii=si.port2;si.port1.onmessage=Ht,Xt=function(){ii.postMessage(null)}}else Xt=function(){lt(Ht,0)};function Vi(Ke,mt){Ft=lt(function(){Ke(j.unstable_now())},mt)}j.unstable_IdlePriority=5,j.unstable_ImmediatePriority=1,j.unstable_LowPriority=4,j.unstable_NormalPriority=3,j.unstable_Profiling=null,j.unstable_UserBlockingPriority=2,j.unstable_cancelCallback=function(Ke){Ke.callback=null},j.unstable_forceFrameRate=function(Ke){0>Ke||125<Ke?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):vi=0<Ke?Math.floor(1e3/Ke):5},j.unstable_getCurrentPriorityLevel=function(){return ye},j.unstable_next=function(Ke){switch(ye){case 1:case 2:case 3:var mt=3;break;default:mt=ye}var gt=ye;ye=mt;try{return Ke()}finally{ye=gt}},j.unstable_requestPaint=function(){ve=!0},j.unstable_runWithPriority=function(Ke,mt){switch(Ke){case 1:case 2:case 3:case 4:case 5:break;default:Ke=3}var gt=ye;ye=Ke;try{return mt()}finally{ye=gt}},j.unstable_scheduleCallback=function(Ke,mt,gt){var Yt=j.unstable_now();switch(typeof gt=="object"&&gt!==null?(gt=gt.delay,gt=typeof gt=="number"&&0<gt?Yt+gt:Yt):gt=Yt,Ke){case 1:var It=-1;break;case 2:It=250;break;case 5:It=1073741823;break;case 4:It=1e4;break;default:It=5e3}return It=gt+It,Ke={id:ce++,callback:mt,priorityLevel:Ke,startTime:gt,expirationTime:It,sortIndex:-1},gt>Yt?(Ke.sortIndex=gt,P(X,Ke),D(V)===null&&Ke===D(X)&&(Te?(Tt(Ft),Ft=-1):Te=!0,Vi(Vt,gt-Yt))):(Ke.sortIndex=It,P(V,Ke),Ie||Se||(Ie=!0,ui||(ui=!0,Xt()))),Ke},j.unstable_shouldYield=qt,j.unstable_wrapCallback=function(Ke){var mt=ye;return function(){var gt=ye;ye=mt;try{return Ke.apply(this,arguments)}finally{ye=gt}}}})(Kg)),Kg}var R_;function hv(){return R_||(R_=1,Wg.exports=cv()),Wg.exports}var Qg={exports:{}},Fs={};var O_;function dv(){if(O_)return Fs;O_=1;var j=Cg();function P(V){var X="https://react.dev/errors/"+V;if(1<arguments.length){X+="?args[]="+encodeURIComponent(arguments[1]);for(var ce=2;ce<arguments.length;ce++)X+="&args[]="+encodeURIComponent(arguments[ce])}return"Minified React error #"+V+"; visit "+X+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function D(){}var R={d:{f:D,r:function(){throw Error(P(522))},D,C:D,L:D,m:D,X:D,S:D,M:D},p:0,findDOMNode:null},N=Symbol.for("react.portal");function E(V,X,ce){var ne=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:ne==null?null:""+ne,children:V,containerInfo:X,implementation:ce}}var T=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(V,X){if(V==="font")return"";if(typeof X=="string")return X==="use-credentials"?X:""}return Fs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Fs.createPortal=function(V,X){var ce=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!X||X.nodeType!==1&&X.nodeType!==9&&X.nodeType!==11)throw Error(P(299));return E(V,X,null,ce)},Fs.flushSync=function(V){var X=T.T,ce=R.p;try{if(T.T=null,R.p=2,V)return V()}finally{T.T=X,R.p=ce,R.d.f()}},Fs.preconnect=function(V,X){typeof V=="string"&&(X?(X=X.crossOrigin,X=typeof X=="string"?X==="use-credentials"?X:"":void 0):X=null,R.d.C(V,X))},Fs.prefetchDNS=function(V){typeof V=="string"&&R.d.D(V)},Fs.preinit=function(V,X){if(typeof V=="string"&&X&&typeof X.as=="string"){var ce=X.as,ne=u(ce,X.crossOrigin),ye=typeof X.integrity=="string"?X.integrity:void 0,Se=typeof X.fetchPriority=="string"?X.fetchPriority:void 0;ce==="style"?R.d.S(V,typeof X.precedence=="string"?X.precedence:void 0,{crossOrigin:ne,integrity:ye,fetchPriority:Se}):ce==="script"&&R.d.X(V,{crossOrigin:ne,integrity:ye,fetchPriority:Se,nonce:typeof X.nonce=="string"?X.nonce:void 0})}},Fs.preinitModule=function(V,X){if(typeof V=="string")if(typeof X=="object"&&X!==null){if(X.as==null||X.as==="script"){var ce=u(X.as,X.crossOrigin);R.d.M(V,{crossOrigin:ce,integrity:typeof X.integrity=="string"?X.integrity:void 0,nonce:typeof X.nonce=="string"?X.nonce:void 0})}}else X==null&&R.d.M(V)},Fs.preload=function(V,X){if(typeof V=="string"&&typeof X=="object"&&X!==null&&typeof X.as=="string"){var ce=X.as,ne=u(ce,X.crossOrigin);R.d.L(V,ce,{crossOrigin:ne,integrity:typeof X.integrity=="string"?X.integrity:void 0,nonce:typeof X.nonce=="string"?X.nonce:void 0,type:typeof X.type=="string"?X.type:void 0,fetchPriority:typeof X.fetchPriority=="string"?X.fetchPriority:void 0,referrerPolicy:typeof X.referrerPolicy=="string"?X.referrerPolicy:void 0,imageSrcSet:typeof X.imageSrcSet=="string"?X.imageSrcSet:void 0,imageSizes:typeof X.imageSizes=="string"?X.imageSizes:void 0,media:typeof X.media=="string"?X.media:void 0})}},Fs.preloadModule=function(V,X){if(typeof V=="string")if(X){var ce=u(X.as,X.crossOrigin);R.d.m(V,{as:typeof X.as=="string"&&X.as!=="script"?X.as:void 0,crossOrigin:ce,integrity:typeof X.integrity=="string"?X.integrity:void 0})}else R.d.m(V)},Fs.requestFormReset=function(V){R.d.r(V)},Fs.unstable_batchedUpdates=function(V,X){return V(X)},Fs.useFormState=function(V,X,ce){return T.H.useFormState(V,X,ce)},Fs.useFormStatus=function(){return T.H.useHostTransitionStatus()},Fs.version="19.2.4",Fs}var B_;function by(){if(B_)return Qg.exports;B_=1;function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(P){console.error(P)}}return j(),Qg.exports=dv(),Qg.exports}var N_;function fv(){if(N_)return rm;N_=1;var j=hv(),P=Cg(),D=by();function R(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)s+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function N(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function E(r){var s=r,d=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(d=s.return),r=s.return;while(r)}return s.tag===3?d:null}function T(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function u(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function V(r){if(E(r)!==r)throw Error(R(188))}function X(r){var s=r.alternate;
vendor: 16,511 bytes, lines 1-8
1if(!s){if(s=E(r),s===null)throw Error(R(188));return s!==r?null:r}for(var d=r,y=s;;){var M=d.return;if(M===null)break;var I=M.alternate;if(I===null){if(y=M.return,y!==null){d=y;continue}break}if(M.child===I.child){for(I=M.child;I;){if(I===d)return V(M),r;if(I===y)return V(M),s;I=I.sibling}throw Error(R(188))}if(d.return!==y.return)d=M,y=I;else{for(var Y=!1,ue=M.child;ue;){if(ue===d){Y=!0,d=M,y=I;break}if(ue===y){Y=!0,y=M,d=I;break}ue=ue.sibling}if(!Y){for(ue=I.child;ue;){if(ue===d){Y=!0,d=I,y=M;break}if(ue===y){Y=!0,y=I,d=M;break}ue=ue.sibling}if(!Y)throw Error(R(189))}}if(d.alternate!==y)throw Error(R(190))}if(d.tag!==3)throw Error(R(188));return d.stateNode.current===d?r:s}function ce(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=ce(r),s!==null)return s;r=r.sibling}return null}var ne=Object.assign,ye=Symbol.for("react.element"),Se=Symbol.for("react.transitional.element"),Ie=Symbol.for("react.portal"),Te=Symbol.for("react.fragment"),ve=Symbol.for("react.strict_mode"),lt=Symbol.for("react.profiler"),Tt=Symbol.for("react.consumer"),dt=Symbol.for("react.context"),Bt=Symbol.for("react.forward_ref"),Vt=Symbol.for("react.suspense"),ui=Symbol.for("react.suspense_list"),Ft=Symbol.for("react.memo"),vi=Symbol.for("react.lazy"),Kt=Symbol.for("react.activity"),qt=Symbol.for("react.memo_cache_sentinel"),Ht=Symbol.iterator;function Xt(r){return r===null||typeof r!="object"?null:(r=Ht&&r[Ht]||r["@@iterator"],typeof r=="function"?r:null)}var si=Symbol.for("react.client.reference");function ii(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===si?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case Te:return"Fragment";case lt:return"Profiler";case ve:return"StrictMode";case Vt:return"Suspense";case ui:return"SuspenseList";case Kt:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case Ie:return"Portal";case dt:return r.displayName||"Context";case Tt:return(r._context.displayName||"Context")+".Consumer";case Bt:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Ft:return s=r.displayName||null,s!==null?s:ii(r.type)||"Memo";case vi:s=r._payload,r=r._init;try{return ii(r(s))}catch{}}return null}var Vi=Array.isArray,Ke=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,mt=D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gt={pending:!1,data:null,method:null,action:null},Yt=[],It=-1;function ze(r){return{current:r}}function rt(r){0>It||(r.current=Yt[It],Yt[It]=null,It--)}function Et(r,s){It++,Yt[It]=r.current,r.current=s}var Pt=ze(null),St=ze(null),Ct=ze(null),ri=ze(null);function wi(r,s){switch(Et(Ct,s),Et(St,r),Et(Pt,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?hc(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=hc(s),r=Ip(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}rt(Pt),Et(Pt,r)}function Wi(){rt(Pt),rt(St),rt(Ct)}function vr(r){r.memoizedState!==null&&Et(ri,r);var s=Pt.current,d=Ip(s,r.type);s!==d&&(Et(St,r),Et(Pt,d))}function Ur(r){St.current===r&&(rt(Pt),rt(St)),ri.current===r&&(rt(ri),Uh._currentValue=gt)}var xr,Ho;function En(r){if(xr===void 0)try{throw Error()}catch(d){var s=d.stack.trim().match(/\n( *(at )?)/);xr=s&&s[1]||"",Ho=-1<d.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+xr+r+Ho}var Vr=!1;function ta(r,s){if(!r||Vr)return"";Vr=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(s){var xt=function(){throw Error()};if(Object.defineProperty(xt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xt,[])}catch(ot){var nt=ot}Reflect.construct(r,[],xt)}else{try{xt.call()}catch(ot){nt=ot}r.call(xt.prototype)}}else{try{throw Error()}catch(ot){nt=ot}(xt=r())&&typeof xt.catch=="function"&&xt.catch(function(){})}}catch(ot){if(ot&&nt&&typeof ot.stack=="string")return[ot.stack,nt.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var M=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");M&&M.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var I=y.DetermineComponentFrameRoot(),Y=I[0],ue=I[1];if(Y&&ue){var De=Y.split(`
4`),Je=ue.split(`
5`);for(M=y=0;y<De.length&&!De[y].includes("DetermineComponentFrameRoot");)y++;for(;M<Je.length&&!Je[M].includes("DetermineComponentFrameRoot");)M++;if(y===De.length||M===Je.length)for(y=De.length-1,M=Je.length-1;1<=y&&0<=M&&De[y]!==Je[M];)M--;for(;1<=y&&0<=M;y--,M--)if(De[y]!==Je[M]){if(y!==1||M!==1)do if(y--,M--,0>M||De[y]!==Je[M]){var ht=`
6`+De[y].replace(" at new "," at ");return r.displayName&&ht.includes("<anonymous>")&&(ht=ht.replace("<anonymous>",r.displayName)),ht}while(1<=y&&0<=M);break}}}finally{Vr=!1,Error.prepareStackTrace=d}return(d=r?r.displayName||r.name:"")?En(d):""}function yn(r,s){switch(r.tag){case 26:case 27:case 5:return En(r.type);case 16:return En("Lazy");case 13:return r.child!==s&&s!==null?En("Suspense Fallback"):En("Suspense");case 19:return En("SuspenseList");case 0:case 15:return ta(r.type,!1);case 11:return ta(r.type.render,!1);case 1:return ta(r.type,!0);case 31:return En("Activity");default:return""}}function Ta(r){try{var s="",d=null;do s+=yn(r,d),d=r,r=r.return;while(r);return s}catch(y){return`
7Error generating stack: `+y.message+`
8`+y.stack}}var mo=Object.prototype.hasOwnProperty,js=j.unstable_scheduleCallback,ia=j.unstable_cancelCallback,ps=j.unstable_shouldYield,go=j.unstable_requestPaint,pr=j.unstable_now,Sa=j.unstable_getCurrentPriorityLevel,Ha=j.unstable_ImmediatePriority,$o=j.unstable_UserBlockingPriority,ms=j.unstable_NormalPriority,Al=j.unstable_LowPriority,Be=j.unstable_IdlePriority,ee=j.log,ie=j.unstable_setDisableYieldValue,ae=null,be=null;function Pe(r){if(typeof ee=="function"&&ie(r),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(ae,r)}catch{}}var Fe=Math.clz32?Math.clz32:Ze,Ue=Math.log,Ne=Math.LN2;function Ze(r){return r>>>=0,r===0?32:31-(Ue(r)/Ne|0)|0}var ct=256,it=262144,yt=4194304;function ke(r){var s=r&42;if(s!==0)return s;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function oi(r,s,d){var y=r.pendingLanes;if(y===0)return 0;var M=0,I=r.suspendedLanes,Y=r.pingedLanes;r=r.warmLanes;var ue=y&134217727;return ue!==0?(y=ue&~I,y!==0?M=ke(y):(Y&=ue,Y!==0?M=ke(Y):d||(d=ue&~r,d!==0&&(M=ke(d))))):(ue=y&~I,ue!==0?M=ke(ue):Y!==0?M=ke(Y):d||(d=y&~r,d!==0&&(M=ke(d)))),M===0?0:s!==0&&s!==M&&(s&I)===0&&(I=M&-M,d=s&-s,I>=d||I===32&&(d&4194048)!==0)?s:M}function Hi(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Gt(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wt(){var r=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),r}function yi(r){for(var s=[],d=0;31>d;d++)s.push(r);return s}function rn(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function dn(r,s,d,y,M,I){var Y=r.pendingLanes;r.pendingLanes=d,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=d,r.entangledLanes&=d,r.errorRecoveryDisabledLanes&=d,r.shellSuspendCounter=0;var ue=r.entanglements,De=r.expirationTimes,Je=r.hiddenUpdates;for(d=Y&~d;0<d;){var ht=31-Fe(d),xt=1<<ht;ue[ht]=0,De[ht]=-1;var nt=Je[ht];if(nt!==null)for(Je[ht]=null,ht=0;ht<nt.length;ht++){var ot=nt[ht];ot!==null&&(ot.lane&=-536870913)}d&=~xt}y!==0&&tr(r,y,0),I!==0&&M===0&&r.tag!==0&&(r.suspendedLanes|=I&~(Y&~s))}function tr(r,s,d){r.pendingLanes|=s,r.suspendedLanes&=~s;var y=31-Fe(s);r.entangledLanes|=s,r.entanglements[y]=r.entanglements[y]|1073741824|d&261930}function ir(r,s){var d=r.entangledLanes|=s;for(r=r.entanglements;d;){var y=31-Fe(d),M=1<<y;M&s|r[y]&s&&(r[y]|=s),d&=~M}}function An(r,s){var d=s&-s;return d=(d&42)!==0?1:Qi(d),(d&(r.suspendedLanes|s))!==0?0:d}function Qi(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ve(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function kn(){var r=mt.p;return r!==0?r:(r=window.event,r===void 0?32:Qc(r.type))}function Pr(r,s){var d=mt.p;try{return mt.p=r,s()}finally{mt.p=d}}var Zr=Math.random().toString(36).slice(2),Pi="__reactFiber$"+Zr,bt="__reactProps$"+Zr,li="__reactContainer$"+Zr,hi="__reactEvents$"+Zr,na="__reactListeners$"+Zr,Nu="__reactHandles$"+Zr,gs="__reactResources$"+Zr,fi="__reactMarker$"+Zr;function Xo(r){delete r[Pi],delete r[bt],delete r[hi],delete r[na],delete r[Nu]}function $a(r){var s=r[Pi];if(s)return s;for(var d=r.parentNode;d;){if(s=d[li]||d[Pi]){if(d=s.alternate,s.child!==null||d!==null&&d.child!==null)for(r=Cd(r);r!==null;){if(d=r[Pi])return d;r=Cd(r)}return s}r=d,d=r.parentNode}return null}function Us(r){if(r=r[Pi]||r[li]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Ca(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(R(33))}function _s(r){var s=r[gs];return s||(s=r[gs]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Rn(r){r[fi]=!0}var Pl=new Set,zr={};function Oi(r,s){Xa(r,s),Xa(r+"Capture",s)}function Xa(r,s){for(zr[r]=s,r=0;r<s.length;r++)Pl.add(s[r])}var ys=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yo={},Vs={};function Gr(r){return mo.call(Vs,r)?!0:mo.call(Yo,r)?!1:ys.test(r)?Vs[r]=!0:(Yo[r]=!0,!1)}function Bi(r,s,d){if(Gr(s))if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var y=s.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+d)}}function $i(r,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+d)}}function qr(r,s,d,y){if(y===null)r.removeAttribute(d);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(d);return}r.setAttributeNS(s,d,""+y)}}function zi(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function _o(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Fu(r,s,d){var y=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var M=y.get,I=y.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return M.call(this)},set:function(Y){d=""+Y,I.call(this,Y)}}),Object.defineProperty(r,s,{enumerable:y.enumerable}),{getValue:function(){return d},setValue:function(Y){d=""+Y},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function xi(r){if(!r._valueTracker){var s=_o(r)?"checked":"value";r._valueTracker=Fu(r,s,""+r[s])}}function On(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var d=s.getValue(),y="";return r&&(y=_o(r)?r.checked?"true":"false":r.value),r=y,r!==d?(s.setValue(r),!0):!1}function Wo(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Ql=/[\n"\\]/g;function vn(r){return r.replace(Ql,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Jl(r,s,d,y,M,I,Y,ue){r.name="",Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?r.type=Y:r.removeAttribute("type"),s!=null?Y==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+zi(s)):r.value!==""+zi(s)&&(r.value=""+zi(s)):Y!=="submit"&&Y!=="reset"||r.removeAttribute("value"),s!=null?Ya(r,Y,zi(s)):d!=null?Ya(r,Y,zi(d)):y!=null&&r.removeAttribute("value"),M==null&&I!=null&&(r.defaultChecked=!!I),M!=null&&(r.checked=M&&typeof M!="function"&&typeof M!="symbol"),ue!=null&&typeof ue!="function"&&typeof ue!="symbol"&&typeof ue!="boolean"?r.name=""+zi(ue):r.removeAttribute("name")}function Ko(r,s,d,y,M,I,Y,ue){if(I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(r.type=I),s!=null||d!=null){if(!(I!=="submit"&&I!=="reset"||s!=null)){xi(r);return}d=d!=null?""+zi(d):"",s=s!=null?""+zi(s):d,ue||s===r.value||(r.value=s),r.defaultValue=s}y=y??M,y=typeof y!="function"&&typeof y!="symbol"&&!!y,r.checked=ue?r.checked:!!y,r.defaultChecked=!!y,Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"&&(r.name=Y),xi(r)}function Ya(r,s,d){s==="number"&&Wo(r.ownerDocument)===r||r.defaultValue===""+d||(r.defaultValue=""+d)}function fn(r,s,d,y){if(r=r.options,s){s={};for(var M=0;M<d.length;M++)s["$"+d[M]]=!0;for(d=0;d<r.length;d++)M=s.hasOwnProperty("$"+r[d].value),r[d].selected!==M&&(r[d].selected=M),M&&y&&(r[d].defaultSelected=!0)}else{for(d=""+zi(d),s=null,M=0;M<r.length;M++){if(r[M].value===d){r[M].selected=!0,y&&(r[M].defaultSelected=!0);return}s!==null||r[M].disabled||(s=r[M])}s!==null&&(s.selected=!0)}}function yo(r,s,d){if(s!=null&&(s=""+zi(s),s!==r.value&&(r.value=s),d==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=d!=null?""+zi(d):""}function vs(r,s,d,y){if(s==null){if(y!=null){if(d!=null)throw Error(R(92));if(Vi(y)){if(1<y.length)throw Error(R(93));y=y[0]}d=y}d==null&&(d=""),s=d}d=zi(s),r.defaultValue=d,y=r.textContent,y===d&&y!==""&&y!==null&&(r.value=y),xi(r)}function Ma(r,s){if(s){var d=r.firstChild;if(d&&d===r.lastChild&&d.nodeType===3){d.nodeValue=s;return}}r.textContent=s}var ju=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Wa(r,s,d){var y=s.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?y?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":y?r.setProperty(s,d):typeof d!="number"||d===0||ju.has(s)?s==="float"?r.cssFloat=d:r[s]=(""+d).trim():r[s]=d+"px"}function zl(r,s,d){if(s!=null&&typeof s!="object")throw Error(R(62));if(r=r.style,d!=null){for(var y in d)!d.hasOwnProperty(y)||s!=null&&s.hasOwnProperty(y)||(y.indexOf("--")===0?r.setProperty(y,""):y==="float"?r.cssFloat="":r[y]="");for(var M in s)y=s[M],s.hasOwnProperty(M)&&d[M]!==y&&Wa(r,M,y)}
vendor: 8,532 bytes, line 8
8else for(var I in s)s.hasOwnProperty(I)&&Wa(r,I,s[I])}function Zs(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ka=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vo=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function mi(r){return vo.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ra(){}var Uu=null;function Qo(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var or=null,Qt=null;function Ni(r){var s=Us(r);if(s&&(r=s.stateNode)){var d=r[bt]||null;e:switch(r=s.stateNode,s.type){case"input":if(Jl(r,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),s=d.name,d.type==="radio"&&s!=null){for(d=r;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+vn(""+s)+'"][type="radio"]'),s=0;s<d.length;s++){var y=d[s];if(y!==r&&y.form===r.form){var M=y[bt]||null;if(!M)throw Error(R(90));Jl(y,M.value,M.defaultValue,M.defaultValue,M.checked,M.defaultChecked,M.type,M.name)}}for(s=0;s<d.length;s++)y=d[s],y.form===r.form&&On(y)}break e;case"textarea":yo(r,d.value,d.defaultValue);break e;case"select":s=d.value,s!=null&&fn(r,!!d.multiple,s,!1)}}}var jt=!1;function Ji(r,s,d){if(jt)return r(s,d);jt=!0;try{var y=r(s);return y}finally{if(jt=!1,(or!==null||Qt!==null)&&(_d(),or&&(s=or,r=Qt,Qt=or=null,Ni(s),r)))for(s=0;s<r.length;s++)Ni(r[s])}}function aa(r,s){var d=r.stateNode;if(d===null)return null;var y=d[bt]||null;if(y===null)return null;d=y[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(r=r.type,y=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!y;break e;default:r=!1}if(r)return null;if(d&&typeof d!="function")throw Error(R(231,s,typeof d));return d}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),br=!1;if(wn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){br=!0}}),window.addEventListener("test",Tn,Tn),window.removeEventListener("test",Tn,Tn)}catch{br=!1}var Hr=null,sa=null,Ti=null;function oa(){if(Ti)return Ti;var r,s=sa,d=s.length,y,M="value"in Hr?Hr.value:Hr.textContent,I=M.length;for(r=0;r<d&&s[r]===M[r];r++);var Y=d-r;for(y=1;y<=Y&&s[d-y]===M[I-y];y++);return Ti=M.slice(r,1<y?1-y:void 0)}function la(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function xo(){return!0}function $r(){return!1}function $n(r){function s(d,y,M,I,Y){this._reactName=d,this._targetInst=M,this.type=y,this.nativeEvent=I,this.target=Y,this.currentTarget=null;for(var ue in r)r.hasOwnProperty(ue)&&(d=r[ue],this[ue]=d?d(I):I[ue]);return this.isDefaultPrevented=(I.defaultPrevented!=null?I.defaultPrevented:I.returnValue===!1)?xo:$r,this.isPropagationStopped=$r,this}return ne(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=xo)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=xo)},persist:function(){},isPersistent:xo}),s}var wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=$n(wr),bo=ne({},wr,{view:0,detail:0}),Ci=$n(bo),en,mr,bi,pi=ne({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==bi&&(bi&&r.type==="mousemove"?(en=r.screenX-bi.screenX,mr=r.screenY-bi.screenY):mr=en=0,bi=r),en)},movementY:function(r){return"movementY"in r?r.movementY:mr}}),Jo=$n(pi),Di=ne({},pi,{dataTransfer:0}),tu=$n(Di),Ea=ne({},bo,{relatedTarget:0}),wo=$n(Ea),To=ne({},wr,{animationName:0,elapsedTime:0,pseudoElement:0}),Vu=$n(To),iu=ne({},wr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Da=$n(iu),Hh=ne({},wr,{data:0}),Zu=$n(Hh),Zn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qa={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gs(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=xn[r])?!!s[r]:!1}function nu(){return Gs}var Ll=ne({},bo,{key:function(r){if(r.key){var s=Zn[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=la(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Qa[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nu,charCode:function(r){return r.type==="
8keypress"?la(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?la(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Pn=$n(Ll),nh=ne({},pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gu=$n(nh),qu=ne({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nu}),$h=$n(qu),el=ne({},wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ru=$n(el),qs=ne({},pi,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Hs=$n(qs),au=ne({},wr,{newState:0,oldState:0}),xs=$n(au),Tr=[9,13,27,32],Bn=wn&&"CompositionEvent"in window,tl=null;wn&&"documentMode"in document&&(tl=document.documentMode);var Dl=wn&&"TextEvent"in window&&!tl,So=wn&&(!Bn||tl&&8<tl&&11>=tl),bs=" ",rh=!1;function su(r,s){switch(r){case"keyup":return Tr.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tc(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ja=!1;function ua(r,s){switch(r){case"compositionend":return Tc(s);case"keypress":return s.which!==32?null:(rh=!0,bs);case"textInput":return r=s.data,r===bs&&rh?null:r;default:return null}}function il(r,s){if(Ja)return r==="compositionend"||!Bn&&su(r,s)?(r=oa(),Ti=sa=Hr=null,Ja=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return So&&s.locale!=="ko"?null:s.data;default:return null}}var ah={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ia(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!ah[r.type]:s==="textarea"}function Hu(r,s,d,y){or?Qt?Qt.push(y):Qt=[y]:or=y,s=bd(s,"onChange"),0<s.length&&(d=new eu("onChange","change",null,d,y),r.push({event:d,listeners:s}))}var ka=null,Il=null;function kl(r){$m(r,0)}function Rl(r){var s=Ca(r);if(On(s))return r}function es(r,s){if(r==="change")return s}var Sc=!1;if(wn){var Ra;if(wn){var ts="oninput"in document;if(!ts){var Cc=document.createElement("div");Cc.setAttribute("oninput","return;"),ts=typeof Cc.oninput=="function"}Ra=ts}else Ra=!1;Sc=Ra&&(!document.documentMode||9<document.documentMode)}function nl(){ka&&(ka.detachEvent("onpropertychange",sh),Il=ka=null)}function sh(r){if(r.propertyName==="value"&&Rl(Il)){var s=[];Hu(s,Il,r,Qo(r)),Ji(kl,s)}}function $s(r,s,d){r==="focusin"?(nl(),ka=s,Il=d,ka.attachEvent("onpropertychange",sh)):r==="focusout"&&nl()}function oh(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Rl(Il)}function ws(r,s){if(r==="click")return Rl(s)}function lh(r,s){if(r==="input"||r==="change")return Rl(s)}function is(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Sr=typeof Object.is=="function"?Object.is:is;function Xs(r,s){if(Sr(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var d=Object.keys(r),y=Object.keys(s);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++){var M=d[y];if(!mo.call(s,M)||!Sr(r[M],s[M]))return!1}return!0}function ca(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Co(r,s){var d=ca(r);r=0;for(var y;d;){if(d.nodeType===3){if(y=r+d.textContent.length,r<=s&&y>=s)return{node:d,offset:s-r};r=y}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=ca(d)}}function Ol(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Ol(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function rl(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Wo(r.document);s instanceof r.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)r=s.contentWindow;else break;s=Wo(r.document)}return s}function Ts(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var al=wn&&"documentMode"in document&&11>=document.documentMode,ha=null,Bl=null,ou=null,sl=!1;function uh(r,s,d){var y=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;sl||ha==null||ha!==Wo(y)||(y=ha,"selectionStart"in y&&Ts(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anch
vendor: 16,889 bytes, line 8
8orNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ou&&Xs(ou,y)||(ou=y,y=bd(Bl,"onSelect"),0<y.length&&(s=new eu("onSelect","select",null,s,d),r.push({event:s,listeners:y}),s.target=ha)))}function Mo(r,s){var d={};return d[r.toLowerCase()]=s.toLowerCase(),d["Webkit"+r]="webkit"+s,d["Moz"+r]="moz"+s,d}var ol={animationend:Mo("Animation","AnimationEnd"),animationiteration:Mo("Animation","AnimationIteration"),animationstart:Mo("Animation","AnimationStart"),transitionrun:Mo("Transition","TransitionRun"),transitionstart:Mo("Transition","TransitionStart"),transitioncancel:Mo("Transition","TransitionCancel"),transitionend:Mo("Transition","TransitionEnd")},$u={},Fi={};wn&&(Fi=document.createElement("div").style,"AnimationEvent"in window||(delete ol.animationend.animation,delete ol.animationiteration.animation,delete ol.animationstart.animation),"TransitionEvent"in window||delete ol.transitionend.transition);function lr(r){if($u[r])return $u[r];if(!ol[r])return r;var s=ol[r],d;for(d in s)if(s.hasOwnProperty(d)&&d in Fi)return $u[r]=s[d];return r}var Eo=lr("animationend"),lu=lr("animationiteration"),ll=lr("animationstart"),ul=lr("transitionrun"),Nl=lr("transitionstart"),Fl=lr("transitioncancel"),Cr=lr("transitionend"),Mc=new Map,Ys="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ys.push("scrollEnd");function da(r,s){Mc.set(r,s),Oi(s,[r])}var ns=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Xr=[],Mr=0,Ao=0;function Po(){for(var r=Mr,s=Ao=Mr=0;s<r;){var d=Xr[s];Xr[s++]=null;var y=Xr[s];Xr[s++]=null;var M=Xr[s];Xr[s++]=null;var I=Xr[s];if(Xr[s++]=null,y!==null&&M!==null){var Y=y.pending;Y===null?M.next=M:(M.next=Y.next,Y.next=M),y.pending=M}I!==0&&cl(d,M,I)}}function Ws(r,s,d,y){Xr[Mr++]=r,Xr[Mr++]=s,Xr[Mr++]=d,Xr[Mr++]=y,Ao|=y,r.lanes|=y,r=r.alternate,r!==null&&(r.lanes|=y)}function zo(r,s,d,y){return Ws(r,s,d,y),hl(r)}function Yr(r,s){return Ws(r,null,null,s),hl(r)}function cl(r,s,d){r.lanes|=d;var y=r.alternate;y!==null&&(y.lanes|=d);for(var M=!1,I=r.return;I!==null;)I.childLanes|=d,y=I.alternate,y!==null&&(y.childLanes|=d),I.tag===22&&(r=I.stateNode,r===null||r._visibility&1||(M=!0)),r=I,I=I.return;return r.tag===3?(I=r.stateNode,M&&s!==null&&(M=31-Fe(d),r=I.hiddenUpdates,y=r[M],y===null?r[M]=[s]:y.push(s),s.lane=d|536870912),I):null}function hl(r){if(50<gd)throw gd=0,_p=null,Error(R(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var gi={};function Xu(r,s,d,y){this.tag=r,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fa(r,s,d,y){return new Xu(r,s,d,y)}function uu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function pa(r,s){var d=r.alternate;return d===null?(d=fa(r.tag,s,r.key,r.mode),d.elementType=r.elementType,d.type=r.type,d.stateNode=r.stateNode,d.alternate=r,r.alternate=d):(d.pendingProps=s,d.type=r.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=r.flags&65011712,d.childLanes=r.childLanes,d.lanes=r.lanes,d.child=r.child,d.memoizedProps=r.memoizedProps,d.memoizedState=r.memoizedState,d.updateQueue=r.updateQueue,s=r.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=r.sibling,d.index=r.index,d.ref=r.ref,d.refCleanup=r.refCleanup,d}function Ec(r,s){r.flags&=65011714;var d=r.alternate;return d===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=d.childLanes,r.lanes=d.lanes,r.child=d.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=d.memoizedProps,r.memoizedState=d.memoizedState,r.updateQueue=d.updateQueue,r.type=d.type,s=d.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function cu(r,s,d,y,M,I){var Y=0;if(y=r,typeof r=="function")uu(r)&&(Y=1);else if(typeof r=="string")Y=Bf(r,d,Pt.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Kt:return r=fa(31,d,s,M),r.elementType=Kt,r.lanes=I,r;case Te:return Lo(d.children,M,I,s);case ve:Y=8,M|=24;break;case lt:return r=fa(12,d,s,M|2),r.elementType=lt,r.lanes=I,r;case Vt:return r=fa(13,d,s,M),r.elementType=Vt,r.lanes=I,r;case ui:return r=fa(19,d,s,M),r.elementType=ui,r.lanes=I,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case dt:Y=10;break e;case Tt:Y=9;break e;case Bt:Y=11;break e;case Ft:Y=14;break e;case vi:Y=16,y=null;break e}Y=29,d=Error(R(130,r===null?"null":typeof r,"")),y=null}return s=fa(Y,d,s,M),s.elementType=r,s.type=y,s.lanes=I,s}function Lo(r,s,d,y){return r=fa(7,r,y,s),r.lanes=d,r}function Yu(r,s,d){return r=fa(6,r,null,s),r.lanes=d,r}function hu(r){var s=fa(18,null,null,0);return s.stateNode=r,s}function Do(r,s,d){return s=fa(4,r.children!==null?r.children:[],r.key,s),s.lanes=d,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var l=new WeakMap;function _(r,s){if(typeof r=="object"&&r!==null){var d=l.get(r);return d!==void 0?d:(s={value:r,source:s,stack:Ta(s)},l.set(r,s),s)}return{value:r,source:s,stack:Ta(s)}}var S=[],B=0,$=null,oe=0,Ee=[],je=0,tt=null,vt=1,Rt="";function ni(r,s){S[B++]=oe,S[B++]=$,$=r,oe=s}function Mi(r,s,d){Ee[je++]=vt,Ee[je++]=Rt,Ee[je++]=tt,tt=r;var y=vt;r=Rt;var M=32-Fe(y)-1;y&=~(1<<M),d+=1;var I=32-Fe(s)+M;if(30<I){var Y=M-M%5;I=(y&(1<<Y)-1).toString(32),y>>=Y,M-=Y,vt=1<<32-Fe(s)+M|d<<M|y,Rt=I+r}else vt=1<<I|d<<M|y,Rt=r}function Xn(r){r.return!==null&&(ni(r,1),Mi(r,1,0))}function Nn(r){for(;r===$;)$=S[--B],S[B]=null,oe=S[--B],S[B]=null;for(;r===tt;)tt=Ee[--je],Ee[je]=null,Rt=Ee[--je],Ee[je]=null,vt=Ee[--je],Ee[je]=null}function ma(r,s){Ee[je++]=vt,Ee[je++]=Rt,Ee[je++]=tt,vt=s.id,Rt=s.overflow,tt=r}var Ki=null,ji=null,Ii=!1,Ks=null,Aa=!1,Sn=Error(R(519));function ga(r){var s=Error(R(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qs(_(s,r)),Sn}function Wr(r){var s=r.stateNode,d=r.type,y=r.memoizedProps;switch(s[Pi]=r,s[bt]=y,d){case"dialog":qi("cancel",s),qi("close",s);break;case"iframe":case"object":case"embed":qi("load",s);break;case"video":case"audio":for(d=0;d<cc.length;d++)qi(cc[d],s);break;case"source":qi("error",s);break;case"img":case"image":case"link":qi("error",s),qi("load",s);break;case"details":qi("toggle",s);break;case"input":qi("invalid",s),Ko(s,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":qi("invalid",s);break;case"textarea":qi("invalid",s),vs(s,y.value,y.defaultValue,y.children)}d=y.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||s.textContent===""+d||y.suppressHydrationWarning===!0||Lp(s.textContent,d)?(y.popover!=null&&(qi("beforetoggle",s),qi("toggle",s)),y.onScroll!=null&&qi("scroll",s),y.onScrollEnd!=null&&qi("scrollend",s),y.onClick!=null&&(s.onclick=ra),s=!0):s=!1,s||ga(r,!0)}function zn(r){for(Ki=r.return;Ki;)switch(Ki.tag){case 5:case 31:case 13:Aa=!1;return;case 27:case 3:Aa=!0;return;default:Ki=Ki.return}}function Pa(r){if(r!==Ki)return!1;if(!Ii)return zn(r),Ii=!0,!1;var s=r.tag,d;if((d=s!==3&&s!==27)&&((d=s===5)&&(d=r.type,d=!(d!=="form"&&d!=="button")||zf(r.type,r.memoizedProps)),d=!d),d&&ji&&ga(r),zn(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(317));ji=Nr(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(317));ji=Nr(r)}else s===27?(s=ji,fc(r.type)?(r=ds,ds=null,ji=r):ji=s):ji=Ki?co(r.stateNode.nextSibling):null;return!0}function Ss(){ji=Ki=null,Ii=!1}function Cs(){var r=Ks;return r!==null&&(Rs===null?Rs=r:Rs.push.apply(Rs,r),Ks=null),r}function Qs(r){Ks===null?Ks=[r]:Ks.push(r)}var rs=ze(null),za=null,Ms=null;function dl(r,s,d){Et(rs,s._currentValue),s._currentValue=d}function Io(r){r._currentValue=rs.current,rt(rs)}function ch(r,s,d){for(;r!==null;){var y=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,y!==null&&(y.childLanes|=s)):y!==null&&(y.childLanes&s)!==s&&(y.childLanes|=s),r===d)break;r=r.return}}function hh(r,s,d,y){var M=r.child;for(M!==null&&(M.return=r);M!==null;){var I=M.dependencies;if(I!==null){var Y=M.child;I=I.firstContext;e:for(;I!==null;){var ue=I;I=M;for(var De=0;De<s.length;De++)if(ue.context===s[De]){I.lanes|=d,ue=I.alternate,ue!==null&&(ue.lanes|=d),ch(I.return,d,r),y||(Y=null);break e}I=ue.next}}else if(M.tag===18){if(Y=M.return,Y===null)throw Error(R(341));Y.lanes|=d,I=Y.alternate,I!==null&&(I.lanes|=d),ch(Y,d,r),Y=null}else Y=M.child;if(Y!==null)Y.return=M;else for(Y=M;Y!==null;){if(Y===r){Y=null;break}if(M=Y.sibling,M!==null){M.return=Y.return,Y=M;break}Y=Y.return}M=Y}}function as(r,s,d,y){r=null;for(var M=s,I=!1;M!==null;){if(!I){if((M.flags&524288)!==0)I=!0;else if((M.flags&262144)!==0)break}if(M.tag===10){var Y=M.alternate;if(Y===null)throw Error(R(387));if(Y=Y.memoizedProps,Y!==null){var ue=M.type;Sr(M.pendingProps.value,Y.value)||(r!==null?r.push(ue):r=[ue])}}else if(M===ri.current){if(Y=M.alternate,Y===null)throw Error(R(387));Y.memoizedState.memoizedState!==M.memoizedState.memoizedState&&(r!==null?r.push(Uh):r=[Uh])}M=M.return}r!==null&&hh(s,r,d,y),s.flags|=262144}function Wu(r){for(r=r.firstContext;r!==null;){if(!Sr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function fl(r){za=r,Ms=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function ur(r){return dh(za,r)}function Ac(r,s){return za===null&&fl(r),dh(r,s)}function dh(r,s){var d=s._currentValue;if(s={context:s,memoizedValue:d,next:null},Ms===null){if(r===null)throw Error(R(308));Ms=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else Ms=Ms.next=s;return d}var Xh=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(d,y){r.push(y)}};this.abort=function(){s.aborted=!0,r.forEach(function(d){return d()})}},Gd=j.unstable_scheduleCallback,Yh=j.unstable_NormalPriority,nr={$$typeof:dt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ko(){return{controller:new Xh,data:new Map,refCount:0}}function Ku(r){r.refCount--,r.refCount===0&&Gd(Yh,function(){r.controller.abort()})}var _a=null,ss=0,du=0,ya=null;function ep(r,s){if(_a===null){var d=_a=[];ss=0,du=Mp(),ya={status:"pending",value:void 0,then:function(y){d.push(y)}}}return ss++,s.then(Qu,Qu),s}function Qu(){if(--ss===0&&_a!==null){ya!==null&&(ya.status="fulfilled");var r=_a;_a=null,du=0,ya=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function Pc(r,s){var d=[],y={status:"pending",value:null,reason:null,then:function(M){d.push(M)}};return r.then(function(){y.status="fulfilled",y.value=s;for(var M=0;M<d.length;M++)(0,d[M])(s)},function(M){for(y.status="rejected",y.reason=M,M=0;M<d.length;M++)(0,d[M])(void 0)}),y}var Er=Ke.S;Ke.S=function(r,s){zm=pr(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&ep(r,s),Er!==null&&Er(r,s)};var Js=ze(null);function fh(){var r=Js.current;return r!==null?r:Un.pooledCache}function ph(r,s){s===null?Et(Js,Js.current):Et(Js,s.pool)}function qd(){var r=fh();return r===null?null:{parent:nr._currentValue,pool:r}}var eo=Error(R(460)),jl=Error(R(474)),Oa=Error(R(542)),Nt={then:function(){}};function zc(r){return r=r.status,r==="fulfilled"||r==="rejected"}function mh(r,s,d){switch(d=r[d],d===void 0?r.push(s):d!==s&&(s.then(ra,ra),s=d),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,gh(r),r;default:if(typeof s.status=="string")s.then(ra,ra);else{if(r=Un,r!==null&&100<r.shellSuspendCounter)throw Error(R(482));r=s,r.status="pending",r.then(function(y){if(s.status==="pending"){var M=s;M.status="fulfilled",M.value=y}},function(y){if(s.status==="pending"){var M=s;M.status="rejected",M.reason=y}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,gh(r),r}throw to=s,eo}}function Es(r){try{var s=r._init;return s(r._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(to=d,eo):d}}var to=null;function Ju(){if(to===null)throw Error(R(459));var r=to;return to=null,r}function gh(r){if(r===eo||r===Oa)throw Error(R(483))}var Ro=null,fu=0;function Lc(r){var s=fu;return fu+=1,Ro===null&&(Ro=[]),mh(Ro,r,s)}function Oo(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function _h(r,s){throw s.$$typeof===ye?Error(R(525)):(r=Object.prototype.toString.call(s),Error(R(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Dc(r){function s(Ge,Oe){if(r){var We=Ge.deletions;We===null?(Ge.deletions=[Oe],Ge.flags|=16):We.push(Oe)}}function d(Ge,Oe){if(!r)return null;for(;Oe!==null;)s(Ge,Oe),Oe=Oe.sibling;return null}function y(Ge){for(var Oe=new Map;Ge!==null;)Ge.key!==null?Oe.set(Ge.key,Ge):Oe.set(Ge.index,Ge),Ge=Ge.sibling;return Oe}function M(Ge,Oe){return Ge=pa(Ge,Oe),Ge.index=0,Ge.sibling=null,Ge}function I(Ge,Oe,We){return Ge.index=We,r?(We=Ge.alternate,We!==null?(We=We.index,We<Oe?(Ge.flags|=67108866,Oe):We):(Ge.flags|=67108866,Oe)):(Ge.flags|=1048576,Oe)}function Y(Ge){return r&&Ge.alternate===null&&(Ge.flags|=67108866),Ge}function ue(Ge,Oe,We,_t){return Oe===null||Oe.tag!==6?(Oe=Yu(We,Ge.mode,_t),Oe.return=Ge,Oe):(Oe=M(Oe,We),Oe.return=Ge,Oe)}function De(Ge,Oe,We,_t){var ci=We.type;return ci===Te?ht(Ge,Oe,We.props.children,_t,We.key):Oe!==null&&(Oe.elementType===ci||typeof ci=="object"&&ci!==null&&ci.$$typeof===vi&&Es(ci)===Oe.type)?(Oe=M(Oe,We.props),Oo(Oe,We),Oe.return=Ge,Oe):(Oe=cu(We.type,We.key,We.props,null,Ge.mode,_t),Oo(Oe,We),Oe.return=Ge,Oe)}function Je(Ge,Oe,We,_t){return Oe===null||Oe.tag!==4||Oe.stateNode.containerInfo!==We.containerInfo||Oe.stateNode.implementation!==We.implementation?(Oe=Do(We,Ge.mode,_t),Oe.return=Ge,Oe):(Oe=M(Oe,We.children||[]),Oe.return=Ge,Oe)}function ht(Ge,Oe,We,_t,ci){return Oe===null||Oe.tag!==7?(Oe=Lo(We,Ge.mode,_t,ci),Oe.return=Ge,Oe):(Oe=M(Oe,We),Oe.return=Ge,Oe)}function xt(Ge,Oe,We){if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return Oe=Yu(""+Oe,Ge.mode,We),Oe.return=Ge,Oe;if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case Se:return We=cu(Oe.type,Oe.key,Oe.props,null,Ge.mode,We),Oo(We,Oe),We.return=Ge,We;case Ie:return Oe=Do(Oe,Ge.mode,We),Oe.return=Ge,Oe;case vi:return Oe=Es(Oe),xt(Ge,Oe,We)}if(Vi(Oe)||Xt(Oe))return Oe=Lo(Oe,Ge.mode,We,null),Oe.return=Ge,Oe;if(typeof Oe.then=="function")return xt(Ge,Lc(Oe),We);if(Oe.$$typeof===dt)return xt(Ge,Ac(Ge,Oe),We);_h(Ge,Oe)}return null}function nt(Ge,Oe,We,_t){var ci=Oe!==null?Oe.key:null;if(typeof We=="string"&&We!==""||typeof We=="number"||typeof We=="bigint")return ci!==null?null:ue(Ge,Oe,""+We,_t);if(typeof We=="object"&&We!==null){switch(We.$$typeof){case Se:return We.key===ci?De(Ge,Oe,We,_t):null;case Ie:return We.key===ci?Je(Ge,Oe,We,_t):null;case vi:return We=Es(We),nt(Ge,Oe,We,_t)}if(Vi(We)||Xt(We))return ci!==null?null:ht(Ge,Oe,We,_t,null);if(typeof We.then=="function")return nt(Ge,Oe,Lc(We),_t);if(We.$$typeof===dt)return nt(Ge,Oe,Ac(Ge,We),_t);_h(Ge,We)}return null}function ot(Ge,Oe,We,_t,ci){if(typeof _t=="string"&&_t!==""||typeof _t=="number"||typeof _t=="bigint")return Ge=Ge.get(We)||null,ue(Oe,Ge,""+_t,ci);if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case Se:return Ge=Ge.get(_t.key===null?We:_t.key)||null,De(Oe,Ge,_t,ci);case Ie:return Ge=Ge.get(_t.key===null?We:_t.key)||null,Je(Oe,Ge,_t,ci);case vi:return _t=Es(_t),ot(Ge,Oe,We,_t,ci)}if(Vi(_t)||Xt(_t))return Ge=Ge.get(We)||null,ht(Oe,Ge,_t,ci,null);if(typeof _t.then=="function")return ot(Ge,Oe,We,Lc(_t),ci);if(_t.$$typeof===dt)return ot(Ge,Oe,We,Ac(Oe,_t),ci);_h(Oe,_t)}return null}function Jt(Ge,Oe,We,_t){for(var ci=null,cn=null,ei=Oe,ai=Oe=0,Ui=null;ei!==null&&ai<We.length;ai++){ei.index>ai?(Ui=ei,ei=null):Ui=ei.sibling;var on=nt(Ge,ei,We[ai],_t);
vendor: 4,378 bytes, line 8
8if(on===null){ei===null&&(ei=Ui);break}r&&ei&&on.alternate===null&&s(Ge,ei),Oe=I(on,Oe,ai),cn===null?ci=on:cn.sibling=on,cn=on,ei=Ui}if(ai===We.length)return d(Ge,ei),Ii&&ni(Ge,ai),ci;if(ei===null){for(;ai<We.length;ai++)ei=xt(Ge,We[ai],_t),ei!==null&&(Oe=I(ei,Oe,ai),cn===null?ci=ei:cn.sibling=ei,cn=ei);return Ii&&ni(Ge,ai),ci}for(ei=y(ei);ai<We.length;ai++)Ui=ot(ei,Ge,ai,We[ai],_t),Ui!==null&&(r&&Ui.alternate!==null&&ei.delete(Ui.key===null?ai:Ui.key),Oe=I(Ui,Oe,ai),cn===null?ci=Ui:cn.sibling=Ui,cn=Ui);return r&&ei.forEach(function(ku){return s(Ge,ku)}),Ii&&ni(Ge,ai),ci}function di(Ge,Oe,We,_t){if(We==null)throw Error(R(151));for(var ci=null,cn=null,ei=Oe,ai=Oe=0,Ui=null,on=We.next();ei!==null&&!on.done;ai++,on=We.next()){ei.index>ai?(Ui=ei,ei=null):Ui=ei.sibling;var ku=nt(Ge,ei,on.value,_t);if(ku===null){ei===null&&(ei=Ui);break}r&&ei&&ku.alternate===null&&s(Ge,ei),Oe=I(ku,Oe,ai),cn===null?ci=ku:cn.sibling=ku,cn=ku,ei=Ui}if(on.done)return d(Ge,ei),Ii&&ni(Ge,ai),ci;if(ei===null){for(;!on.done;ai++,on=We.next())on=xt(Ge,on.value,_t),on!==null&&(Oe=I(on,Oe,ai),cn===null?ci=on:cn.sibling=on,cn=on);return Ii&&ni(Ge,ai),ci}for(ei=y(ei);!on.done;ai++,on=We.next())on=ot(ei,Ge,ai,on.value,_t),on!==null&&(r&&on.alternate!==null&&ei.delete(on.key===null?ai:on.key),Oe=I(on,Oe,ai),cn===null?ci=on:cn.sibling=on,cn=on);return r&&ei.forEach(function(Jp){return s(Ge,Jp)}),Ii&&ni(Ge,ai),ci}function Mn(Ge,Oe,We,_t){if(typeof We=="object"&&We!==null&&We.type===Te&&We.key===null&&(We=We.props.children),typeof We=="object"&&We!==null){switch(We.$$typeof){case Se:e:{for(var ci=We.key;Oe!==null;){if(Oe.key===ci){if(ci=We.type,ci===Te){if(Oe.tag===7){d(Ge,Oe.sibling),_t=M(Oe,We.props.children),_t.return=Ge,Ge=_t;break e}}else if(Oe.elementType===ci||typeof ci=="object"&&ci!==null&&ci.$$typeof===vi&&Es(ci)===Oe.type){d(Ge,Oe.sibling),_t=M(Oe,We.props),Oo(_t,We),_t.return=Ge,Ge=_t;break e}d(Ge,Oe);break}else s(Ge,Oe);Oe=Oe.sibling}We.type===Te?(_t=Lo(We.props.children,Ge.mode,_t,We.key),_t.return=Ge,Ge=_t):(_t=cu(We.type,We.key,We.props,null,Ge.mode,_t),Oo(_t,We),_t.return=Ge,Ge=_t)}return Y(Ge);case Ie:e:{for(ci=We.key;Oe!==null;){if(Oe.key===ci)if(Oe.tag===4&&Oe.stateNode.containerInfo===We.containerInfo&&Oe.stateNode.implementation===We.implementation){d(Ge,Oe.sibling),_t=M(Oe,We.children||[]),_t.return=Ge,Ge=_t;break e}else{d(Ge,Oe);break}else s(Ge,Oe);Oe=Oe.sibling}_t=Do(We,Ge.mode,_t),_t.return=Ge,Ge=_t}return Y(Ge);case vi:return We=Es(We),Mn(Ge,Oe,We,_t)}if(Vi(We))return Jt(Ge,Oe,We,_t);if(Xt(We)){if(ci=Xt(We),typeof ci!="function")throw Error(R(150));return We=ci.call(We),di(Ge,Oe,We,_t)}if(typeof We.then=="function")return Mn(Ge,Oe,Lc(We),_t);if(We.$$typeof===dt)return Mn(Ge,Oe,Ac(Ge,We),_t);_h(Ge,We)}return typeof We=="string"&&We!==""||typeof We=="number"||typeof We=="bigint"?(We=""+We,Oe!==null&&Oe.tag===6?(d(Ge,Oe.sibling),_t=M(Oe,We),_t.return=Ge,Ge=_t):(d(Ge,Oe),_t=Yu(We,Ge.mode,_t),_t.return=Ge,Ge=_t),Y(Ge)):d(Ge,Oe)}return function(Ge,Oe,We,_t){try{fu=0;var ci=Mn(Ge,Oe,We,_t);return Ro=null,ci}catch(ei){if(ei===eo||ei===Oa)throw ei;var cn=fa(29,ei,null,Ge.mode);return cn.lanes=_t,cn.return=Ge,cn}}}var Bo=Dc(!0),Wh=Dc(!1),No=!1;function yh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ic(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Fo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function pl(r,s,d){var y=r.updateQueue;if(y===null)return null;if(y=y.shared,(gn&2)!==0){var M=y.pending;return M===null?s.next=s:(s.next=M.next,M.next=s),y.pending=s,s=hl(r),cl(r,null,d),s}return Ws(r,y,s,d),hl(r)}function As(r,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194048)!==0)){var y=s.lanes;y&=r.pendingLanes,d|=y,s.lanes=d,ir(r,d)}}function an(r,s){var d=r.updateQueue,y=r.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var M=null,I=null;if(d=d.firstBaseUpdate,d!==null){do{var Y={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};I===null?M=I=Y:I=I.next=Y,d=d.next}while(d!==null);I===null?M=I=s:I=I.next=s}else M=I=s;d={baseState:y.baseState,firstBaseUpdate:M,lastBaseUpdate:I,shared:y.shared,callbacks:y.callbacks},r.updateQueue=d;return}
vendor: 6,386 bytes, line 8
8r=d.lastBaseUpdate,r===null?d.firstBaseUpdate=s:r.next=s,d.lastBaseUpdate=s}var Kh=!1;function ml(){if(Kh){var r=ya;if(r!==null)throw r}}function Ul(r,s,d,y){Kh=!1;var M=r.updateQueue;No=!1;var I=M.firstBaseUpdate,Y=M.lastBaseUpdate,ue=M.shared.pending;if(ue!==null){M.shared.pending=null;var De=ue,Je=De.next;De.next=null,Y===null?I=Je:Y.next=Je,Y=De;var ht=r.alternate;ht!==null&&(ht=ht.updateQueue,ue=ht.lastBaseUpdate,ue!==Y&&(ue===null?ht.firstBaseUpdate=Je:ue.next=Je,ht.lastBaseUpdate=De))}if(I!==null){var xt=M.baseState;Y=0,ht=Je=De=null,ue=I;do{var nt=ue.lane&-536870913,ot=nt!==ue.lane;if(ot?(Gi&nt)===nt:(y&nt)===nt){nt!==0&&nt===du&&(Kh=!0),ht!==null&&(ht=ht.next={lane:0,tag:ue.tag,payload:ue.payload,callback:null,next:null});e:{var Jt=r,di=ue;nt=s;var Mn=d;switch(di.tag){case 1:if(Jt=di.payload,typeof Jt=="function"){xt=Jt.call(Mn,xt,nt);break e}xt=Jt;break e;case 3:Jt.flags=Jt.flags&-65537|128;case 0:if(Jt=di.payload,nt=typeof Jt=="function"?Jt.call(Mn,xt,nt):Jt,nt==null)break e;xt=ne({},xt,nt);break e;case 2:No=!0}}nt=ue.callback,nt!==null&&(r.flags|=64,ot&&(r.flags|=8192),ot=M.callbacks,ot===null?M.callbacks=[nt]:ot.push(nt))}else ot={lane:nt,tag:ue.tag,payload:ue.payload,callback:ue.callback,next:null},ht===null?(Je=ht=ot,De=xt):ht=ht.next=ot,Y|=nt;if(ue=ue.next,ue===null){if(ue=M.shared.pending,ue===null)break;ot=ue,ue=ot.next,ot.next=null,M.lastBaseUpdate=ot,M.shared.pending=null}}while(!0);ht===null&&(De=xt),M.baseState=De,M.firstBaseUpdate=Je,M.lastBaseUpdate=ht,I===null&&(M.shared.lanes=0),Eu|=Y,r.lanes=Y,r.memoizedState=xt}}function kc(r,s){if(typeof r!="function")throw Error(R(191,r));r.call(s)}function vh(r,s){var d=r.callbacks;if(d!==null)for(r.callbacks=null,r=0;r<d.length;r++)kc(d[r],s)}var pu=ze(null),Rc=ze(0);function Qh(r,s){r=Mu,Et(Rc,r),Et(pu,s),Mu=r|s.baseLanes}function os(){Et(Rc,Mu),Et(pu,pu.current)}function mu(){Mu=Rc.current,rt(pu),rt(Rc)}var Ut=ze(null),$t=null;function Ps(r){var s=r.alternate;Et(Yn,Yn.current&1),Et(Ut,r),$t===null&&(s===null||pu.current!==null||s.memoizedState!==null)&&($t=r)}function ec(r){Et(Yn,Yn.current),Et(Ut,r),$t===null&&($t=r)}function Oc(r){r.tag===22?(Et(Yn,Yn.current),Et(Ut,r),$t===null&&($t=r)):rr()}function rr(){Et(Yn,Yn.current),Et(Ut,Ut.current)}function Gn(r){rt(Ut),$t===r&&($t=null),rt(Yn)}var Yn=ze(0);function Bc(r){for(var s=r;s!==null;){if(s.tag===13){var d=s.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||ja(d)||_r(d)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var gl=0,Ei=null,tn=null,Si=null,Fn=!1,zs=!1,io=!1,gu=0,_u=0,_l=null,Jh=0;function Ln(){throw Error(R(321))}function no(r,s){if(s===null)return!1;for(var d=0;d<s.length&&d<r.length;d++)if(!Sr(r[d],s[d]))return!1;return!0}function tc(r,s,d,y,M,I){return gl=I,Ei=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Ke.H=r===null||r.memoizedState===null?mn:cr,io=!1,I=d(y,M),io=!1,zs&&(I=Nc(s,d,y,M)),ic(r),I}function ic(r){Ke.H=sn;var s=tn!==null&&tn.next!==null;if(gl=0,Si=tn=Ei=null,Fn=!1,_u=0,_l=null,s)throw Error(R(300));r===null||Ir||(r=r.dependencies,r!==null&&Wu(r)&&(Ir=!0))}function Nc(r,s,d,y){Ei=r;var M=0;do{if(zs&&(_l=null),_u=0,zs=!1,25<=M)throw Error(R(301));if(M+=1,Si=tn=null,r.updateQueue!=null){var I=r.updateQueue;I.lastEffect=null,I.events=null,I.stores=null,I.memoCache!=null&&(I.memoCache.index=0)}Ke.H=gr,I=s(d,y)}while(zs);return I}function Fc(){var r=Ke.H,s=r.useState()[0];return s=typeof s.then=="function"?yu(s):s,r=r.useState()[0],(tn!==null?tn.memoizedState:null)!==r&&(Ei.flags|=1024),s}function jc(){var r=gu!==0;return gu=0,r}function Vl(r,s,d){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~d}function yl(r){if(Fn){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Fn=!1}gl=0,Si=tn=Ei=null,zs=!1,_u=gu=0,_l=null}function Kr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Si===null?Ei.memoizedState=Si=r:Si=Si.next=r,Si}function jn(){if(tn===null){var r=Ei.alternate;r=r!==null?r.memoizedState:null}else r=tn.next;var s=Si===null?Ei.memoizedState:Si.next;if(s!==null)Si=s,tn=r;else{if(r===null)throw Ei.alternate===null?Error(R(467)):Error(R(310));tn=r,r={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},Si===null?Ei.memoizedState=Si=r:Si=Si.next=r}return Si}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yu(r){var s=_u;return _u+=1,_l===null&&(_l=[]),r=mh(_l,r,s),s=Ei,(Si===null?s.memoizedState:Si.next)===null&&(s=s.alternate,Ke.H=s===null||s.memoizedState===null?mn:cr),r}function vu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return yu(r);if(r.$$typeof===dt)return ur(r)}throw Error(R(438,String(r)))}function nc(r){var s=null,d=Ei.updateQueue;if(d!==null&&(s=d.memoCache),s==null){var y=Ei.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(s={data:y.data.map(function(M){return M.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),d===null&&(d=jo(),Ei.updateQueue=d),d.memoCache=s,d=s.data[s.index],d===void 0)for(d=s.data[s.index]=Array(r),y=0;y<r;y++)d[y]=qt;return s.index++,d}function ro(r,s){return typeof s=="function"?s(r):s}function g(r){var s=jn();return t(s,tn,r)}function t(r,s,d){var y=r.queue;if(y===null)throw Error(R(311));y.lastRenderedReducer=d;var M=r.baseQueue,I=y.pending;if(I!==null){if(M!==null){var Y=M.next;M.next=I.next,I.next=Y}s.baseQueue=M=I,y.pending=null}if(I=r.baseState,M===null)r.memoizedState=I;else{s=M.next;var ue=Y=null,De=null,Je=s,ht=!1;do{var xt=Je.lane&-536870913;if(xt!==Je.lane?(Gi&xt)===xt:(gl&xt)===xt){var nt=Je.revertLane;if(nt===0)De!==null&&(De=De.next={lane:0,revertLane:0,gesture:null,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null}),xt===du&&(ht=!0);else if((gl&nt)===nt){Je=Je.next,nt===du&&(ht=!0);continue}else xt={lane:0,revertLane:Je.revertLane,gesture:null,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null}
vendor: 5,804 bytes, line 8
8,De===null?(ue=De=xt,Y=I):De=De.next=xt,Ei.lanes|=nt,Eu|=nt;xt=Je.action,io&&d(I,xt),I=Je.hasEagerState?Je.eagerState:d(I,xt)}else nt={lane:xt,revertLane:Je.revertLane,gesture:Je.gesture,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},De===null?(ue=De=nt,Y=I):De=De.next=nt,Ei.lanes|=xt,Eu|=xt;Je=Je.next}while(Je!==null&&Je!==s);if(De===null?Y=I:De.next=ue,!Sr(I,r.memoizedState)&&(Ir=!0,ht&&(d=ya,d!==null)))throw d;r.memoizedState=I,r.baseState=Y,r.baseQueue=De,y.lastRenderedState=I}return M===null&&(y.lanes=0),[r.memoizedState,y.dispatch]}function a(r){var s=jn(),d=s.queue;if(d===null)throw Error(R(311));d.lastRenderedReducer=r;var y=d.dispatch,M=d.pending,I=s.memoizedState;if(M!==null){d.pending=null;var Y=M=M.next;do I=r(I,Y.action),Y=Y.next;while(Y!==M);Sr(I,s.memoizedState)||(Ir=!0),s.memoizedState=I,s.baseQueue===null&&(s.baseState=I),d.lastRenderedState=I}return[I,y]}function c(r,s,d){var y=Ei,M=jn(),I=Ii;if(I){if(d===void 0)throw Error(R(407));d=d()}else d=s();var Y=!Sr((tn||M).memoizedState,d);if(Y&&(M.memoizedState=d,Ir=!0),M=M.queue,Xe(b.bind(null,y,M,r),[r]),M.getSnapshot!==s||Y||Si!==null&&Si.memoizedState.tag&1){if(y.flags|=2048,we(9,{destroy:void 0},v.bind(null,y,M,d,s),null),Un===null)throw Error(R(349));I||(gl&127)!==0||f(y,s,d)}return d}function f(r,s,d){r.flags|=16384,r={getSnapshot:s,value:d},s=Ei.updateQueue,s===null?(s=jo(),Ei.updateQueue=s,s.stores=[r]):(d=s.stores,d===null?s.stores=[r]:d.push(r))}function v(r,s,d,y){s.value=d,s.getSnapshot=y,C(s)&&z(r)}function b(r,s,d){return d(function(){C(s)&&z(r)})}function C(r){var s=r.getSnapshot;r=r.value;try{var d=s();return!Sr(r,d)}catch{return!0}}function z(r){var s=Yr(r,2);s!==null&&Bs(s,r,2)}function O(r){var s=Kr();if(typeof r=="function"){var d=r;if(r=d(),io){Pe(!0);try{d()}finally{Pe(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:r},s}function U(r,s,d,y){return r.baseState=d,t(r,tn,typeof y=="function"?y:ro)}function H(r,s,d,y,M){if(ls(r))throw Error(R(485));if(r=s.action,r!==null){var I={payload:M,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Y){I.listeners.push(Y)}};Ke.T!==null?d(!0):I.isTransition=!1,y(I),d=s.pending,d===null?(I.next=s.pending=I,q(s,I)):(I.next=d.next,s.pending=d.next=I)}}function q(r,s){var d=s.action,y=s.payload,M=r.state;if(s.isTransition){var I=Ke.T,Y={};Ke.T=Y;try{var ue=d(M,y),De=Ke.S;De!==null&&De(Y,ue),Q(r,s,ue)}catch(Je){de(r,s,Je)}finally{I!==null&&Y.types!==null&&(I.types=Y.types),Ke.T=I}}else try{I=d(M,y),Q(r,s,I)}catch(Je){de(r,s,Je)}}function Q(r,s,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(y){re(r,s,y)},function(y){return de(r,s,y)}):re(r,s,d)}function re(r,s,d){s.status="fulfilled",s.value=d,pe(s),r.state=d,s=r.pending,s!==null&&(d=s.next,d===s?r.pending=null:(d=d.next,s.next=d,q(r,d)))}function de(r,s,d){var y=r.pending;if(r.pending=null,y!==null){y=y.next;do s.status="rejected",s.reason=d,pe(s),s=s.next;while(s!==y)}r.action=null}function pe(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function fe(r,s){return s}function _e(r,s){if(Ii){var d=Un.formState;if(d!==null){e:{var y=Ei;if(Ii){if(ji){t:{for(var M=ji,I=Aa;M.nodeType!==8;){if(!I){M=null;break t}if(M=co(M.nextSibling),M===null){M=null;break t}}I=M.data,M=I==="F!"||I==="F"?M:null}if(M){ji=co(M.nextSibling),y=M.data==="F!";break e}}ga(y)}y=!1}y&&(s=d[0])}}return d=Kr(),d.memoizedState=d.baseState=s,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fe,lastRenderedState:s},d.queue=y,d=rc.bind(null,Ei,y),y.dispatch=d,y=O(!1),I=Na.bind(null,Ei,!1,y.queue),y=Kr(),M={state:s,dispatch:null,action:r,pending:null},y.queue=M,d=H.bind(null,Ei,M,I,d),M.dispatch=d,y.memoizedState=r,[s,d,!1]}function Me(r){var s=jn();return me(s,tn,r)}function me(r,s,d){if(s=t(r,s,fe)[0],r=g(ro)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var y=yu(s)}catch(Y){throw Y===eo?Oa:Y}else y=s;s=jn();var M=s.queue,I=M.dispatch;return d!==s.memoizedState&&(Ei.flags|=2048,we(9,{destroy:void 0},Ce.bind(null,M,d),null)),[y,I,r]}function Ce(r,s){r.action=s}function Le(r){var s=jn(),d=tn;if(d!==null)return me(s,d,r);jn(),s=s.memoizedState,d=jn();var y=d.queue.dispatch;return d.memoizedState=r,[s,y,!1]}function we(r,s,d,y){return r={tag:r,create:d,deps:y,inst:s,next:null},s=Ei.updateQueue,s===null&&(s=jo(),Ei.updateQueue=s),d=s.lastEffect,d===null?s.lastEffect=r.next=r:(y=d.next,d.next=r,r.next=y,s.lastEffect=r),r}function Re(){return jn().memoizedState}function Ye(r,s,d,y){var M=Kr();Ei.flags|=r,M.memoizedState=we(1|s,{destroy:void 0},d,y===void 0?null:y)}function qe(r,s,d,y){var M=jn();y=y===void 0?null:y;var I=M.memoizedState.inst;tn!==null&&y!==null&&no(y,tn.memoizedState.deps)?M.memoizedState=we(s,I,d,y):(Ei.flags|=r,M.memoizedState=we(1|s,I,d,y))}function $e(r,s){Ye(8390656,8,r,s)}function Xe(r,s){qe(2048,8,r,s)}function Mt(r){Ei.flags|=4;var s=Ei.updateQueue;if(s===null)s=jo(),Ei.updateQueue=s,s.events=[r];else{var d=s.events;d===null?s.events=[r]:d.push(r)}}function At(r){var s=jn().memoizedState;return Mt({ref:s,nextImpl:r}),function(){if((gn&2)!==0)throw Error(R(440));return s.impl.apply(void 0,arguments)}}function pt(r,s){return qe(4,2,r,s)}function Lt(r,s){return qe(4,4,r,s)}function _i(r,s){if(typeof s=="function"){r=r();var d=s(r);return function(){typeof d=="function"?d():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function nn(r,s,d){d=d!=null?d.concat([r]):null,qe(4,4,_i.bind(null,s,r),d)}function bn(){}function pn(r,s){var d=jn();s=s===void 0?null:s;var y=d.memoizedState;return s!==null&&no(s,y[1])?y[0]:(d.memoizedState=[r,s],r)}function Dn(r,s){var d=jn();s=s===void 0?null:s;var y=d.memoizedState;
vendor: 4,241 bytes, line 8
8if(s!==null&&no(s,y[1]))return y[0];if(y=r(),io){Pe(!0);try{r()}finally{Pe(!1)}}return d.memoizedState=[y,s],y}function ln(r,s,d){return d===void 0||(gl&1073741824)!==0&&(Gi&261930)===0?r.memoizedState=s:(r.memoizedState=d,r=Dm(),Ei.lanes|=r,Eu|=r,d)}function qn(r,s,d,y){return Sr(d,s)?d:pu.current!==null?(r=ln(r,d,y),Sr(r,s)||(Ir=!0),r):(gl&42)===0||(gl&1073741824)!==0&&(Gi&261930)===0?(Ir=!0,r.memoizedState=d):(r=Dm(),Ei.lanes|=r,Eu|=r,s)}function In(r,s,d,y,M){var I=mt.p;mt.p=I!==0&&8>I?I:8;var Y=Ke.T,ue={};Ke.T=ue,Na(r,!1,s,d);try{var De=M(),Je=Ke.S;if(Je!==null&&Je(ue,De),De!==null&&typeof De=="object"&&typeof De.then=="function"){var ht=Pc(De,y);so(r,s,ht,Os(r))}else so(r,s,y,Os(r))}catch(xt){so(r,s,{then:function(){},status:"rejected",reason:xt},Os())}finally{mt.p=I,Y!==null&&ue.types!==null&&(Y.types=ue.types),Ke.T=Y}}function Lr(){}function Wn(r,s,d,y){if(r.tag!==5)throw Error(R(476));var M=Kn(r).queue;In(r,M,s,gt,d===null?Lr:function(){return Dr(r),d(y)})}function Kn(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:gt,baseState:gt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:gt},next:null};var d={};return s.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:d},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Dr(r){var s=Kn(r);s.next===null&&(s=r.alternate.memoizedState),so(r,s.next.queue,{},Os())}function Uo(){return ur(Uh)}function Vo(){return jn().memoizedState}function ao(){return jn().memoizedState}function Ba(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var d=Os();r=Fo(d);var y=pl(s,r,d);y!==null&&(Bs(y,s,d),As(y,s,d)),s={cache:ko()},r.payload=s;return}s=s.return}}function xu(r,s,d){var y=Os();d={lane:y,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ls(r)?Ls(s,d):(d=zo(r,s,d,y),d!==null&&(Bs(d,r,y),Ds(d,s,y)))}function rc(r,s,d){var y=Os();so(r,s,d,y)}function so(r,s,d,y){var M={lane:y,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(ls(r))Ls(s,M);else{var I=r.alternate;if(r.lanes===0&&(I===null||I.lanes===0)&&(I=s.lastRenderedReducer,I!==null))try{var Y=s.lastRenderedState,ue=I(Y,d);if(M.hasEagerState=!0,M.eagerState=ue,Sr(ue,Y))return Ws(r,s,M,0),Un===null&&Po(),!1}catch{}if(d=zo(r,s,M,y),d!==null)return Bs(d,r,y),Ds(d,s,y),!0}return!1}function Na(r,s,d,y){if(y={lane:2,revertLane:Mp(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},ls(r)){if(s)throw Error(R(479))}else s=zo(r,d,y,2),s!==null&&Bs(s,r,2)}function ls(r){var s=r.alternate;return r===Ei||s!==null&&s===Ei}function Ls(r,s){zs=Fn=!0;var d=r.pending;d===null?s.next=s:(s.next=d.next,d.next=s),r.pending=s}function Ds(r,s,d){if((d&4194048)!==0){var y=s.lanes;y&=r.pendingLanes,d|=y,s.lanes=d,ir(r,d)}}var sn={readContext:ur,use:vu,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useLayoutEffect:Ln,useInsertionEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useSyncExternalStore:Ln,useId:Ln,useHostTransitionStatus:Ln,useFormState:Ln,useActionState:Ln,useOptimistic:Ln,useMemoCache:Ln,useCacheRefresh:Ln};sn.useEffectEvent=Ln;var mn={readContext:ur,use:vu,useCallback:function(r,s){return Kr().memoizedState=[r,s===void 0?null:s],r},useContext:ur,useEffect:$e,useImperativeHandle:function(r,s,d){d=d!=null?d.concat([r]):null,Ye(4194308,4,_i.bind(null,s,r),d)},useLayoutEffect:function(r,s){return Ye(4194308,4,r,s)},useInsertionEffect:function(r,s){Ye(4,2,r,s)},useMemo:function(r,s){var d=Kr();s=s===void 0?null:s;var y=r();if(io){Pe(!0);try{r()}finally{Pe(!1)}}return d.memoizedState=[y,s],y},useReducer:function(r,s,d){var y=Kr();if(d!==void 0){var M=d(s);if(io){Pe(!0);try{d(s)}finally{Pe(!1)}}}else M=s;return y.memoizedState=y.baseState=M,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:M},y.queue=r,r=r.dispatch=xu.bind(null,Ei,r),[y.memoizedState,r]},useRef:function(r){var s=Kr();return r={current:r},s.memoizedState=r},useState:function(r){r=O(r);var s=r.queue,d=rc.bind(null,Ei,s);return s.dispatch=d,[r.memoizedState,d]}
vendor: 16,584 bytes, line 8
8,useDebugValue:bn,useDeferredValue:function(r,s){var d=Kr();return ln(d,r,s)},useTransition:function(){var r=O(!1);return r=In.bind(null,Ei,r.queue,!0,!1),Kr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,d){var y=Ei,M=Kr();if(Ii){if(d===void 0)throw Error(R(407));d=d()}else{if(d=s(),Un===null)throw Error(R(349));(Gi&127)!==0||f(y,s,d)}M.memoizedState=d;var I={value:d,getSnapshot:s};return M.queue=I,$e(b.bind(null,y,I,r),[r]),y.flags|=2048,we(9,{destroy:void 0},v.bind(null,y,I,d,s),null),d},useId:function(){var r=Kr(),s=Un.identifierPrefix;if(Ii){var d=Rt,y=vt;d=(y&~(1<<32-Fe(y)-1)).toString(32)+d,s="_"+s+"R_"+d,d=gu++,0<d&&(s+="H"+d.toString(32)),s+="_"}else d=Jh++,s="_"+s+"r_"+d.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:Uo,useFormState:_e,useActionState:_e,useOptimistic:function(r){var s=Kr();s.memoizedState=s.baseState=r;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=d,s=Na.bind(null,Ei,!0,d),d.dispatch=s,[r,s]},useMemoCache:nc,useCacheRefresh:function(){return Kr().memoizedState=Ba.bind(null,Ei)},useEffectEvent:function(r){var s=Kr(),d={impl:r};return s.memoizedState=d,function(){if((gn&2)!==0)throw Error(R(440));return d.impl.apply(void 0,arguments)}}},cr={readContext:ur,use:vu,useCallback:pn,useContext:ur,useEffect:Xe,useImperativeHandle:nn,useInsertionEffect:pt,useLayoutEffect:Lt,useMemo:Dn,useReducer:g,useRef:Re,useState:function(){return g(ro)},useDebugValue:bn,useDeferredValue:function(r,s){var d=jn();return qn(d,tn.memoizedState,r,s)},useTransition:function(){var r=g(ro)[0],s=jn().memoizedState;return[typeof r=="boolean"?r:yu(r),s]},useSyncExternalStore:c,useId:Vo,useHostTransitionStatus:Uo,useFormState:Me,useActionState:Me,useOptimistic:function(r,s){var d=jn();return U(d,tn,r,s)},useMemoCache:nc,useCacheRefresh:ao};cr.useEffectEvent=At;var gr={readContext:ur,use:vu,useCallback:pn,useContext:ur,useEffect:Xe,useImperativeHandle:nn,useInsertionEffect:pt,useLayoutEffect:Lt,useMemo:Dn,useReducer:a,useRef:Re,useState:function(){return a(ro)},useDebugValue:bn,useDeferredValue:function(r,s){var d=jn();return tn===null?ln(d,r,s):qn(d,tn.memoizedState,r,s)},useTransition:function(){var r=a(ro)[0],s=jn().memoizedState;return[typeof r=="boolean"?r:yu(r),s]},useSyncExternalStore:c,useId:Vo,useHostTransitionStatus:Uo,useFormState:Le,useActionState:Le,useOptimistic:function(r,s){var d=jn();return tn!==null?U(d,tn,r,s):(d.baseState=r,[r,d.queue.dispatch])},useMemoCache:nc,useCacheRefresh:ao};gr.useEffectEvent=At;function xh(r,s,d,y){s=r.memoizedState,d=d(y,s),d=d==null?s:ne({},s,d),r.memoizedState=d,r.lanes===0&&(r.updateQueue.baseState=d)}var bh={enqueueSetState:function(r,s,d){r=r._reactInternals;var y=Os(),M=Fo(y);M.payload=s,d!=null&&(M.callback=d),s=pl(r,M,y),s!==null&&(Bs(s,r,y),As(s,r,y))},enqueueReplaceState:function(r,s,d){r=r._reactInternals;var y=Os(),M=Fo(y);M.tag=1,M.payload=s,d!=null&&(M.callback=d),s=pl(r,M,y),s!==null&&(Bs(s,r,y),As(s,r,y))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var d=Os(),y=Fo(d);y.tag=2,s!=null&&(y.callback=s),s=pl(r,y,d),s!==null&&(Bs(s,r,d),As(s,r,d))}};function Zl(r,s,d,y,M,I,Y){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(y,I,Y):s.prototype&&s.prototype.isPureReactComponent?!Xs(d,y)||!Xs(M,I):!0}function Hd(r,s,d,y){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(d,y),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(d,y),s.state!==r&&bh.enqueueReplaceState(s,s.state,null)}function Gl(r,s){var d=s;if("ref"in s){d={};for(var y in s)y!=="ref"&&(d[y]=s[y])}if(r=r.defaultProps){d===s&&(d=ne({},d));for(var M in r)d[M]===void 0&&(d[M]=r[M])}return d}function wh(r){ns(r)}function vl(r){console.error(r)}function xl(r){ns(r)}function oo(r,s){try{var d=r.onUncaughtError;d(s.value,{componentStack:s.stack})}catch(y){setTimeout(function(){throw y})}}function Th(r,s,d){try{var y=r.onCaughtError;y(d.value,{componentStack:d.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function Uc(r,s,d){return d=Fo(d),d.tag=3,d.payload={element:null},d.callback=function(){oo(r,s)},d}function Vc(r){return r=Fo(r),r.tag=3,r}function Zc(r,s,d,y){var M=d.type.getDerivedStateFromError;if(typeof M=="function"){var I=y.value;r.payload=function(){return M(I)},r.callback=function(){Th(s,d,y)}}var Y=d.stateNode;Y!==null&&typeof Y.componentDidCatch=="function"&&(r.callback=function(){Th(s,d,y),typeof M!="function"&&(Au===null?Au=new Set([this]):Au.add(this));var ue=y.stack;this.componentDidCatch(y.value,{componentStack:ue!==null?ue:""})})}function $d(r,s,d,y,M){if(d.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(s=d.alternate,s!==null&&as(s,d,M,!0),d=Ut.current,d!==null){switch(d.tag){case 31:case 13:return $t===null?yd():d.alternate===null&&hr===0&&(hr=3),d.flags&=-257,d.flags|=65536,d.lanes=M,y===Nt?d.flags|=16384:(s=d.updateQueue,s===null?d.updateQueue=new Set([y]):s.add(y),vf(r,y,M)),!1;case 22:return d.flags|=65536,y===Nt?d.flags|=16384:(s=d.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([y])},d.updateQueue=s):(d=s.retryQueue,d===null?s.retryQueue=new Set([y]):d.add(y)),vf(r,y,M)),!1}throw Error(R(435,d.tag))}return vf(r,y,M),yd(),!1}if(Ii)return s=Ut.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=M,y!==Sn&&(r=Error(R(422),{cause:y}),Qs(_(r,d)))):(y!==Sn&&(s=Error(R(423),{cause:y}),Qs(_(s,d))),r=r.current.alternate,r.flags|=65536,M&=-M,r.lanes|=M,y=_(y,d),M=Uc(r.stateNode,y,M),an(r,M),hr!==4&&(hr=2)),!1;var I=Error(R(520),{cause:y});if(I=_(I,d),pd===null?pd=[I]:pd.push(I),hr!==4&&(hr=2),s===null)return!0;y=_(y,d),d=s;do{switch(d.tag){case 3:return d.flags|=65536,r=M&-M,d.lanes|=r,r=Uc(d.stateNode,y,r),an(d,r),!1;case 1:if(s=d.type,I=d.stateNode,(d.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||I!==null&&typeof I.componentDidCatch=="function"&&(Au===null||!Au.has(I))))return d.flags|=65536,M&=-M,d.lanes|=M,M=Vc(M),Zc(M,r,d,y),an(d,M),!1}d=d.return}while(d!==null);return!1}var Xd=Error(R(461)),Ir=!1;function Qr(r,s,d,y){s.child=r===null?Wh(s,null,d,y):Bo(s,r.child,d,y)}function mm(r,s,d,y,M){d=d.render;var I=s.ref;if("ref"in y){var Y={};for(var ue in y)ue!=="ref"&&(Y[ue]=y[ue])}else Y=y;return fl(s),y=tc(r,s,d,Y,I,M),ue=jc(),r!==null&&!Ir?(Vl(r,s,M),Hl(r,s,M)):(Ii&&ue&&Xn(s),s.flags|=1,Qr(r,s,y,M),s.child)}function Yd(r,s,d,y,M){if(r===null){var I=d.type;return typeof I=="function"&&!uu(I)&&I.defaultProps===void 0&&d.compare===null?(s.tag=15,s.type=I,tp(r,s,I,y,M)):(r=cu(d.type,null,y,s,s.mode,M),r.ref=s.ref,r.return=s,s.child=r)}if(I=r.child,!id(r,M)){var Y=I.memoizedProps;if(d=d.compare,d=d!==null?d:Xs,d(Y,y)&&r.ref===s.ref)return Hl(r,s,M)}return s.flags|=1,r=pa(I,y),r.ref=s.ref,r.return=s,s.child=r}function tp(r,s,d,y,M){if(r!==null){var I=r.memoizedProps;if(Xs(I,y)&&r.ref===s.ref)if(Ir=!1,s.pendingProps=y=I,id(r,M))(r.flags&131072)!==0&&(Ir=!0);else return s.lanes=r.lanes,Hl(r,s,M)}return np(r,s,d,y,M)}function ip(r,s,d,y){var M=y.children,I=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((s.flags&128)!==0){if(I=I!==null?I.baseLanes|d:d,r!==null){for(y=s.child=r.child,M=0;y!==null;)M=M|y.lanes|y.childLanes,y=y.sibling;y=M&~I}else y=0,s.child=null;return gm(r,s,I,d,y)}if((d&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&ph(s,I!==null?I.cachePool:null),I!==null?Qh(s,I):os(),Oc(s);else return y=s.lanes=536870912,gm(r,s,I!==null?I.baseLanes|d:d,d,y)}else I!==null?(ph(s,I.cachePool),Qh(s,I),rr(),s.memoizedState=null):(r!==null&&ph(s,null),os(),rr());return Qr(r,s,M,d),s.child}function ql(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function gm(r,s,d,y,M){var I=fh();return I=I===null?null:{parent:nr._currentValue,pool:I},s.memoizedState={baseLanes:d,cachePool:I},r!==null&&ph(s,null),os(),Oc(s),r!==null&&as(r,s,y,!0),s.childLanes=M,null}function bu(r,s){return s=ef({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function ed(r,s,d){return Bo(s,r.child,null,d),r=bu(s,s.pendingProps),r.flags|=2,Gn(s),s.memoizedState=null,r}function Wd(r,s,d){var y=s.pendingProps,M=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(Ii){if(y.mode==="hidden")return r=bu(s,y),s.lanes=536870912,ql(null,r);if(ec(s),(r=ji)?(r=pc(r,Aa),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:tt!==null?{id:vt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},d=hu(r),d.return=s,s.child=d,Ki=s,ji=null)):r=null,r===null)throw ga(s);return s.lanes=536870912,null}return bu(s,y)}var I=r.memoizedState;if(I!==null){var Y=I.dehydrated;if(ec(s),M)if(s.flags&256)s.flags&=-257,s=ed(r,s,d);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(R(558));else if(Ir||as(r,s,d,!1),M=(d&r.childLanes)!==0,Ir||M){if(y=Un,y!==null&&(Y=An(y,d),Y!==0&&Y!==I.retryLane))throw I.retryLane=Y,Yr(r,Y),Bs(y,r,Y),Xd;yd(),s=ed(r,s,d)}else r=I.treeContext,ji=co(Y.nextSibling),Ki=s,Ii=!0,Ks=null,Aa=!1,r!==null&&ma(s,r),s=bu(s,y),s.flags|=4096;return s}return r=pa(r.child,{mode:y.mode,children:y.children}),r.ref=s.ref,s.child=r,r.return=s,r}function Kd(r,s){var d=s.ref;if(d===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(R(284));(r===null||r.ref!==d)&&(s.flags|=4194816)}}function np(r,s,d,y,M){return fl(s),d=tc(r,s,d,y,void 0,M),y=jc(),r!==null&&!Ir?(Vl(r,s,M),Hl(r,s,M)):(Ii&&y&&Xn(s),s.flags|=1,Qr(r,s,d,M),s.child)}function _m(r,s,d,y,M,I){return fl(s),s.updateQueue=null,d=Nc(s,y,d,M),ic(r),y=jc(),r!==null&&!Ir?(Vl(r,s,I),Hl(r,s,I)):(Ii&&y&&Xn(s),s.flags|=1,Qr(r,s,d,I),s.child)}function ym(r,s,d,y,M){if(fl(s),s.stateNode===null){var I=gi,Y=d.contextType;typeof Y=="object"&&Y!==null&&(I=ur(Y)),I=new d(y,I),s.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,I.updater=bh,s.stateNode=I,I._reactInternals=s,I=s.stateNode,I.props=y,I.state=s.memoizedState,I.refs={},yh(s),Y=d.contextType,I.context=typeof Y=="object"&&Y!==null?ur(Y):gi,I.state=s.memoizedState,Y=d.getDerivedStateFromProps,typeof Y=="function"&&(xh(s,d,Y,y),I.state=s.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(Y=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),Y!==I.state&&bh.enqueueReplaceState(I,I.state,null),Ul(s,y,I,M),ml(),I.state=s.memoizedState),typeof I.componentDidMount=="function"&&(s.flags|=4194308),y=!0}else if(r===null){I=s.stateNode;var ue=s.memoizedProps,De=Gl(d,ue);I.props=De;var Je=I.context,ht=d.contextType;Y=gi,typeof ht=="object"&&ht!==null&&(Y=ur(ht));var xt=d.getDerivedStateFromProps;ht=typeof xt=="function"||typeof I.getSnapshotBeforeUpdate=="function",ue=s.pendingProps!==ue,ht||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(ue||Je!==Y)&&Hd(s,I,y,Y),No=!1;var nt=s.memoizedState;I.state=nt,Ul(s,y,I,M),ml(),Je=s.memoizedState,ue||nt!==Je||No?(typeof xt=="function"&&(xh(s,d,xt,y),Je=s.memoizedState),(De=No||Zl(s,d,De,y,nt,Je,Y))?(ht||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(s.flags|=4194308)):(typeof I.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=y,s.memoizedState=Je),I.props=y,I.state=Je,I.context=Y,y=De):(typeof I.componentDidMount=="function"&&(s.flags|=4194308),y=!1)}else{I=s.stateNode,Ic(r,s),Y=s.memoizedProps,ht=Gl(d,Y),I.props=ht,xt=s.pendingProps,nt=I.context,Je=d.contextType,De=gi,typeof Je=="object"&&Je!==null&&(De=ur(Je)),ue=d.getDerivedStateFromProps,(Je=typeof ue=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==xt||nt!==De)&&Hd(s,I,y,De),No=!1,nt=s.memoizedState,I.state=nt,Ul(s,y,I,M),ml();var ot=s.memoizedState;Y!==xt||nt!==ot||No||r!==null&&r.dependencies!==null&&Wu(r.dependencies)?(typeof ue=="function"&&(xh(s,d,ue,y),ot=s.memoizedState),(ht=No||Zl(s,d,ht,y,nt,ot,De)||r!==null&&r.dependencies!==null&&Wu(r.dependencies))?(Je||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(y,ot,De),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(y,ot,De)),typeof I.componentDidUpdate=="function"&&(s.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof I.componentDidUpdate!="function"||Y===r.memoizedProps&&nt===r.memoizedState||(s.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===r.memoizedProps&&nt===r.memoizedState||(s.flags|=1024),s.memoizedProps=y,s.memoizedState=ot),I.props=y,I.state=ot,I.context=De,y=ht):(typeof I.componentDidUpdate!="function"||Y===r.memoizedProps&&nt===r.memoizedState||(s.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===r.memoizedProps&&nt===r.memoizedState||(s.flags|=1024),y=!1)}return I=y,Kd(r,s),y=(s.flags&128)!==0,I||y?(I=s.stateNode,d=y&&typeof d.getDerivedStateFromError!="function"?null:I.render(),s.flags|=1,r!==null&&y?(s.child=Bo(s,r.child,null,M),s.child=Bo(s,null,d,M)):Qr(r,s,d,M),s.memoizedState=I.state,r=s.child):r=Hl(r,s,M),r}function vm(r,s,d,y){return Ss(),s.flags|=256,Qr(r,s,d,y),s.child}var Qd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function td(r){return{baseLanes:r,cachePool:qd()}}function Jd(r,s,d){return r=r!==null?r.childLanes&~d:0,s&&(r|=La),r}function rp(r,s,d){var y=s.pendingProps,M=!1,I=(s.flags&128)!==0,Y;if((Y=I)||(Y=r!==null&&r.memoizedState===null?!1:(Yn.current&2)!==0),Y&&(M=!0,s.flags&=-129),Y=(s.flags&32)!==0,s.flags&=-33,r===null){if(Ii){if(M?Ps(s):rr(),(r=ji)?(r=pc(r,Aa),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:tt!==null?{id:vt,overflow:Rt}:null,retryLane:536870912,hydrationErrors:null},d=hu(r),d.return=s,s.child=d,Ki=s,ji=null)):r=null,r===null)throw ga(s);return _r(r)?s.lanes=32:s.lanes=536870912,null}var ue=y.children;return y=y.fallback,M?(rr(),M=s.mode,ue=ef({mode:"hidden",children:ue},M),y=Lo(y,M,d,null),ue.return=s,y.return=s,ue.sibling=y,s.child=ue,y=s.child,y.memoizedState=td(d),y.childLanes=Jd(r,Y,d),s.memoizedState=Qd,ql(null,y)):(Ps(s),ap(s,ue))}var De=r.memoizedState;if(De!==null&&(ue=De.dehydrated,ue!==null)){if(I)s.flags&256?(Ps(s),s.flags&=-257,s=tf(r,s,d)):s.memoizedState!==null?(rr(),s.child=r.child,s.flags|=128,s=null):(rr(),ue=y.fallback,M=s.mode,y=ef({mode:"visible",children:y.children},M),ue=Lo(ue,M,d,null),ue.flags|=2,y.return=s,ue.return=s,y.sibling=ue,s.child=y,Bo(s,r.child,null,d),y=s.child,y.memoizedState=td(d),y.childLanes=Jd(r,Y,d),s.memoizedState=Qd,s=ql(null,y));else if(Ps(s),_r(ue)){if(Y=ue.nextSibling&&ue.nextSibling.dataset,Y)var Je=Y.dgst;Y=Je,y=Error(R(419)),y.stack="",y.digest=Y,Qs({value:y,source:null,stack:null}),s=tf(r,s,d)}else if(Ir||as(r,s,d,!1),Y=(d&r.childLanes)!==0,Ir||Y){if(Y=Un,Y!==null&&(y=An(Y,d),y!==0&&y!==De.retryLane))throw De.retryLane=y,Yr(r,y),Bs(Y,r,y),Xd;ja(ue)||yd(),s=tf(r,s,d)}else ja(ue)?(s.flags|=192,s.child=r.child,s=null):(r=De.treeContext,ji=co(ue.nextSibling),Ki=s,Ii=!0,Ks=null,Aa=!1,r!==null&&ma(s,r),s=ap(s,y.children),s.flags|=4096);return s}return M?(rr(),ue=y.fallback,M=s.mode,De=r.child,Je=De.sibling,y=pa(De,{mode:"hidden",children:y.children}),y.subtreeFlags=De.subtreeFlags&65011712,Je!==null?ue=pa(Je,ue):(ue=Lo(ue,M,d,null),ue.flags|=2),ue.return=s,y.return=s,y.sibling=ue,s.child=y,ql(null,y),y=s.child,ue=r.child.memoizedState,ue===null?ue=td(d):(M=ue.cachePool,M!==null?(De=nr._currentValue,M=M.parent!==De?{parent:De,pool:De}:M):M=qd(),ue={baseLanes:ue.baseLanes|d,cachePool:M}),y.memoizedState=ue,y.childLanes=Jd(r,Y,d),s.memoizedState=Qd,ql(r.child,y)):(Ps(s),d=r.child,r=d.sibling,d=pa(d,{mode:"visible",children:y.children}),d.return=s,d.sibling=null,r!==null&&(Y=s.deletions,Y===null?(s.deletions=[r],s.flags|=16):Y.pu
vendor: 4,384 bytes, line 8
8sh(r)),s.child=d,s.memoizedState=null,d)}function ap(r,s){return s=ef({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function ef(r,s){return r=fa(22,r,null,s),r.lanes=0,r}function tf(r,s,d){return Bo(s,r.child,null,d),r=ap(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function sp(r,s,d){r.lanes|=s;var y=r.alternate;y!==null&&(y.lanes|=s),ch(r.return,s,d)}function op(r,s,d,y,M,I){var Y=r.memoizedState;Y===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:M,treeForkCount:I}:(Y.isBackwards=s,Y.rendering=null,Y.renderingStartTime=0,Y.last=y,Y.tail=d,Y.tailMode=M,Y.treeForkCount=I)}function nf(r,s,d){var y=s.pendingProps,M=y.revealOrder,I=y.tail;y=y.children;var Y=Yn.current,ue=(Y&2)!==0;if(ue?(Y=Y&1|2,s.flags|=128):Y&=1,Et(Yn,Y),Qr(r,s,y,d),y=Ii?oe:0,!ue&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&sp(r,d,s);else if(r.tag===19)sp(r,d,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(M){case"forwards":for(d=s.child,M=null;d!==null;)r=d.alternate,r!==null&&Bc(r)===null&&(M=d),d=d.sibling;d=M,d===null?(M=s.child,s.child=null):(M=d.sibling,d.sibling=null),op(s,!1,M,d,I,y);break;case"backwards":case"unstable_legacy-backwards":for(d=null,M=s.child,s.child=null;M!==null;){if(r=M.alternate,r!==null&&Bc(r)===null){s.child=M;break}r=M.sibling,M.sibling=d,d=M,M=r}op(s,!0,d,null,I,y);break;case"together":op(s,!1,null,null,void 0,y);break;default:s.memoizedState=null}return s.child}function Hl(r,s,d){if(r!==null&&(s.dependencies=r.dependencies),Eu|=s.lanes,(d&s.childLanes)===0)if(r!==null){if(as(r,s,d,!1),(d&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(R(153));if(s.child!==null){for(r=s.child,d=pa(r,r.pendingProps),s.child=d,d.return=s;r.sibling!==null;)r=r.sibling,d=d.sibling=pa(r,r.pendingProps),d.return=s;d.sibling=null}return s.child}function id(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Wu(r)))}function nd(r,s,d){switch(s.tag){case 3:wi(s,s.stateNode.containerInfo),dl(s,nr,r.memoizedState.cache),Ss();break;case 27:case 5:vr(s);break;case 4:wi(s,s.stateNode.containerInfo);break;case 10:dl(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,ec(s),null;break;case 13:var y=s.memoizedState;if(y!==null)return y.dehydrated!==null?(Ps(s),s.flags|=128,null):(d&s.child.childLanes)!==0?rp(r,s,d):(Ps(s),r=Hl(r,s,d),r!==null?r.sibling:null);Ps(s);break;case 19:var M=(r.flags&128)!==0;if(y=(d&s.childLanes)!==0,y||(as(r,s,d,!1),y=(d&s.childLanes)!==0),M){if(y)return nf(r,s,d);s.flags|=128}if(M=s.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),Et(Yn,Yn.current),y)break;return null;case 22:return s.lanes=0,ip(r,s,d,s.pendingProps);case 24:dl(s,nr,r.memoizedState.cache)}return Hl(r,s,d)}function Fa(r,s,d){if(r!==null)if(r.memoizedProps!==s.pendingProps)Ir=!0;else{if(!id(r,d)&&(s.flags&128)===0)return Ir=!1,nd(r,s,d);Ir=(r.flags&131072)!==0}else Ir=!1,Ii&&(s.flags&1048576)!==0&&Mi(s,oe,s.index);switch(s.lanes=0,s.tag){case 16:e:{var y=s.pendingProps;if(r=Es(s.elementType),s.type=r,typeof r=="function")uu(r)?(y=Gl(r,y),s.tag=1,s=ym(null,s,r,y,d)):(s.tag=0,s=np(null,s,r,y,d));else{if(r!=null){var M=r.$$typeof;if(M===Bt){s.tag=11,s=mm(null,s,r,y,d);break e}else if(M===Ft){s.tag=14,s=Yd(null,s,r,y,d);break e}}throw s=ii(r)||r,Error(R(306,s,""))}}return s;case 0:return np(r,s,s.type,s.pendingProps,d);case 1:return y=s.type,M=Gl(y,s.pendingProps),ym(r,s,y,M,d);case 3:e:{if(wi(s,s.stateNode.containerInfo),r===null)throw Error(R(387));y=s.pendingProps;var I=s.memoizedState;M=I.element,Ic(r,s),Ul(s,y,null,d);var Y=s.memoizedState;if(y=Y.cache,dl(s,nr,y),y!==I.cache&&hh(s,[nr],d,!0),ml(),y=Y.element,I.isDehydrated)if(I={element:y,isDehydrated:!1,cache:Y.cache},s.updateQueue.baseState=I,s.memoizedState=I,s.flags&256){s=vm(r,s,y,d);break e}else if(y!==M){M=_(Error(R(424)),s),Qs(M),s=vm(r,s,y,d);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,ji=co(r.firstChild),Ki=s,Ii=!0,Ks=null,Aa=!0,d=Wh(s,null,y,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Ss(),y===M){s=Hl(r,s,d);break e}
vendor: 5,099 bytes, line 8
8Qr(r,s,y,d)}s=s.child}return s;case 26:return Kd(r,s),r===null?(d=Up(s.type,null,s.pendingProps,null))?s.memoizedState=d:Ii||(d=s.type,r=s.pendingProps,y=Sd(Ct.current).createElement(d),y[Pi]=s,y[bt]=r,ea(y,d,r),Rn(y),s.stateNode=y):s.memoizedState=Up(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return vr(s),r===null&&Ii&&(y=s.stateNode=Jm(s.type,s.pendingProps,Ct.current),Ki=s,Aa=!0,M=ji,fc(s.type)?(ds=M,ji=co(y.firstChild)):ji=M),Qr(r,s,s.pendingProps.children,d),Kd(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&Ii&&((M=y=ji)&&(y=va(y,s.type,s.pendingProps,Aa),y!==null?(s.stateNode=y,Ki=s,ji=co(y.firstChild),Aa=!1,M=!0):M=!1),M||ga(s)),vr(s),M=s.type,I=s.pendingProps,Y=r!==null?r.memoizedProps:null,y=I.children,zf(M,I)?y=null:Y!==null&&zf(M,Y)&&(s.flags|=32),s.memoizedState!==null&&(M=tc(r,s,Fc,null,null,d),Uh._currentValue=M),Kd(r,s),Qr(r,s,y,d),s.child;case 6:return r===null&&Ii&&((r=d=ji)&&(d=Cl(d,s.pendingProps,Aa),d!==null?(s.stateNode=d,Ki=s,ji=null,r=!0):r=!1),r||ga(s)),null;case 13:return rp(r,s,d);case 4:return wi(s,s.stateNode.containerInfo),y=s.pendingProps,r===null?s.child=Bo(s,null,y,d):Qr(r,s,y,d),s.child;case 11:return mm(r,s,s.type,s.pendingProps,d);case 7:return Qr(r,s,s.pendingProps,d),s.child;case 8:return Qr(r,s,s.pendingProps.children,d),s.child;case 12:return Qr(r,s,s.pendingProps.children,d),s.child;case 10:return y=s.pendingProps,dl(s,s.type,y.value),Qr(r,s,y.children,d),s.child;case 9:return M=s.type._context,y=s.pendingProps.children,fl(s),M=ur(M),y=y(M),s.flags|=1,Qr(r,s,y,d),s.child;case 14:return Yd(r,s,s.type,s.pendingProps,d);case 15:return tp(r,s,s.type,s.pendingProps,d);case 19:return nf(r,s,d);case 31:return Wd(r,s,d);case 22:return ip(r,s,d,s.pendingProps);case 24:return fl(s),y=ur(nr),r===null?(M=fh(),M===null&&(M=Un,I=ko(),M.pooledCache=I,I.refCount++,I!==null&&(M.pooledCacheLanes|=d),M=I),s.memoizedState={parent:y,cache:M},yh(s),dl(s,nr,M)):((r.lanes&d)!==0&&(Ic(r,s),Ul(s,null,null,d),ml()),M=r.memoizedState,I=s.memoizedState,M.parent!==y?(M={parent:y,cache:y},s.memoizedState=M,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=M),dl(s,nr,y)):(y=I.cache,dl(s,nr,y),y!==M.cache&&hh(s,[nr],d,!0))),Qr(r,s,s.pendingProps.children,d),s.child;case 29:throw s.pendingProps}throw Error(R(156,s.tag))}function $l(r){r.flags|=4}function rd(r,s,d,y,M){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(M&335544128)===M)if(r.stateNode.complete)r.flags|=8192;else if(vp())r.flags|=8192;else throw to=Nt,jl}else r.flags&=-16777217}function xm(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Ad(s))if(vp())r.flags|=8192;else throw to=Nt,jl}function ad(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?Wt():536870912,r.lanes|=s,Xc|=s)}function sd(r,s){if(!Ii)switch(r.tailMode){case"hidden":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?r.tail=null:d.sibling=null;break;case"collapsed":d=r.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:y.sibling=null}}function Qn(r){var s=r.alternate!==null&&r.alternate.child===r.child,d=0,y=0;if(s)for(var M=r.child;M!==null;)d|=M.lanes|M.childLanes,y|=M.subtreeFlags&65011712,y|=M.flags&65011712,M.return=r,M=M.sibling;else for(M=r.child;M!==null;)d|=M.lanes|M.childLanes,y|=M.subtreeFlags,y|=M.flags,M.return=r,M=M.sibling;return r.subtreeFlags|=y,r.childLanes=d,s}function bm(r,s,d){var y=s.pendingProps;switch(Nn(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qn(s),null;case 1:return Qn(s),null;case 3:return d=s.stateNode,y=null,r!==null&&(y=r.memoizedState.cache),s.memoizedState.cache!==y&&(s.flags|=2048),Io(nr),Wi(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Pa(s)?$l(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Cs())),Qn(s),null;case 26:var M=s.type,I=s.memoizedState;return r===null?($l(s),I!==null?(Qn(s),xm(s,I)):(Qn(s),rd(s,M,null,y,d))):I?I!==r.memoizedState?($l(s),Qn(s),xm(s,I)):(Qn(s),s.flags&=-16777217):(r=r.memoizedProps,r!==y&&$l(s),Qn(s),rd(s,M,r,y,d)),null;case 27:if(Ur(s),d=Ct.current,M=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==y&&$l(s);else{if(!y){if(s.stateNode===null)throw Error(R(166));return Qn(s),null}r=Pt.current,Pa(s)?Wr(s):(r=Jm(M,y,d),s.stateNode=r,$l(s))}return Qn(s),null;case 5:if(Ur(s),M=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==y&&$l(s);else{if(!y){if(s.stateNode===null)throw Error(R(166));return Qn(s),null}if(I=Pt.current,Pa(s))Wr(s);else{var Y=Sd(Ct.current);switch(I){case 1:I=Y.createElementNS("http://www.w3.org/2000/svg",M);break;case 2:I=Y.createElementNS("http://www.w3.org/1998/Math/MathML",M);break;default:switch(M){case"svg":I=Y.createElementNS("http://www.w3.org/2000/svg",M);break;case"math":I=Y.createElementNS("http://www.w3.org/1998/Math/MathML",M);break;case"script":I=Y.createElement("div"),I.innerHTML="<script><\/script>",I=I.removeChild(I.firstChild);break;
vendor: 21,753 bytes, line 8
8case"select":I=typeof y.is=="string"?Y.createElement("select",{is:y.is}):Y.createElement("select"),y.multiple?I.multiple=!0:y.size&&(I.size=y.size);break;default:I=typeof y.is=="string"?Y.createElement(M,{is:y.is}):Y.createElement(M)}}I[Pi]=s,I[bt]=y;e:for(Y=s.child;Y!==null;){if(Y.tag===5||Y.tag===6)I.appendChild(Y.stateNode);else if(Y.tag!==4&&Y.tag!==27&&Y.child!==null){Y.child.return=Y,Y=Y.child;continue}if(Y===s)break e;for(;Y.sibling===null;){if(Y.return===null||Y.return===s)break e;Y=Y.return}Y.sibling.return=Y.return,Y=Y.sibling}s.stateNode=I;e:switch(ea(I,M,y),M){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&$l(s)}}return Qn(s),rd(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,d),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==y&&$l(s);else{if(typeof y!="string"&&s.stateNode===null)throw Error(R(166));if(r=Ct.current,Pa(s)){if(r=s.stateNode,d=s.memoizedProps,y=null,M=Ki,M!==null)switch(M.tag){case 27:case 5:y=M.memoizedProps}r[Pi]=s,r=!!(r.nodeValue===d||y!==null&&y.suppressHydrationWarning===!0||Lp(r.nodeValue,d)),r||ga(s,!0)}else r=Sd(r).createTextNode(y),r[Pi]=s,s.stateNode=r}return Qn(s),null;case 31:if(d=s.memoizedState,r===null||r.memoizedState!==null){if(y=Pa(s),d!==null){if(r===null){if(!y)throw Error(R(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(557));r[Pi]=s}else Ss(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qn(s),r=!1}else d=Cs(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=d),r=!0;if(!r)return s.flags&256?(Gn(s),s):(Gn(s),null);if((s.flags&128)!==0)throw Error(R(558))}return Qn(s),null;case 13:if(y=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(M=Pa(s),y!==null&&y.dehydrated!==null){if(r===null){if(!M)throw Error(R(318));if(M=s.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(R(317));M[Pi]=s}else Ss(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qn(s),M=!1}else M=Cs(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=M),M=!0;if(!M)return s.flags&256?(Gn(s),s):(Gn(s),null)}return Gn(s),(s.flags&128)!==0?(s.lanes=d,s):(d=y!==null,r=r!==null&&r.memoizedState!==null,d&&(y=s.child,M=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(M=y.alternate.memoizedState.cachePool.pool),I=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(I=y.memoizedState.cachePool.pool),I!==M&&(y.flags|=2048)),d!==r&&d&&(s.child.flags|=8192),ad(s,s.updateQueue),Qn(s),null);case 4:return Wi(),r===null&&Pp(s.stateNode.containerInfo),Qn(s),null;case 10:return Io(s.type),Qn(s),null;case 19:if(rt(Yn),y=s.memoizedState,y===null)return Qn(s),null;if(M=(s.flags&128)!==0,I=y.rendering,I===null)if(M)sd(y,!1);else{if(hr!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(I=Bc(r),I!==null){for(s.flags|=128,sd(y,!1),r=I.updateQueue,s.updateQueue=r,ad(s,r),s.subtreeFlags=0,r=d,d=s.child;d!==null;)Ec(d,r),d=d.sibling;return Et(Yn,Yn.current&1|2),Ii&&ni(s,y.treeForkCount),s.child}r=r.sibling}y.tail!==null&&pr()>md&&(s.flags|=128,M=!0,sd(y,!1),s.lanes=4194304)}else{if(!M)if(r=Bc(I),r!==null){if(s.flags|=128,M=!0,r=r.updateQueue,s.updateQueue=r,ad(s,r),sd(y,!0),y.tail===null&&y.tailMode==="hidden"&&!I.alternate&&!Ii)return Qn(s),null}else 2*pr()-y.renderingStartTime>md&&d!==536870912&&(s.flags|=128,M=!0,sd(y,!1),s.lanes=4194304);y.isBackwards?(I.sibling=s.child,s.child=I):(r=y.last,r!==null?r.sibling=I:s.child=I,y.last=I)}return y.tail!==null?(r=y.tail,y.rendering=r,y.tail=r.sibling,y.renderingStartTime=pr(),r.sibling=null,d=Yn.current,Et(Yn,M?d&1|2:d&1),Ii&&ni(s,y.treeForkCount),r):(Qn(s),null);case 22:case 23:return Gn(s),mu(),y=s.memoizedState!==null,r!==null?r.memoizedState!==null!==y&&(s.flags|=8192):y&&(s.flags|=8192),y?(d&536870912)!==0&&(s.flags&128)===0&&(Qn(s),s.subtreeFlags&6&&(s.flags|=8192)):Qn(s),d=s.updateQueue,d!==null&&ad(s,d.retryQueue),d=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),y=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(y=s.memoizedState.cachePool.pool),y!==d&&(s.flags|=2048),r!==null&&rt(Js),null;case 24:return d=null,r!==null&&(d=r.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),Io(nr),Qn(s),null;case 25:return null;case 30:return null}throw Error(R(156,s.tag))}function zg(r,s){switch(Nn(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Io(nr),Wi(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Ur(s),null;case 31:if(s.memoizedState!==null){if(Gn(s),s.alternate===null)throw Error(R(340));Ss()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(Gn(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(R(340));Ss()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return rt(Yn),null;case 4:return Wi(),null;case 10:return Io(s.type),null;case 22:case 23:return Gn(s),mu(),r!==null&&rt(Js),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return Io(nr),null;case 25:return null;default:return null}}function rf(r,s){switch(Nn(s),s.tag){case 3:Io(nr),Wi();break;case 26:case 27:case 5:Ur(s);break;case 4:Wi();break;case 31:s.memoizedState!==null&&Gn(s);break;case 13:Gn(s);break;case 19:rt(Yn);break;case 10:Io(s.type);break;case 22:case 23:Gn(s),mu(),r!==null&&rt(Js);break;case 24:Io(nr)}}function Sh(r,s){try{var d=s.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var M=y.next;d=M;do{if((d.tag&r)===r){y=void 0;var I=d.create,Y=d.inst;y=I(),Y.destroy=y}d=d.next}while(d!==M)}}catch(ue){_n(s,s.return,ue)}}function wu(r,s,d){try{var y=s.updateQueue,M=y!==null?y.lastEffect:null;if(M!==null){var I=M.next;y=I;do{if((y.tag&r)===r){var Y=y.inst,ue=Y.destroy;if(ue!==void 0){Y.destroy=void 0,M=s;var De=d,Je=ue;try{Je()}catch(ht){_n(M,De,ht)}}}y=y.next}while(y!==I)}}catch(ht){_n(s,s.return,ht)}}function wm(r){var s=r.updateQueue;if(s!==null){var d=r.stateNode;try{vh(s,d)}catch(y){_n(r,r.return,y)}}}function Tm(r,s,d){d.props=Gl(r.type,r.memoizedProps),d.state=r.memoizedState;try{d.componentWillUnmount()}catch(y){_n(r,s,y)}}function od(r,s){try{var d=r.ref;if(d!==null){switch(r.tag){case 26:case 27:case 5:var y=r.stateNode;break;case 30:y=r.stateNode;break;default:y=r.stateNode}typeof d=="function"?r.refCleanup=d(y):d.current=y}}catch(M){_n(r,s,M)}}function lo(r,s){var d=r.ref,y=r.refCleanup;if(d!==null)if(typeof y=="function")try{y()}catch(M){_n(r,s,M)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(M){_n(r,s,M)}else d.current=null}function af(r){var s=r.type,d=r.memoizedProps,y=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":d.autoFocus&&y.focus();break e;case"img":d.src?y.src=d.src:d.srcSet&&(y.srcset=d.srcSet)}}catch(M){_n(r,r.return,M)}}function sf(r,s,d){try{var y=r.stateNode;Km(y,r.type,d,s),y[bt]=s}catch(M){_n(r,r.return,M)}}function ac(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&fc(r.type)||r.tag===4}function Gc(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||ac(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&fc(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function lp(r,s,d){var y=r.tag;if(y===5||y===6)r=r.stateNode,s?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(r,s):(s=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,s.appendChild(r),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=ra));else if(y!==4&&(y===27&&fc(r.type)&&(d=r.stateNode,s=null),r=r.child,r!==null))for(lp(r,s,d),r=r.sibling;r!==null;)lp(r,s,d),r=r.sibling}function of(r,s,d){var y=r.tag;if(y===5||y===6)r=r.stateNode,s?d.insertBefore(r,s):d.appendChild(r);else if(y!==4&&(y===27&&fc(r.type)&&(d=r.stateNode),r=r.child,r!==null))for(of(r,s,d),r=r.sibling;r!==null;)of(r,s,d),r=r.sibling}function Sm(r){var s=r.stateNode,d=r.memoizedProps;try{for(var y=r.type,M=s.attributes;M.length;)s.removeAttributeNode(M[0]);ea(s,y,d),s[Pi]=r,s[bt]=d}catch(I){_n(r,r.return,I)}}var Tu=!1,kr=!1,up=!1,Cm=typeof WeakSet=="function"?WeakSet:Set,Rr=null;function Lg(r,s){if(r=r.containerInfo,Td=Id,r=rl(r),Ts(r)){if("selectionStart"in r)var d={start:r.selectionStart,end:r.selectionEnd};else e:{d=(d=r.ownerDocument)&&d.defaultView||window;var y=d.getSelection&&d.getSelection();if(y&&y.rangeCount!==0){d=y.anchorNode;var M=y.anchorOffset,I=y.focusNode;y=y.focusOffset;try{d.nodeType,I.nodeType}catch{d=null;break e}var Y=0,ue=-1,De=-1,Je=0,ht=0,xt=r,nt=null;t:for(;;){for(var ot;xt!==d||M!==0&&xt.nodeType!==3||(ue=Y+M),xt!==I||y!==0&&xt.nodeType!==3||(De=Y+y),xt.nodeType===3&&(Y+=xt.nodeValue.length),(ot=xt.firstChild)!==null;)nt=xt,xt=ot;for(;;){if(xt===r)break t;if(nt===d&&++Je===M&&(ue=Y),nt===I&&++ht===y&&(De=Y),(ot=xt.nextSibling)!==null)break;xt=nt,nt=xt.parentNode}xt=ot}d=ue===-1||De===-1?null:{start:ue,end:De}}else d=null}d=d||{start:0,end:0}}else d=null;for(Dp={focusedElem:r,selectionRange:d},Id=!1,Rr=s;Rr!==null;)if(s=Rr,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Rr=r;else for(;Rr!==null;){switch(s=Rr,I=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(d=0;d<r.length;d++)M=r[d],M.ref.impl=M.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&I!==null){r=void 0,d=s,M=I.memoizedProps,I=I.memoizedState,y=d.stateNode;try{var Jt=Gl(d.type,M);r=y.getSnapshotBeforeUpdate(Jt,I),y.__reactInternalSnapshotBeforeUpdate=r}catch(di){_n(d,d.return,di)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,d=r.nodeType,d===9)Sl(r);else if(d===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Sl(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(R(163))}if(r=s.sibling,r!==null){r.return=s.return,Rr=r;break}Rr=s.return}}function cp(r,s,d){var y=d.flags;switch(d.tag){case 0:case 11:case 15:ks(r,d),y&4&&Sh(5,d);break;case 1:if(ks(r,d),y&4)if(r=d.stateNode,s===null)try{r.componentDidMount()}catch(Y){_n(d,d.return,Y)}else{var M=Gl(d.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(M,s,r.__reactInternalSnapshotBeforeUpdate)}catch(Y){_n(d,d.return,Y)}}y&64&&wm(d),y&512&&od(d,d.return);break;case 3:if(ks(r,d),y&64&&(r=d.updateQueue,r!==null)){if(s=null,d.child!==null)switch(d.child.tag){case 27:case 5:s=d.child.stateNode;break;case 1:s=d.child.stateNode}try{vh(r,s)}catch(Y){_n(d,d.return,Y)}}break;case 27:s===null&&y&4&&Sm(d);case 26:case 5:ks(r,d),s===null&&y&4&&af(d),y&512&&od(d,d.return);break;case 12:ks(r,d);break;case 31:ks(r,d),y&4&&ld(r,d);break;case 13:ks(r,d),y&4&&ud(r,d),y&64&&(r=d.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(d=bp.bind(null,d),Br(r,d))));break;case 22:if(y=d.memoizedState!==null||Tu,!y){s=s!==null&&s.memoizedState!==null||kr,M=Tu;var I=kr;Tu=y,(kr=s)&&!I?Su(r,d,(d.subtreeFlags&8772)!==0):ks(r,d),Tu=M,kr=I}break;case 30:break;default:ks(r,d)}}function Ch(r){var s=r.alternate;s!==null&&(r.alternate=null,Ch(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&Xo(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var ar=null,Xi=!1;function Is(r,s,d){for(d=d.child;d!==null;)hp(r,s,d),d=d.sibling}function hp(r,s,d){if(be&&typeof be.onCommitFiberUnmount=="function")try{be.onCommitFiberUnmount(ae,d)}catch{}switch(d.tag){case 26:kr||lo(d,s),Is(r,s,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:kr||lo(d,s);var y=ar,M=Xi;fc(d.type)&&(ar=d.stateNode,Xi=!1),Is(r,s,d),Nh(d.stateNode),ar=y,Xi=M;break;case 5:kr||lo(d,s);case 6:if(y=ar,M=Xi,ar=null,Is(r,s,d),ar=y,Xi=M,ar!==null)if(Xi)try{(ar.nodeType===9?ar.body:ar.nodeName==="HTML"?ar.ownerDocument.body:ar).removeChild(d.stateNode)}catch(I){_n(d,s,I)}else try{ar.removeChild(d.stateNode)}catch(I){_n(d,s,I)}break;case 18:ar!==null&&(Xi?(r=ar,Qm(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,d.stateNode),vc(r)):Qm(ar,d.stateNode));break;case 4:y=ar,M=Xi,ar=d.stateNode.containerInfo,Xi=!0,Is(r,s,d),ar=y,Xi=M;break;case 0:case 11:case 14:case 15:wu(2,d,s),kr||wu(4,d,s),Is(r,s,d);break;case 1:kr||(lo(d,s),y=d.stateNode,typeof y.componentWillUnmount=="function"&&Tm(d,s,y)),Is(r,s,d);break;case 21:Is(r,s,d);break;case 22:kr=(y=kr)||d.memoizedState!==null,Is(r,s,d),kr=y;break;default:Is(r,s,d)}}function ld(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{vc(r)}catch(d){_n(s,s.return,d)}}}function ud(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{vc(r)}catch(d){_n(s,s.return,d)}}function cd(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new Cm),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new Cm),s;default:throw Error(R(435,r.tag))}}function hd(r,s){var d=cd(r);s.forEach(function(y){if(!d.has(y)){d.add(y);var M=kg.bind(null,r,y);y.then(M,M)}})}function us(r,s){var d=s.deletions;if(d!==null)for(var y=0;y<d.length;y++){var M=d[y],I=r,Y=s,ue=Y;e:for(;ue!==null;){switch(ue.tag){case 27:if(fc(ue.type)){ar=ue.stateNode,Xi=!1;break e}break;case 5:ar=ue.stateNode,Xi=!1;break e;case 3:case 4:ar=ue.stateNode.containerInfo,Xi=!0;break e}ue=ue.return}if(ar===null)throw Error(R(160));hp(I,Y,M),ar=null,Xi=!1,I=M.alternate,I!==null&&(I.return=null),M.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)lf(s,r),s=s.sibling}var cs=null;function lf(r,s){var d=r.alternate,y=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:us(s,r),Jr(r),y&4&&(wu(3,r,r.return),Sh(3,r),wu(5,r,r.return));break;case 1:us(s,r),Jr(r),y&512&&(kr||d===null||lo(d,d.return)),y&64&&Tu&&(r=r.updateQueue,r!==null&&(y=r.callbacks,y!==null&&(d=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=d===null?y:d.concat(y))));break;case 26:var M=cs;if(us(s,r),Jr(r),y&512&&(kr||d===null||lo(d,d.return)),y&4){var I=d!==null?d.memoizedState:null;if(y=r.memoizedState,d===null)if(y===null)if(r.stateNode===null){e:{y=r.type,d=r.memoizedProps,M=M.ownerDocument||M;t:switch(y){case"title":I=M.getElementsByTagName("title")[0],(!I||I[fi]||I[Pi]||I.namespaceURI==="http://www.w3.org/2000/svg"||I.hasAttribute("itemprop"))&&(I=M.createElement(y),M.head.insertBefore(I,M.querySelector("head > title"))),ea(I,y,d),I[Pi]=r,Rn(I),y=I;break e;case"link":var Y=qp("link","href",M).get(y+(d.href||""));if(Y){for(var ue=0;ue<Y.length;ue++)if(I=Y[ue],I.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&I.getAttribute("rel")===(d.rel==null?null:d.rel)&&I.getAttribute("title")===(d.title==null?null:d.title)&&I.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){Y.splice(ue,1);break t}}I=M.createElement(y),ea(I,y,d),M.head.appendChild(I);break;case"meta":if(Y=qp("meta","content",M).get(y+(d.content||""))){for(ue=0;ue<Y.length;ue++)if(I=Y[ue],I.getAttribute("content")===(d.content==null?null:""+d.content)&&I.getAttribute("name")===(d.name==null?null:d.name)&&I.getAttribute("property")===(d.property==null?null:d.property)&&I.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&I.getAttribute("charset")===(d.charSet==null?null:d.charSet)){Y.splice(ue,1);break t}}I=M.createElement(y),ea(I,y,d),M.head.appendChild(I);break;default:throw Error(R(468,y))}I[Pi]=r,Rn(I),y=I}r.stateNode=y}else Ed(M,r.type,r.stateNode);else r.stateNode=Gp(M,y,r.memoizedProps);else I!==y?(I===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):I.count--,y===null?Ed(M,r.type,r.stateNode):Gp(M,y,r.memoizedProps)):y===null&&r.stateNode!==null&&sf(r,r.memoizedProps,d.memoizedProps)}break;case 27:us(s,r),Jr(r),y&512&&(kr||d===null||lo(d,d.return)),d!==null&&y&4&&sf(r,r.memoizedProps,d.memoizedProps);break;case 5:if(us(s,r),Jr(r),y&512&&(kr||d===null||lo(d,d.return)),r.flags&32){M=r.stateNode;try{Ma(M,"")}catch(Jt){_n(r,r.return,Jt)}}y&4&&r.stateNode!=null&&(M=r.memoizedProps,sf(r,M,d!==null?d.memoizedProps:M)),y&1024&&(up=!0);break;case 6:if(us(s,r),Jr(r),y&4){if(r.stateNode===null)throw Error(R(162));y=r.memoizedProps,d=r.stateNode;try{d.nodeValue=y}catch(Jt){_n(r,r.return,Jt)}}break;case 3:if(Of=null,M=cs,cs=If(s.containerInfo),us(s,r),cs=M,Jr(r),y&4&&d!==null&&d.memoizedState.isDehydrated)try{vc(s.containerInfo)}catch(Jt){_n(r,r.return,Jt)}up&&(up=!1,dd(r));break;case 4:y=cs,cs=If(r.stateNode.containerInfo),us(s,r),Jr(r),cs=y;break;case 12:us(s,r),Jr(r);break;case 31:us(s,r),Jr(r),y&4&&(y=r.updateQueue,y!==null&&(r.updateQueue=null,hd(r,y)));break;case 13:us(s,r),Jr(r),r.child.flags&8192&&r.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(hf=pr()),y&4&&(y=r.updateQueue,y!==null&&(r.updateQueue=null,hd(r,y)));break;case 22:M=r.memoizedState!==null;var De=d!==null&&d.memoizedState!==null,Je=Tu,ht=kr;if(Tu=Je||M,kr=ht||De,us(s,r),kr=ht,Tu=Je,Jr(r),y&8192)e:for(s=r.stateNode,s._visibility=M?s._visibility&-2:s._visibility|1,M&&(d===null||De||Tu||kr||bl(r)),d=null,s=r;;){if(s.tag===5||s.tag===26){if(d===null){De=d=s;try{if(I=De.stateNode,M)Y=I.style,typeof Y.setProperty=="function"?Y.setProperty("display","none","important"):Y.display="none";else{ue=De.stateNode;var xt=De.memoizedProps.style,nt=xt!=null&&xt.hasOwnProperty("display")?xt.display:null;ue.style.display=nt==null||typeof nt=="boolean"?"":(""+nt).trim()}}catch(Jt){_n(De,De.return,Jt)}}}else if(s.tag===6){if(d===null){De=s;try{De.stateNode.nodeValue=M?"":De.memoizedProps}catch(Jt){_n(De,De.return,Jt)}}}else if(s.tag===18){if(d===null){De=s;try{var ot=De.stateNode;M?Li(ot,!0):Li(De.stateNode,!1)}catch(Jt){_n(De,De.return,Jt)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;d===s&&(d=null),s=s.return}d===s&&(d=null),s.sibling.return=s.return,s=s.sibling}y&4&&(y=r.updateQueue,y!==null&&(d=y.retryQueue,d!==null&&(y.retryQueue=null,hd(r,d))));break;case 19:us(s,r),Jr(r),y&4&&(y=r.updateQueue,y!==null&&(r.updateQueue=null,hd(r,y)));break;case 30:break;case 21:break;default:us(s,r),Jr(r)}}function Jr(r){var s=r.flags;if(s&2){try{for(var d,y=r.return;y!==null;){if(ac(y)){d=y;break}y=y.return}if(d==null)throw Error(R(160));switch(d.tag){case 27:var M=d.stateNode,I=Gc(r);of(r,I,M);break;case 5:var Y=d.stateNode;d.flags&32&&(Ma(Y,""),d.flags&=-33);var ue=Gc(r);of(r,ue,Y);break;case 3:case 4:var De=d.stateNode.containerInfo,Je=Gc(r);lp(r,Je,De);break;default:throw Error(R(161))}}catch(ht){_n(r,r.return,ht)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function dd(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;dd(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function ks(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)cp(r,s.alternate,s),s=s.sibling}function bl(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:wu(4,s,s.return),bl(s);break;case 1:lo(s,s.return);var d=s.stateNode;typeof d.componentWillUnmount=="function"&&Tm(s,s.return,d),bl(s);break;case 27:Nh(s.stateNode);case 26:case 5:lo(s,s.return),bl(s);break;case 22:s.memoizedState===null&&bl(s);break;case 30:bl(s);break;default:bl(s)}r=r.sibling}}function Su(r,s,d){for(d=d&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var y=s.alternate,M=r,I=s,Y=I.flags;switch(I.tag){case 0:case 11:case 15:Su(M,I,d),Sh(4,I);break;case 1:if(Su(M,I,d),y=I,M=y.stateNode,typeof M.componentDidMount=="function")try{M.componentDidMount()}catch(Je){_n(y,y.return,Je)}if(y=I,M=y.updateQueue,M!==null){var ue=y.stateNode;try{var De=M.shared.hiddenCallbacks;if(De!==null)for(M.shared.hiddenCallbacks=null,M=0;M<De.length;M++)kc(De[M],ue)}catch(Je){_n(y,y.return,Je)}}d&&Y&64&&wm(I),od(I,I.return);break;case 27:Sm(I);case 26:case 5:Su(M,I,d),d&&y===null&&Y&4&&af(I),od(I,I.return);break;case 12:Su(M,I,d);break;case 31:Su(M,I,d),d&&Y&4&&ld(M,I);break;case 13:Su(M,I,d),d&&Y&4&&ud(M,I);break;case 22:I.memoizedState===null&&Su(M,I,d),od(I,I.return);break;case 30:break;default:Su(M,I,d)}s=s.sibling}}function uf(r,s){var d=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==d&&(r!=null&&r.refCount++,d!=null&&Ku(d))}function Cu(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Ku(r))}function wl(r,s,d,y){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)dp(r,s,d,y),s=s.sibling}function dp(r,s,d,y){var M=s.flags;switch(s.tag){case 0:case 11:case 15:wl(r,s,d,y),M&2048&&Sh(9,s);break;case 1:wl(r,s,d,y);break;case 3:wl(r,s,d,y),M&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Ku(r)));break;case 12:if(M&2048){wl(r,s,d,y),r=s.stateNode;try{var I=s.memoizedProps,Y=I.id,ue=I.onPostCommit;typeof ue=="function"&&ue(Y,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(De){_n(s,s.return,De)}}else wl(r,s,d,y);break;case 31:wl(r,s,d,y);break;case 13:wl(r,s,d,y);break;case 23:break;case 22:I=s.stateNode,Y=s.alternate,s.memoizedState!==null?I._visibility&2?wl(r,s,d,y):qc(r,s):I._visibility&2?wl(r,s,d,y):(I._visibility|=2,Xl(r,s,d,y,(s.subtreeFlags&10256)!==0||!1)),M&2048&&uf(Y,s);break;
vendor: 5,725 bytes, line 8
8case 24:wl(r,s,d,y),M&2048&&Cu(s.alternate,s);break;default:wl(r,s,d,y)}}function Xl(r,s,d,y,M){for(M=M&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var I=r,Y=s,ue=d,De=y,Je=Y.flags;switch(Y.tag){case 0:case 11:case 15:Xl(I,Y,ue,De,M),Sh(8,Y);break;case 23:break;case 22:var ht=Y.stateNode;Y.memoizedState!==null?ht._visibility&2?Xl(I,Y,ue,De,M):qc(I,Y):(ht._visibility|=2,Xl(I,Y,ue,De,M)),M&&Je&2048&&uf(Y.alternate,Y);break;case 24:Xl(I,Y,ue,De,M),M&&Je&2048&&Cu(Y.alternate,Y);break;default:Xl(I,Y,ue,De,M)}s=s.sibling}}function qc(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var d=r,y=s,M=y.flags;switch(y.tag){case 22:qc(d,y),M&2048&&uf(y.alternate,y);break;case 24:qc(d,y),M&2048&&Cu(y.alternate,y);break;default:qc(d,y)}s=s.sibling}}var Mh=8192;function Hc(r,s,d){if(r.subtreeFlags&Mh)for(r=r.child;r!==null;)Mm(r,s,d),r=r.sibling}function Mm(r,s,d){switch(r.tag){case 26:Hc(r,s,d),r.flags&Mh&&r.memoizedState!==null&&Hp(d,cs,r.memoizedState,r.memoizedProps);break;case 5:Hc(r,s,d);break;case 3:case 4:var y=cs;cs=If(r.stateNode.containerInfo),Hc(r,s,d),cs=y;break;case 22:r.memoizedState===null&&(y=r.alternate,y!==null&&y.memoizedState!==null?(y=Mh,Mh=16777216,Hc(r,s,d),Mh=y):Hc(r,s,d));break;default:Hc(r,s,d)}}function Em(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function fd(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var d=0;d<s.length;d++){var y=s[d];Rr=y,Eh(y,r)}Em(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Am(r),r=r.sibling}function Am(r){switch(r.tag){case 0:case 11:case 15:fd(r),r.flags&2048&&wu(9,r,r.return);break;case 3:fd(r);break;case 12:fd(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,cf(r)):fd(r);break;default:fd(r)}}function cf(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var d=0;d<s.length;d++){var y=s[d];Rr=y,Eh(y,r)}Em(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:wu(8,s,s.return),cf(s);break;case 22:d=s.stateNode,d._visibility&2&&(d._visibility&=-3,cf(s));break;default:cf(s)}r=r.sibling}}function Eh(r,s){for(;Rr!==null;){var d=Rr;switch(d.tag){case 0:case 11:case 15:wu(8,d,s);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var y=d.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Ku(d.memoizedState.cache)}if(y=d.child,y!==null)y.return=d,Rr=y;else e:for(d=r;Rr!==null;){y=Rr;var M=y.sibling,I=y.return;if(Ch(y),y===d){Rr=null;break e}if(M!==null){M.return=I,Rr=M;break e}Rr=I}}}var Dg={getCacheForType:function(r){var s=ur(nr),d=s.data.get(r);return d===void 0&&(d=r(),s.data.set(r,d)),d},cacheSignal:function(){return ur(nr).controller.signal}},Pm=typeof WeakMap=="function"?WeakMap:Map,gn=0,Un=null,Zi=null,Gi=0,Cn=0,hs=null,Zo=!1,sc=!1,fp=!1,Mu=0,hr=0,Eu=0,$c=0,pp=0,La=0,Xc=0,pd=null,Rs=null,mp=!1,hf=0,zm=0,md=1/0,Ah=null,Au=null,Or=0,Pu=null,Ph=null,Go=0,gp=0,df=null,Lm=null,gd=0,_p=null;function Os(){return(gn&2)!==0&&Gi!==0?Gi&-Gi:Ke.T!==null?Mp():kn()}function Dm(){if(La===0)if((Gi&536870912)===0||Ii){var r=it;it<<=1,(it&3932160)===0&&(it=262144),La=r}else La=536870912;return r=Ut.current,r!==null&&(r.flags|=32),La}function Bs(r,s,d){(r===Un&&(Cn===2||Cn===9)||r.cancelPendingCommit!==null)&&(Lh(r,0),oc(r,Gi,La,!1)),rn(r,d),((gn&2)===0||r!==Un)&&(r===Un&&((gn&2)===0&&($c|=d),hr===4&&oc(r,Gi,La,!1)),Tl(r))}function Ar(r,s,d){if((gn&6)!==0)throw Error(R(327));var y=!d&&(s&127)===0&&(s&r.expiredLanes)===0||Hi(r,s),M=y?Dh(r,s):mf(r,s,!0),I=y;do{if(M===0){sc&&!y&&oc(r,s,0,!1);break}else{if(d=r.current.alternate,I&&!Ig(d)){M=mf(r,s,!1),I=!1;continue}if(M===2){if(I=s,r.errorRecoveryDisabledLanes&I)var Y=0;else Y=r.pendingLanes&-536870913,Y=Y!==0?Y:Y&536870912?536870912:0;if(Y!==0){s=Y;e:{var ue=r;M=pd;var De=ue.current.memoizedState.isDehydrated;if(De&&(Lh(ue,Y).flags|=256),Y=mf(ue,Y,!1),Y!==2){if(fp&&!De){ue.errorRecoveryDisabledLanes|=I,$c|=I,M=4;break e}I=Rs,Rs=M,I!==null&&(Rs===null?Rs=I:Rs.push.apply(Rs,I))}M=Y}if(I=!1,M!==2)continue}}if(M===1){Lh(r,0),oc(r,s,0,!0);break}e:{switch(y=r,I=M,I){case 0:case 1:throw Error(R(345));case 4:if((s&4194048)!==s)break;case 6:oc(y,s,La,!Zo);break e;case 2:Rs=null;break;case 3:case 5:break;default:throw Error(R(329))}if((s&62914560)===s&&(M=hf+300-pr(),10<M)){if(oc(y,s,La,!Zo),oi(y,0,!0)!==0)break e;Go=s,y.timeoutHandle=Df(zh.bind(null,y,d,Rs,Ah,mp,s,La,$c,Xc,Zo,I,"Throttled",-0,0),M);break e}zh(y,d,Rs,Ah,mp,s,La,$c,Xc,Zo,I,null,-0,0)}}break}while(!0);Tl(r)}function zh(r,s,d,y,M,I,Y,ue,De,Je,ht,xt,nt,ot){if(r.timeoutHandle=-1,xt=s.subtreeFlags,xt&8192||(xt&16785408)===16785408){xt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ra},Mm(s,I,xt);var Jt=(I&62914560)===I?hf-pr():(I&4194048)===I?zm-pr():0;if(Jt=$p(xt,Jt),Jt!==null){Go=I,r.cancelPendingCommit=Jt(Bm.bind(null,r,s,I,d,y,M,Y,ue,De,ht,xt,null,nt,ot)),oc(r,I,Y,!Je);return}}Bm(r,s,I,d,y,M,Y,ue,De)}function Ig(r){for(var s=r;;){var d=s.tag;if((d===0||d===11||d===15)&&s.flags&16384&&(d=s.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var y=0;y<d.length;y++){var M=d[y],I=M.getSnapshot;M=M.value;try{if(!Sr(I(),M))return!1}catch{return!1}}if(d=s.child,s.subtreeFlags&16384&&d!==null)d.return=s,s=d;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function oc(r,s,d,y){s&=~pp,s&=~$c,r.suspendedLanes|=s,r.pingedLanes&=~s,y&&(r.warmLanes|=s),y=r.expirationTimes;for(var M=s;0<M;){var I=31-Fe(M),Y=1<<I;y[I]=-1,M&=~Y}d!==0&&tr(r,d,s)}function _d(){return(gn&6)===0?(uo(0),!1):!0}
vendor: 6,387 bytes, line 8
8function ff(){if(Zi!==null){if(Cn===0)var r=Zi.return;else r=Zi,Ms=za=null,yl(r),Ro=null,fu=0,r=Zi;for(;r!==null;)rf(r.alternate,r),r=r.return;Zi=null}}function Lh(r,s){var d=r.timeoutHandle;d!==-1&&(r.timeoutHandle=-1,kp(d)),d=r.cancelPendingCommit,d!==null&&(r.cancelPendingCommit=null,d()),Go=0,ff(),Un=r,Zi=d=pa(r.current,null),Gi=s,Cn=0,hs=null,Zo=!1,sc=Hi(r,s),fp=!1,Xc=La=pp=$c=Eu=hr=0,Rs=pd=null,mp=!1,(s&8)!==0&&(s|=s&32);var y=r.entangledLanes;if(y!==0)for(r=r.entanglements,y&=s;0<y;){var M=31-Fe(y),I=1<<M;s|=r[M],y&=~I}return Mu=s,Po(),d}function yp(r,s){Ei=null,Ke.H=sn,s===eo||s===Oa?(s=Ju(),Cn=3):s===jl?(s=Ju(),Cn=4):Cn=s===Xd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,hs=s,Zi===null&&(hr=1,oo(r,_(s,r.current)))}function vp(){var r=Ut.current;return r===null?!0:(Gi&4194048)===Gi?$t===null:(Gi&62914560)===Gi||(Gi&536870912)!==0?r===$t:!1}function Yc(){var r=Ke.H;return Ke.H=sn,r===null?sn:r}function pf(){var r=Ke.A;return Ke.A=Dg,r}function yd(){hr=4,Zo||(Gi&4194048)!==Gi&&Ut.current!==null||(sc=!0),(Eu&134217727)===0&&($c&134217727)===0||Un===null||oc(Un,Gi,La,!1)}function mf(r,s,d){var y=gn;gn|=2;var M=Yc(),I=pf();(Un!==r||Gi!==s)&&(Ah=null,Lh(r,s)),s=!1;var Y=hr;e:do try{if(Cn!==0&&Zi!==null){var ue=Zi,De=hs;switch(Cn){case 8:ff(),Y=6;break e;case 3:case 2:case 9:case 6:Ut.current===null&&(s=!0);var Je=Cn;if(Cn=0,hs=null,Ih(r,ue,De,Je),d&&sc){Y=0;break e}break;default:Je=Cn,Cn=0,hs=null,Ih(r,ue,De,Je)}}gf(),Y=hr;break}catch(ht){yp(r,ht)}while(!0);return s&&r.shellSuspendCounter++,Ms=za=null,gn=y,Ke.H=M,Ke.A=I,Zi===null&&(Un=null,Gi=0,Po()),Y}function gf(){for(;Zi!==null;)km(Zi)}function Dh(r,s){var d=gn;gn|=2;var y=Yc(),M=pf();Un!==r||Gi!==s?(Ah=null,md=pr()+500,Lh(r,s)):sc=Hi(r,s);e:do try{if(Cn!==0&&Zi!==null){s=Zi;var I=hs;t:switch(Cn){case 1:Cn=0,hs=null,Ih(r,s,I,1);break;case 2:case 9:if(zc(I)){Cn=0,hs=null,Rm(s);break}s=function(){Cn!==2&&Cn!==9||Un!==r||(Cn=7),Tl(r)},I.then(s,s);break e;case 3:Cn=7;break e;case 4:Cn=5;break e;case 7:zc(I)?(Cn=0,hs=null,Rm(s)):(Cn=0,hs=null,Ih(r,s,I,7));break;case 5:var Y=null;switch(Zi.tag){case 26:Y=Zi.memoizedState;case 5:case 27:var ue=Zi;if(Y?Ad(Y):ue.stateNode.complete){Cn=0,hs=null;var De=ue.sibling;if(De!==null)Zi=De;else{var Je=ue.return;Je!==null?(Zi=Je,_f(Je)):Zi=null}break t}}Cn=0,hs=null,Ih(r,s,I,5);break;case 6:Cn=0,hs=null,Ih(r,s,I,6);break;case 8:ff(),hr=6;break e;default:throw Error(R(462))}}Im();break}catch(ht){yp(r,ht)}while(!0);return Ms=za=null,Ke.H=y,Ke.A=M,gn=d,Zi!==null?0:(Un=null,Gi=0,Po(),hr)}function Im(){for(;Zi!==null&&!ps();)km(Zi)}function km(r){var s=Fa(r.alternate,r,Mu);r.memoizedProps=r.pendingProps,s===null?_f(r):Zi=s}function Rm(r){var s=r,d=s.alternate;switch(s.tag){case 15:case 0:s=_m(d,s,s.pendingProps,s.type,void 0,Gi);break;case 11:s=_m(d,s,s.pendingProps,s.type.render,s.ref,Gi);break;case 5:yl(s);default:rf(d,s),s=Zi=Ec(s,Mu),s=Fa(d,s,Mu)}r.memoizedProps=r.pendingProps,s===null?_f(r):Zi=s}function Ih(r,s,d,y){Ms=za=null,yl(s),Ro=null,fu=0;var M=s.return;try{if($d(r,M,s,d,Gi)){hr=1,oo(r,_(d,r.current)),Zi=null;return}}catch(I){if(M!==null)throw Zi=M,I;hr=1,oo(r,_(d,r.current)),Zi=null;return}s.flags&32768?(Ii||y===1?r=!0:sc||(Gi&536870912)!==0?r=!1:(Zo=r=!0,(y===2||y===9||y===3||y===6)&&(y=Ut.current,y!==null&&y.tag===13&&(y.flags|=16384))),Om(s,r)):_f(s)}function _f(r){var s=r;do{if((s.flags&32768)!==0){Om(s,Zo);return}r=s.return;var d=bm(s.alternate,s,Mu);if(d!==null){Zi=d;return}if(s=s.sibling,s!==null){Zi=s;return}Zi=s=r}while(s!==null);hr===0&&(hr=5)}function Om(r,s){do{var d=zg(r.alternate,r);if(d!==null){d.flags&=32767,Zi=d;return}if(d=r.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!s&&(r=r.sibling,r!==null)){Zi=r;return}Zi=r=d}while(r!==null);hr=6,Zi=null}function Bm(r,s,d,y,M,I,Y,ue,De){r.cancelPendingCommit=null;do yf();while(Or!==0);if((gn&6)!==0)throw Error(R(327));if(s!==null){if(s===r.current)throw Error(R(177));if(I=s.lanes|s.childLanes,I|=Ao,dn(r,d,I,Y,ue,De),r===Un&&(Zi=Un=null,Gi=0),Ph=s,Pu=r,Go=d,gp=I,df=M,Lm=y,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Zm(ms,function(){return Vm(),null})):(r.callbackNode=null,r.callbackPriority=0),y=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||y){y=Ke.T,Ke.T=null,M=mt.p,mt.p=2,Y=gn,gn|=4;try{Lg(r,s,d)}finally{gn=Y,mt.p=M,Ke.T=y}}Or=1,Nm(),Fm(),jm()}}function Nm(){if(Or===1){Or=0;var r=Pu,s=Ph,d=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||d){d=Ke.T,Ke.T=null;var y=mt.p;mt.p=2;var M=gn;gn|=4;try{lf(s,r);var I=Dp,Y=rl(r.containerInfo),ue=I.focusedElem,De=I.selectionRange;if(Y!==ue&&ue&&ue.ownerDocument&&Ol(ue.ownerDocument.documentElement,ue)){if(De!==null&&Ts(ue)){var Je=De.start,ht=De.end;if(ht===void 0&&(ht=Je),"selectionStart"in ue)ue.selectionStart=Je,ue.selectionEnd=Math.min(ht,ue.value.length);else{var xt=ue.ownerDocument||document,nt=xt&&xt.defaultView||window;if(nt.getSelection){var ot=nt.getSelection(),Jt=ue.textContent.length,di=Math.min(De.start,Jt),Mn=De.end===void 0?di:Math.min(De.end,Jt);!ot.extend&&di>Mn&&(Y=Mn,Mn=di,di=Y);var Ge=Co(ue,di),Oe=Co(ue,Mn);if(Ge&&Oe&&(ot.rangeCount!==1||ot.anchorNode!==Ge.node||ot.anchorOffset!==Ge.offset||ot.focusNode!==Oe.node||ot.focusOffset!==Oe.offset)){var We=xt.createRange();We.setStart(Ge.node,Ge.offset),ot.removeAllRanges(),di>Mn?(ot.addRange(We),ot.extend(Oe.node,Oe.offset)):(We.setEnd(Oe.node,Oe.offset),ot.addRange(We))}}}}for(xt=[],ot=ue;ot=ot.parentNode;)ot.nodeType===1&&xt.push({element:ot,left:ot.scrollLeft,top:ot.scrollTop});for(typeof ue.focus=="function"&&ue.focus(),ue=0;ue<xt.length;ue++){var _t=xt[ue];_t.element.scrollLeft=_t.left,_t.element.scrollTop=_t.top}}Id=!!Td,Dp=Td=null}finally{gn=M,mt.p=y,Ke.T=d}}r.current=s,Or=2}}function Fm(){if(Or===2){Or=0;var r=Pu,s=Ph,d=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||d){d=Ke.T,Ke.T=null;var y=mt.p;mt.p=2;var M=gn;gn|=4;try{cp(r,s.alternate,s)}finally{gn=M,mt.p=y,Ke.T=d}}Or=3}}function jm(){if(Or===4||Or===3){Or=0,go();var r=Pu,s=Ph,d=Go,y=Lm;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Or=5:(Or=0,Ph=Pu=null,Um(r,r.pendingLanes));var M=r.pendingLanes;if(M===0&&(Au=null),Ve(d),s=s.stateNode,be&&typeof be.onCommitFiberRoot=="function")try{be.onCommitFiberRoot(ae,s,void 0,(s.current.flags&128)===128)}catch{}if(y!==null){s=Ke.T,M=mt.p,mt.p=2,Ke.T=null;try{for(var I=r.onRecoverableError,Y=0;Y<y.length;Y++){var ue=y[Y];
vendor: 16,006 bytes, lines 8-9
8I(ue.value,{componentStack:ue.stack})}}finally{Ke.T=s,mt.p=M}}(Go&3)!==0&&yf(),Tl(r),M=r.pendingLanes,(d&261930)!==0&&(M&42)!==0?r===_p?gd++:(gd=0,_p=r):gd=0,uo(0)}}function Um(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,Ku(s)))}function yf(){return Nm(),Fm(),jm(),Vm()}function Vm(){if(Or!==5)return!1;var r=Pu,s=gp;gp=0;var d=Ve(Go),y=Ke.T,M=mt.p;try{mt.p=32>d?32:d,Ke.T=null,d=df,df=null;var I=Pu,Y=Go;if(Or=0,Ph=Pu=null,Go=0,(gn&6)!==0)throw Error(R(331));var ue=gn;if(gn|=4,Am(I.current),dp(I,I.current,Y,d),gn=ue,uo(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(ae,I)}catch{}return!0}finally{mt.p=M,Ke.T=y,Um(r,s)}}function xp(r,s,d){s=_(d,s),s=Uc(r.stateNode,s,2),r=pl(r,s,2),r!==null&&(rn(r,2),Tl(r))}function _n(r,s,d){if(r.tag===3)xp(r,r,d);else for(;s!==null;){if(s.tag===3){xp(s,r,d);break}else if(s.tag===1){var y=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Au===null||!Au.has(y))){r=_(d,r),d=Vc(2),y=pl(s,d,2),y!==null&&(Zc(d,y,s,r),rn(y,2),Tl(y));break}}s=s.return}}function vf(r,s,d){var y=r.pingCache;if(y===null){y=r.pingCache=new Pm;var M=new Set;y.set(s,M)}else M=y.get(s),M===void 0&&(M=new Set,y.set(s,M));M.has(d)||(fp=!0,M.add(d),r=lc.bind(null,r,s,d),s.then(r,r))}function lc(r,s,d){var y=r.pingCache;y!==null&&y.delete(s),r.pingedLanes|=r.suspendedLanes&d,r.warmLanes&=~d,Un===r&&(Gi&d)===d&&(hr===4||hr===3&&(Gi&62914560)===Gi&&300>pr()-hf?(gn&2)===0&&Lh(r,0):pp|=d,Xc===Gi&&(Xc=0)),Tl(r)}function vd(r,s){s===0&&(s=Wt()),r=Yr(r,s),r!==null&&(rn(r,s),Tl(r))}function bp(r){var s=r.memoizedState,d=0;s!==null&&(d=s.retryLane),vd(r,d)}function kg(r,s){var d=0;switch(r.tag){case 31:case 13:var y=r.stateNode,M=r.memoizedState;M!==null&&(d=M.retryLane);break;case 19:y=r.stateNode;break;case 22:y=r.stateNode._retryCache;break;default:throw Error(R(314))}y!==null&&y.delete(s),vd(r,d)}function Zm(r,s){return js(r,s)}var xf=null,kh=null,wp=!1,bf=!1,Tp=!1,zu=0;function Tl(r){r!==kh&&r.next===null&&(kh===null?xf=kh=r:kh=kh.next=r),bf=!0,wp||(wp=!0,Cp())}function uo(r,s){if(!Tp&&bf){Tp=!0;do for(var d=!1,y=xf;y!==null;){if(r!==0){var M=y.pendingLanes;if(M===0)var I=0;else{var Y=y.suspendedLanes,ue=y.pingedLanes;I=(1<<31-Fe(42|r)+1)-1,I&=M&~(Y&~ue),I=I&201326741?I&201326741|1:I?I|2:0}I!==0&&(d=!0,xd(y,I))}else I=Gi,I=oi(y,y===Un?I:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(I&3)===0||Hi(y,I)||(d=!0,xd(y,I));y=y.next}while(d);Tp=!1}}function uc(){Sp()}function Sp(){bf=wp=!1;var r=0;zu!==0&&Lf()&&(r=zu);for(var s=pr(),d=null,y=xf;y!==null;){var M=y.next,I=wf(y,s);I===0?(y.next=null,d===null?xf=M:d.next=M,M===null&&(kh=d)):(d=y,(r!==0||(I&3)!==0)&&(bf=!0)),y=M}Or!==0&&Or!==5||uo(r),zu!==0&&(zu=0)}function wf(r,s){for(var d=r.suspendedLanes,y=r.pingedLanes,M=r.expirationTimes,I=r.pendingLanes&-62914561;0<I;){var Y=31-Fe(I),ue=1<<Y,De=M[Y];De===-1?((ue&d)===0||(ue&y)!==0)&&(M[Y]=Gt(ue,s)):De<=s&&(r.expiredLanes|=ue),I&=~ue}if(s=Un,d=Gi,d=oi(r,r===s?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),y=r.callbackNode,d===0||r===s&&(Cn===2||Cn===9)||r.cancelPendingCommit!==null)return y!==null&&y!==null&&ia(y),r.callbackNode=null,r.callbackPriority=0;if((d&3)===0||Hi(r,d)){if(s=d&-d,s===r.callbackPriority)return s;switch(y!==null&&ia(y),Ve(d)){case 2:case 8:d=$o;break;case 32:d=ms;break;case 268435456:d=Be;break;default:d=ms}return y=Gm.bind(null,r),d=js(d,y),r.callbackPriority=s,r.callbackNode=d,s}return y!==null&&y!==null&&ia(y),r.callbackPriority=2,r.callbackNode=null,2}function Gm(r,s){if(Or!==0&&Or!==5)return r.callbackNode=null,r.callbackPriority=0,null;var d=r.callbackNode;if(yf()&&r.callbackNode!==d)return null;var y=Gi;return y=oi(r,r===Un?y:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),y===0?null:(Ar(r,y,s),wf(r,pr()),r.callbackNode!=null&&r.callbackNode===d?Gm.bind(null,r):null)}function xd(r,s){if(yf())return null;Ar(r,s,!0)}function Cp(){Op(function(){(gn&6)!==0?js(Ha,uc):Sp()})}function Mp(){if(zu===0){var r=du;r===0&&(r=ct,ct<<=1,(ct&261888)===0&&(ct=256)),zu=r}return zu}function Tf(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:mi(""+r)}function Sf(r,s){var d=s.ownerDocument.createElement("input");return d.name=s.name,d.value=s.value,r.id&&d.setAttribute("form",r.id),s.parentNode.insertBefore(d,s),r=new FormData(r),d.parentNode.removeChild(d),r}function Rh(r,s,d,y,M){if(s==="submit"&&d&&d.stateNode===M){var I=Tf((M[bt]||null).action),Y=y.submitter;Y&&(s=(s=Y[bt]||null)?Tf(s.formAction):Y.getAttribute("formAction"),s!==null&&(I=s,Y=null));var ue=new eu("action","action",null,y,M);r.push({event:ue,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(zu!==0){var De=Y?Sf(M,Y):new FormData(M);Wn(d,{pending:!0,data:De,method:M.method,action:I},null,De)}}else typeof I=="function"&&(ue.preventDefault(),De=Y?Sf(M,Y):new FormData(M),Wn(d,{pending:!0,data:De,method:M.method,action:I},I,De))},currentTarget:M}]})}}for(var Cf=0;Cf<Ys.length;Cf++){var Mf=Ys[Cf],Ep=Mf.toLowerCase(),qm=Mf[0].toUpperCase()+Mf.slice(1);da(Ep,"on"+qm)}da(Eo,"onAnimationEnd"),da(lu,"onAnimationIteration"),da(ll,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(ul,"onTransitionRun"),da(Nl,"onTransitionStart"),da(Fl,"onTransitionCancel"),da(Cr,"onTransitionEnd"),Xa("onMouseEnter",["mouseout","mouseover"]),Xa("onMouseLeave",["mouseout","mouseover"]),Xa("onPointerEnter",["pointerout","pointerover"]),Xa("onPointerLeave",["pointerout","pointerover"]),Oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Hm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cc));function $m(r,s){s=(s&4)!==0;for(var d=0;d<r.length;d++){var y=r[d],M=y.event;y=y.listeners;e:{var I=void 0;if(s)for(var Y=y.length-1;0<=Y;Y--){var ue=y[Y],De=ue.instance,Je=ue.currentTarget;if(ue=ue.listener,De!==I&&M.isPropagationStopped())break e;I=ue,M.currentTarget=Je;try{I(M)}catch(ht){ns(ht)}M.currentTarget=null,I=De}else for(Y=0;Y<y.length;Y++){if(ue=y[Y],De=ue.instance,Je=ue.currentTarget,ue=ue.listener,De!==I&&M.isPropagationStopped())break e;I=ue,M.currentTarget=Je;try{I(M)}catch(ht){ns(ht)}M.currentTarget=null,I=De}}}}function qi(r,s){var d=s[hi];d===void 0&&(d=s[hi]=new Set);var y=r+"__bubble";d.has(y)||(Af(s,r,2,!1),d.add(y))}function Ap(r,s,d){var y=0;s&&(y|=4),Af(d,r,y,s)}var Ef="_reactListening"+Math.random().toString(36).slice(2);function Pp(r){if(!r[Ef]){r[Ef]=!0,Pl.forEach(function(d){d!=="selectionchange"&&(Hm.has(d)||Ap(d,!1,r),Ap(d,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Ef]||(s[Ef]=!0,Ap("selectionchange",!1,s))}}function Af(r,s,d,y){switch(Qc(s)){case 2:var M=kd;break;case 8:M=og;break;default:M=Yp}d=M.bind(null,s,d,r),M=void 0,!br||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(M=!0),y?M!==void 0?r.addEventListener(s,d,{capture:!0,passive:M}):r.addEventListener(s,d,!0):M!==void 0?r.addEventListener(s,d,{passive:M}):r.addEventListener(s,d,!1)}function Yl(r,s,d,y,M){var I=y;if((s&1)===0&&(s&2)===0&&y!==null)e:for(;;){if(y===null)return;var Y=y.tag;if(Y===3||Y===4){var ue=y.stateNode.containerInfo;if(ue===M)break;if(Y===4)for(Y=y.return;Y!==null;){var De=Y.tag;if((De===3||De===4)&&Y.stateNode.containerInfo===M)return;Y=Y.return}for(;ue!==null;){if(Y=$a(ue),Y===null)return;if(De=Y.tag,De===5||De===6||De===26||De===27){y=I=Y;continue e}ue=ue.parentNode}}y=y.return}Ji(function(){var Je=I,ht=Qo(d),xt=[];e:{var nt=Mc.get(r);if(nt!==void 0){var ot=eu,Jt=r;switch(r){case"keypress":if(la(d)===0)break e;case"keydown":case"keyup":ot=Pn;break;case"focusin":Jt="focus",ot=wo;break;case"focusout":Jt="blur",ot=wo;break;case"beforeblur":case"afterblur":ot=wo;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ot=Jo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ot=tu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ot=$h;break;case Eo:case lu:case ll:ot=Vu;break;case Cr:ot=ru;break;case"scroll":case"scrollend":ot=Ci;break;case"wheel":ot=Hs;break;case"copy":case"cut":case"paste":ot=Da;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ot=Gu;break;case"toggle":case"beforetoggle":ot=xs}var di=(s&4)!==0,Mn=!di&&(r==="scroll"||r==="scrollend"),Ge=di?nt!==null?nt+"Capture":null:nt;di=[];for(var Oe=Je,We;Oe!==null;){var _t=Oe;if(We=_t.stateNode,_t=_t.tag,_t!==5&&_t!==26&&_t!==27||We===null||Ge===null||(_t=aa(Oe,Ge),_t!=null&&di.push(Oh(Oe,_t,We))),Mn)break;Oe=Oe.return}0<di.length&&(nt=new ot(nt,Jt,null,d,ht),xt.push({event:nt,listeners:di}))}}if((s&7)===0){e:{if(nt=r==="mouseover"||r==="pointerover",ot=r==="mouseout"||r==="pointerout",nt&&d!==Uu&&(Jt=d.relatedTarget||d.fromElement)&&($a(Jt)||Jt[li]))break e;if((ot||nt)&&(nt=ht.window===ht?ht:(nt=ht.ownerDocument)?nt.defaultView||nt.parentWindow:window,ot?(Jt=d.relatedTarget||d.toElement,ot=Je,Jt=Jt?$a(Jt):null,Jt!==null&&(Mn=E(Jt),di=Jt.tag,Jt!==Mn||di!==5&&di!==27&&di!==6)&&(Jt=null)):(ot=null,Jt=Je),ot!==Jt)){if(di=Jo,_t="onMouseLeave",Ge="onMouseEnter",Oe="mouse",(r==="pointerout"||r==="pointerover")&&(di=Gu,_t="onPointerLeave",Ge="onPointerEnter",Oe="pointer"),Mn=ot==null?nt:Ca(ot),We=Jt==null?nt:Ca(Jt),nt=new di(_t,Oe+"leave",ot,d,ht),nt.target=Mn,nt.relatedTarget=We,_t=null,$a(ht)===Je&&(di=new di(Ge,Oe+"enter",Jt,d,ht),di.target=We,di.relatedTarget=Mn,_t=di),Mn=_t,ot&&Jt)t:{for(di=Xm,Ge=ot,Oe=Jt,We=0,_t=Ge;_t;_t=di(_t))We++;_t=0;for(var ci=Oe;ci;ci=di(ci))_t++;for(;0<We-_t;)Ge=di(Ge),We--;for(;0<_t-We;)Oe=di(Oe),_t--;for(;We--;){if(Ge===Oe||Oe!==null&&Ge===Oe.alternate){di=Ge;break t}Ge=di(Ge),Oe=di(Oe)}di=null}else di=null;ot!==null&&zp(xt,nt,ot,di,!1),Jt!==null&&Mn!==null&&zp(xt,Mn,Jt,di,!0)}}e:{if(nt=Je?Ca(Je):window,ot=nt.nodeName&&nt.nodeName.toLowerCase(),ot==="select"||ot==="input"&&nt.type==="file")var cn=es;else if(Ia(nt))if(Sc)cn=lh;else{cn=oh;var ei=$s}else ot=nt.nodeName,!ot||ot.toLowerCase()!=="input"||nt.type!=="checkbox"&&nt.type!=="radio"?Je&&Zs(Je.elementType)&&(cn=es):cn=ws;if(cn&&(cn=cn(r,Je))){Hu(xt,cn,d,ht);break e}ei&&ei(r,nt,Je),r==="focusout"&&Je&&nt.type==="number"&&Je.memoizedProps.value!=null&&Ya(nt,"number",nt.value)}switch(ei=Je?Ca(Je):window,r){case"focusin":(Ia(ei)||ei.contentEditable==="true")&&(ha=ei,Bl=Je,ou=null);break;case"focusout":ou=Bl=ha=null;break;case"mousedown":sl=!0;break;case"contextmenu":case"mouseup":case"dragend":sl=!1,uh(xt,d,ht);break;case"selectionchange":if(al)break;case"keydown":case"keyup":uh(xt,d,ht)}var ai;if(Bn)e:{switch(r){case"compositionstart":var Ui="onCompositionStart";break e;case"compositionend":Ui="onCompositionEnd";break e;case"compositionupdate":Ui="onCompositionUpdate";break e}Ui=void 0}else Ja?su(r,d)&&(Ui="onCompositionEnd"):r==="keydown"&&d.keyCode===229&&(Ui="onCompositionStart");Ui&&(So&&d.locale!=="ko"&&(Ja||Ui!=="onCompositionStart"?Ui==="onCompositionEnd"&&Ja&&(ai=oa()):(Hr=ht,sa="value"in Hr?Hr.value:Hr.textContent,Ja=!0)),ei=bd(Je,Ui),0<ei.length&&(Ui=new Zu(Ui,r,null,d,ht),xt.push({event:Ui,listeners:ei}),ai?Ui.data=ai:(ai=Tc(d),ai!==null&&(Ui.data=ai)))),(ai=Dl?ua(r,d):il(r,d))&&(Ui=bd(Je,"onBeforeInput"),0<Ui.length&&(ei=new Zu("onBeforeInput","beforeinput",null,d,ht),xt.push({event:ei,listeners:Ui}),ei.data=ai)),Rh(xt,r,Je,d,ht)}$m(xt,s)})}function Oh(r,s,d){return{instance:r,listener:s,currentTarget:d}}function bd(r,s){for(var d=s+"Capture",y=[];r!==null;){var M=r,I=M.stateNode;if(M=M.tag,M!==5&&M!==26&&M!==27||I===null||(M=aa(r,d),M!=null&&y.unshift(Oh(r,M,I)),M=aa(r,s),M!=null&&y.push(Oh(r,M,I))),r.tag===3)return y;r=r.return}return[]}function Xm(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function zp(r,s,d,y,M){for(var I=s._reactName,Y=[];d!==null&&d!==y;){var ue=d,De=ue.alternate,Je=ue.stateNode;if(ue=ue.tag,De!==null&&De===y)break;ue!==5&&ue!==26&&ue!==27||Je===null||(De=Je,M?(Je=aa(d,I),Je!=null&&Y.unshift(Oh(d,Je,De))):M||(Je=aa(d,I),Je!=null&&Y.push(Oh(d,Je,De)))),d=d.return}Y.length!==0&&r.push({event:s,listeners:Y})}var Ym=/\r\n?/g,Wm=/\u0000|\uFFFD/g;function wd(r){return(typeof r=="string"?r:""+r).replace(Ym,`
9`).replace(Wm,"")}function Lp(r,s){return s=wd(s),wd(r)===s}function un(r,s,d,y,M,I){switch(d){case"children":typeof y=="string"?s==="body"||s==="textarea"&&y===""||Ma(r,y):(typeof y=="number"||typeof y=="bigint")&&s!=="body"&&Ma(r,""+y);break;case"className":$i(r,"class",y);break;case"tabIndex":$i(r,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":$i(r,d,y);break;case"style":zl(r,y,I);break;case"data":if(s!=="object"){$i(r,"data",y);break}case"src":case"href":if(y===""&&(s!=="a"||d!=="href")){r.removeAttribute(d);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){r.removeAttribute(d);break}y=mi(""+y),r.setAttribute(d,y);break;case"action":case"formAction":if(typeof y=="function"){r.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof I=="function"&&(d==="formAction"?(s!=="input"&&un(r,s,"name",M.name,M,null),un(r,s,"formEncType",M.formEncType,M,null),un(r,s,"formMethod",M.formMethod,M,null),un(r,s,"formTarget",M.formTarget,M,null)):(un(r,s,"encType",M.encType,M,null),un(r,s,"method",M.method,M,null),un(r,s,"target",M.target,M,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){r.removeAttribute(d);break}y=mi(""+y),r.setAttribute(d,y);break;case"onClick":y!=null&&(r.onclick=ra);break;case"onScroll":y!=null&&qi("scroll",r);break;case"onScrollEnd":y!=null&&qi("scrollend",r);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(R(61));if(d=y.__html,d!=null){if(M.children!=null)throw Error(R(60));r.innerHTML=d}}break;case"multiple":r.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":r.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){r.removeAttribute("xlink:href");break}d=mi(""+y),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?r.setAttribute(d,""+y):r.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
9ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?r.setAttribute(d,""):r.removeAttribute(d);break;case"capture":case"download":y===!0?r.setAttribute(d,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?r.setAttribute(d,y):r.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?r.setAttribute(d,y):r.removeAttribute(d);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?r.removeAttribute(d):r.setAttribute(d,y);break;case"popover":qi("beforetoggle",r),qi("toggle",r),Bi(r,"popover",y);break;case"xlinkActuate":qr(r,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":qr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":qr(r,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":qr(r,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":qr(r,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":qr(r,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":qr(r,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":qr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":qr(r,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":Bi(r,"is",y);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=Ka.get(d)||d,Bi(r,d,y))}}function Pf(r,s,d,y,M,I){switch(d){case"style":zl(r,y,I);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(R(61));if(d=y.__html,d!=null){if(M.children!=null)throw Error(R(60));r.innerHTML=d}}break;case"children":typeof y=="string"?Ma(r,y):(typeof y=="number"||typeof y=="bigint")&&Ma(r,""+y);break;case"onScroll":y!=null&&qi("scroll",r);break;case"onScrollEnd":y!=null&&qi("scrollend",r);break;case"onClick":y!=null&&(r.onclick=ra);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zr.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(M=d.endsWith("Capture"),s=d.slice(2,M?d.length-7:void 0),I=r[bt]||null,I=I!=null?I[d]:null,typeof I=="function"&&r.removeEventListener(s,I,M),typeof y=="function")){typeof I!="function"&&I!==null&&(d in r?r[d]=null:r.hasAttribute(d)&&r.removeAttribute(d)),r.addEventListener(s,y,M);break e}d in r?r[d]=y:y===!0?r.setAttribute(d,""):Bi(r,d,y)}}}function ea(r,s,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qi("error",r),qi("load",r);var y=!1,M=!1,I;for(I in d)if(d.hasOwnProperty(I)){var Y=d[I];if(Y!=null)switch(I){case"src":y=!0;break;case"srcSet":M=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(R(137,s));default:un(r,s,I,Y,d,null)}}M&&un(r,s,"srcSet",d.srcSet,d,null),y&&un(r,s,"src",d.src,d,null);return;case"input":qi("invalid",r);var ue=I=Y=M=null,De=null,Je=null;for(y in d)if(d.hasOwnProperty(y)){var ht=d[y];if(ht!=null)switch(y){case"name":M=ht;break;case"type":Y=ht;break;case"checked":De=ht;break;case"defaultChecked":Je=ht;break;case"value":I=ht;break;case"defaultValue":ue=ht;break;case"children":case"dangerouslySetInnerHTML":if(ht!=null)throw Error(R(137,s));break;default:un(r,s,y,ht,d,null)}}Ko(r,I,ue,De,Je,Y,M,!1);return;case"select":qi("invalid",r),y=Y=I=null;for(M in d)if(d.hasOwnProperty(M)&&(ue=d[M],ue!=null))switch(M){case"value":I=ue;break;case"defaultValue":Y=ue;break;case"multiple":y=ue;default:un(r,s,M,ue,d,null)}s=I,d=Y,r.multiple=!!y,s!=null?fn(r,!!y,s,!1):d!=null&&fn(r,!!y,d,!0);return;case"textarea":qi("invalid",r),I=M=y=null;for(Y in d)if(d.hasOwnProperty(Y)&&(ue=d[Y],ue!=null))switch(Y){case"value":y=ue;break;case"defaultValue":M=ue;break;case"children":I=ue;break;case"dangerouslySetInnerHTML":if(ue!=null)throw Error(R(91));break;default:un(r,s,Y,ue,d,null)}vs(r,y,M,I);return;case"option":for(De in d)d.hasOwnProperty(De)&&(y=d[De],y!=null)&&(De==="selected"?r.selected=y&&typeof y!="function"&&typeof y!="symbol":un(r,s,De,y,d,null));return;case"dialog":qi("beforetoggle",r),qi("toggle",r),qi("cancel",r),qi("close",r);break;case"iframe":case"object":qi("load",r);break;case"video":case"audio":for(y=0;y<cc.length;y++)qi(cc[y],r);break;case"image":qi("error",r),qi("load",r);break;case"details":qi("toggle",r);break;case"embed":case"source":case"link":qi("error",r),qi("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Je in d)if(d.hasOwnProperty(Je)&&(y=d[Je],y!=null))switch(Je){case"children":case"dangerouslySetInnerHTML":throw Error(R(137,s));default:un(r,s,Je,y,d,null)}return;default:if(Zs(s)){for(ht in d)d.hasOwnProperty(ht)&&(y=d[ht],y!==void 0&&Pf(r,s,ht,y,d,void 0));return}}for(ue in d)d.hasOwnProperty(ue)&&(y=d[ue],y!=null&&un(r,s,ue,y,d,null))}function Km(r,s,d,y){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var M=null,I=null,Y=null,ue=null,De=null,Je=null,ht=null;for(ot in d){var xt=d[ot];if(d.hasOwnProperty(ot)&&xt!=null)switch(ot){case"checked":break;case"value":break;case"defaultValue":De=xt;default:y.hasOwnProperty(ot)||un(r,s,ot,null,y,xt)}}for(var nt in y){var ot=y[nt];if(xt=d[nt],y.hasOwnProperty(nt)&&(ot!=null||xt!=null))switch(nt){case"type":I=ot;break;case"name":M=ot;break;case"checked":Je=ot;break;case"defaultChecked":ht=ot;break;case"value":Y=ot;break;case"defaultValue":ue=ot;break;case"children":case"dangerouslySetInnerHTML":if(ot!=null)throw Error(R(137,s));break;default:ot!==xt&&un(r,s,nt,ot,y,xt)}}Jl(r,Y,ue,De,Je,ht,I,M);return;case"select":ot=Y=ue=nt=null;for(I in d)if(De=d[I],d.hasOwnProperty(I)&&De!=null)switch(I){case"value":break;case"multiple":ot=De;default:y.hasOwnProperty(I)||un(r,s,I,null,y,De)}for(M in y)if(I=y[M],De=d[M],y.hasOwnProperty(M)&&(I!=null||De!=null))switch(M){case"value":nt=I;break;case"defaultValue":ue=I;break;case"multiple":Y=I;default:I!==De&&un(r,s,M,I,y,De)}s=ue,d=Y,y=ot,nt!=null?fn(r,!!d,nt,!1):!!y!=!!d&&(s!=null?fn(r,!!d,s,!0):fn(r,!!d,d?[]:"",!1));return;case"textarea":ot=nt=null;for(ue in d)if(M=d[ue],d.hasOwnProperty(ue)&&M!=null&&!y.hasOwnProperty(ue))switch(ue){case"value":break;case"children":break;default:un(r,s,ue,null,y,M)}for(Y in y)if(M=y[Y],I=d[Y],y.hasOwnProperty(Y)&&(M!=null||I!=null))switch(Y){case"value":nt=M;break;case"defaultValue":ot=M;break;case"children":break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(R(91));break;default:M!==I&&un(r,s,Y,M,y,I)}yo(r,nt,ot);return;case"option":for(var Jt in d)nt=d[Jt],d.hasOwnProperty(Jt)&&nt!=null&&!y.hasOwnProperty(Jt)&&(Jt==="selected"?r.selected=!1:un(r,s,Jt,null,y,nt));for(De in y)nt=y[De],ot=d[De],y.hasOwnProperty(De)&&nt!==ot&&(nt!=null||ot!=null)&&(De==="selected"?r.selected=nt&&typeof nt!="function"&&typeof nt!="symbol":un(r,s,De,nt,y,ot));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var di in d)nt=d[di],d.hasOwnProperty(di)&&nt!=null&&!y.hasOwnProperty(di)&&un(r,s,di,null,y,nt);for(Je in y)if(nt=y[Je],ot=d[Je],y.hasOwnProperty(Je)&&nt!==ot&&(nt!=null||ot!=null))switch(Je){case"children":case"dangerouslySetInnerHTML":if(nt!=null)throw Error(R(137,s));break;default:un(r,s,Je,nt,y,ot)}return;default:if(Zs(s)){for(var Mn in d)nt=d[Mn],d.hasOwnProperty(Mn)&&nt!==void 0&&!y.hasOwnProperty(Mn)&&Pf(r,s,Mn,void 0,y,nt);for(ht in y)nt=y[ht],ot=d[ht],!y.hasOwnProperty(ht)||nt===ot||nt===void 0&&ot===void 0||Pf(r,s,ht,nt,y,ot);return}}for(var Ge in d)nt=d[Ge],d.hasOwnProperty(Ge)&&nt!=null&&!y.hasOwnProperty(Ge)&&un(r,s,Ge,null,y,nt);for(xt in y)nt=y[xt],ot=d[xt],!y.hasOwnProperty(xt)||nt===ot||nt==null&&ot==null||un(r,s,xt,nt,y,ot)}function Ns(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Bh(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,d=performance.getEntriesByType("resource"),y=0;y<d.length;y++){var M=d[y],I=M.transferSize,Y=M.initiatorType,ue=M.duration;if(I&&ue&&Ns(Y)){for(Y=0,ue=M.responseEnd,y+=1;y<d.length;y++){var De=d[y],Je=De.startTime;if(Je>ue)break;var ht=De.transferSize,xt=De.initiatorType;ht&&Ns(xt)&&(De=De.responseEnd,Y+=ht*(De<ue?1:(ue-Je)/(De-Je)))}if(--y,s+=8*(I+Y)/(M.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Td=null,Dp=null;function Sd(r){return r.nodeType===9?r:r.ownerDocument}function hc(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ip(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function zf(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var dc=null;function Lf(){var r=window.event;return r&&r.type==="popstate"?r===dc?!1:(dc=r,!0):(dc=null,!1)}var Df=typeof setTimeout=="function"?setTimeout:void 0,kp=typeof clearTimeout=="function"?clearTimeout:void 0,Rp=typeof Promise=="function"?Promise:void 0,Op=typeof queueMicrotask=="function"?queueMicrotask:typeof Rp<"u"?function(r){return Rp.resolve(null).then(r).catch(Bp)}:Df;function Bp(r){setTimeout(function(){throw r})}function fc(r){return r==="head"}function Qm(r,s){var d=s,y=0;do{var M=d.nextSibling;if(r.removeChild(d),M&&M.nodeType===8)if(d=M.data,d==="/$"||d==="/&"){if(y===0){r.removeChild(M),vc(s);return}y--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")y++;else if(d==="html")Nh(r.ownerDocument.documentElement);else if(d==="head"){d=r.ownerDocument.head,Nh(d);for(var I=d.firstChild;I;){var Y=I.nextSibling,ue=I.nodeName;I[fi]||ue==="SCRIPT"||ue==="STYLE"||ue==="LINK"&&I.rel.toLowerCase()==="stylesheet"||d.removeChild(I),I=Y}}else d==="body"&&Nh(r.ownerDocument.body);d=M}while(d);
vendor: 9,881 bytes, line 9
9vc(s)}function Li(r,s){var d=r;r=0;do{var y=d.nextSibling;if(d.nodeType===1?s?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(s?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),y&&y.nodeType===8)if(d=y.data,d==="/$"){if(r===0)break;r--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||r++;d=y}while(d)}function Sl(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var d=s;switch(s=s.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Sl(d),Xo(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}r.removeChild(d)}}function va(r,s,d,y){for(;r.nodeType===1;){var M=d;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!y&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(y){if(!r[fi])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(I=r.getAttribute("rel"),I==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(I!==M.rel||r.getAttribute("href")!==(M.href==null||M.href===""?null:M.href)||r.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin)||r.getAttribute("title")!==(M.title==null?null:M.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(I=r.getAttribute("src"),(I!==(M.src==null?null:M.src)||r.getAttribute("type")!==(M.type==null?null:M.type)||r.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin))&&I&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var I=M.name==null?null:""+M.name;if(M.type==="hidden"&&r.getAttribute("name")===I)return r}else return r;if(r=co(r.nextSibling),r===null)break}return null}function Cl(r,s,d){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!d||(r=co(r.nextSibling),r===null))return null;return r}function pc(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=co(r.nextSibling),r===null))return null;return r}function ja(r){return r.data==="$?"||r.data==="$~"}function _r(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function Br(r,s){var d=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||d.readyState!=="loading")s();else{var y=function(){s(),d.removeEventListener("DOMContentLoaded",y)};d.addEventListener("DOMContentLoaded",y),r._reactRetry=y}}function co(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var ds=null;function Nr(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var d=r.data;if(d==="/$"||d==="/&"){if(s===0)return co(r.nextSibling);s--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||s++}r=r.nextSibling}return null}function Cd(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var d=r.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(s===0)return r;s--}else d!=="/$"&&d!=="/&"||s++}r=r.previousSibling}return null}function Jm(r,s,d){switch(s=Sd(d),r){case"html":if(r=s.documentElement,!r)throw Error(R(452));return r;case"head":if(r=s.head,!r)throw Error(R(453));return r;case"body":if(r=s.body,!r)throw Error(R(454));return r;default:throw Error(R(451))}}function Nh(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);Xo(r)}var xa=new Map,Wc=new Set;function If(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Wl=mt.d;mt.d={f:eg,r:tg,D:Fp,C:Ua,L:Ml,m:Va,X:kf,S:gc,M:jp};function eg(){var r=Wl.f(),s=_d();return r||s}function tg(r){var s=Us(r);s!==null&&s.tag===5&&s.type==="form"?Dr(s):Wl.r(r)}var mc=typeof document>"u"?null:document;function Np(r,s,d){var y=mc;if(y&&typeof s=="string"&&s){var M=vn(s);M='link[rel="'+r+'"][href="'+M+'"]',typeof d=="string"&&(M+='[crossorigin="'+d+'"]'),Wc.has(M)||(Wc.add(M),r={rel:r,crossOrigin:d,href:s},y.querySelector(M)===null&&(s=y.createElement("link"),ea(s,"link",r),Rn(s),y.head.appendChild(s)))}}function Fp(r){Wl.D(r),Np("dns-prefetch",r,null)}function Ua(r,s){Wl.C(r,s),Np("preconnect",r,s)}function Ml(r,s,d){Wl.L(r,s,d);var y=mc;if(y&&r&&s){var M='link[rel="preload"][as="'+vn(s)+'"]';s==="image"&&d&&d.imageSrcSet?(M+='[imagesrcset="'+vn(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(M+='[imagesizes="'+vn(d.imageSizes)+'"]')):M+='[href="'+vn(r)+'"]';var I=M;switch(s){case"style":I=Kc(r);break;case"script":I=Lu(r)}xa.has(I)||(r=ne({rel:"preload",href:s==="image"&&d&&d.imageSrcSet?void 0:r,as:s},d),xa.set(I,r),y.querySelector(M)!==null||s==="style"&&y.querySelector(Fh(I))||s==="script"&&y.querySelector(jh(I))||(s=y.createElement("link"),ea(s,"link",r),Rn(s),y.head.appendChild(s)))}}function Va(r,s){Wl.m(r,s);var d=mc;if(d&&r){var y=s&&typeof s.as=="string"?s.as:"script",M='link[rel="modulepreload"][as="'+vn(y)+'"][href="'+vn(r)+'"]',I=M;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":I=Lu(r)}if(!xa.has(I)&&(r=ne({rel:"modulepreload",href:r},s),xa.set(I,r),d.querySelector(M)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(jh(I)))return}y=d.createElement("link"),ea(y,"link",r),Rn(y),d.head.appendChild(y)}}}function gc(r,s,d){Wl.S(r,s,d);var y=mc;if(y&&r){var M=_s(y).hoistableStyles,I=Kc(r);s=s||"default";var Y=M.get(I);if(!Y){var ue={loading:0,preload:null};if(Y=y.querySelector(Fh(I)))ue.loading=5;else{r=ne({rel:"stylesheet",href:r,"data-precedence":s},d),(d=xa.get(I))&&Md(r,d);var De=Y=y.createElement("link");Rn(De),ea(De,"link",r),De._p=new Promise(function(Je,ht){De.onload=Je,De.onerror=ht}),De.addEventListener("load",function(){ue.loading|=1}),De.addEventListener("error",function(){ue.loading|=2}),ue.loading|=4,Du(Y,s,y)}Y={type:"stylesheet",instance:Y,count:1,state:ue},M.set(I,Y)}}}function kf(r,s){Wl.X(r,s);var d=mc;if(d&&r){var y=_s(d).hoistableScripts,M=Lu(r),I=y.get(M);I||(I=d.querySelector(jh(M)),I||(r=ne({src:r,async:!0},s),(s=xa.get(M))&&Rf(r,s),I=d.createElement("script"),Rn(I),ea(I,"link",r),d.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},y.set(M,I))}}function jp(r,s){Wl.M(r,s);var d=mc;if(d&&r){var y=_s(d).hoistableScripts,M=Lu(r),I=y.get(M);I||(I=d.querySelector(jh(M)),I||(r=ne({src:r,async:!0,type:"module"},s),(s=xa.get(M))&&Rf(r,s),I=d.createElement("script"),Rn(I),ea(I,"link",r),d.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},y.set(M,I))}}function Up(r,s,d,y){var M=(M=Ct.current)?If(M):null;if(!M)throw Error(R(446));switch(r){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(s=Kc(d.href),d=_s(M).hoistableStyles,y=d.get(s),y||(y={type:"style",instance:null,count:0,state:null},d.set(s,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){r=Kc(d.href);var I=_s(M).hoistableStyles,Y=I.get(r);if(Y||(M=M.ownerDocument||M,Y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},I.set(r,Y),(I=M.querySelector(Fh(r)))&&!I._p&&(Y.instance=I,Y.state.loading=5),xa.has(r)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},xa.set(r,d),I||Zp(M,r,d,Y.state))),s&&y===null)throw Error(R(528,""));return Y}if(s&&y!==null)throw Error(R(529,""));return null;case"script":return s=d.async,d=d.src,typeof d=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Lu(d),d=_s(M).hoistableScripts,y=d.get(s),y||(y={type:"script",instance:null,count:0,state:null},d.set(s,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(R(444,r))}}function Kc(r){return'href="'+vn(r)+'"'}function Fh(r){return'link[rel="stylesheet"]['+r+"]"}function Vp(r){return ne({},r,{"data-precedence":r.precedence,precedence:null})}function Zp(r,s,d,y){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?y.loading=1:(s=r.createElement("link"),y.preload=s,s.addEventListener("load",function(){return y.loading|=1}),s.addEventListener("error",function(){return y.loading|=2}),ea(s,"link",d),Rn(s),r.head.appendChild(s))}function Lu(r){return'[src="'+vn(r)+'"]'}function jh(r){return"script[async]"+r}function Gp(r,s,d){if(s.count++,s.instance===null)switch(s.type){case"style":var y=r.querySelector('style[data-href~="'+vn(d.href)+'"]');if(y)return s.instance=y,Rn(y),y;var M=ne({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return y=(r.ownerDocument||r).createElement("style"),Rn(y),ea(y,"style",M),Du(y,d.precedence,r),s.instance=y;case"stylesheet":M=Kc(d.href);var I=r.querySelector(Fh(M));if(I)return s.state.loading|=4,s.instance=I,Rn(I),I;y=Vp(d),(M=xa.get(M))&&Md(y,M),I=(r.ownerDocument||r).createElement("link"),Rn(I);var Y=I;return Y._p=new Promise(function(ue,De){Y.onload=ue,Y.onerror=De}),ea(I,"link",y),s.state.loading|=4,Du(I,d.precedence,r),s.instance=I;case"script":return I=Lu(d.src),(M=r.querySelector(jh(I)))?(s.instance=M,Rn(M),M):(y=d,(M=xa.get(I))&&(y=ne({},d),Rf(y,M)),r=r.ownerDocument||r,M=r.createElement("script"),Rn(M),ea(M,"link",y),r.head.appendChild(M),s.instance=M);case"void":return null;default:throw Error(R(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(y=s.instance,s.state.loading|=4,Du(y,d.precedence,r));return s.instance}function Du(r,s,d){for(var y=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),M=y.length?y[y.length-1]:null,I=M,Y=0;Y<y.length;Y++){var ue=y[Y];
vendor: 3,228 bytes, line 9
9if(ue.dataset.precedence===s)I=ue;else if(I!==M)break}I?I.parentNode.insertBefore(r,I.nextSibling):(s=d.nodeType===9?d.head:d,s.insertBefore(r,s.firstChild))}function Md(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function Rf(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var Of=null;function qp(r,s,d){if(Of===null){var y=new Map,M=Of=new Map;M.set(d,y)}else M=Of,y=M.get(d),y||(y=new Map,M.set(d,y));if(y.has(r))return y;for(y.set(r,null),d=d.getElementsByTagName(r),M=0;M<d.length;M++){var I=d[M];if(!(I[fi]||I[Pi]||r==="link"&&I.getAttribute("rel")==="stylesheet")&&I.namespaceURI!=="http://www.w3.org/2000/svg"){var Y=I.getAttribute(s)||"";Y=r+Y;var ue=y.get(Y);ue?ue.push(I):y.set(Y,[I])}}return y}function Ed(r,s,d){r=r.ownerDocument||r,r.head.insertBefore(d,s==="title"?r.querySelector("head > title"):null)}function Bf(r,s,d){if(d===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Ad(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Hp(r,s,d,y){if(d.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var M=Kc(y.href),I=s.querySelector(Fh(M));if(I){s=I._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=zd.bind(r),s.then(r,r)),d.state.loading|=4,d.instance=I,Rn(I);return}I=s.ownerDocument||s,y=Vp(y),(M=xa.get(M))&&Md(y,M),I=I.createElement("link"),Rn(I);var Y=I;Y._p=new Promise(function(ue,De){Y.onload=ue,Y.onerror=De}),ea(I,"link",y),d.instance=I}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(d,s),(s=d.state.preload)&&(d.state.loading&3)===0&&(r.count++,d=zd.bind(r),s.addEventListener("load",d),s.addEventListener("error",d))}}var Pd=0;function $p(r,s){return r.stylesheets&&r.count===0&&Dd(r,r.stylesheets),0<r.count||0<r.imgCount?function(d){var y=setTimeout(function(){if(r.stylesheets&&Dd(r,r.stylesheets),r.unsuspend){var I=r.unsuspend;r.unsuspend=null,I()}},6e4+s);0<r.imgBytes&&Pd===0&&(Pd=62500*Bh());var M=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Dd(r,r.stylesheets),r.unsuspend)){var I=r.unsuspend;r.unsuspend=null,I()}},(r.imgBytes>Pd?50:800)+s);return r.unsuspend=d,function(){r.unsuspend=null,clearTimeout(y),clearTimeout(M)}}:null}function zd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ld=null;function Dd(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ld=new Map,s.forEac
vendor: 10,474 bytes, line 9
9h(ig,r),Ld=null,zd.call(r))}function ig(r,s){if(!(s.state.loading&4)){var d=Ld.get(r);if(d)var y=d.get(null);else{d=new Map,Ld.set(r,d);for(var M=r.querySelectorAll("link[data-precedence],style[data-precedence]"),I=0;I<M.length;I++){var Y=M[I];(Y.nodeName==="LINK"||Y.getAttribute("media")!=="not all")&&(d.set(Y.dataset.precedence,Y),y=Y)}y&&d.set(null,y)}M=s.instance,Y=M.getAttribute("data-precedence"),I=d.get(Y)||y,I===y&&d.set(null,M),d.set(Y,M),this.count++,y=zd.bind(this),M.addEventListener("load",y),M.addEventListener("error",y),I?I.parentNode.insertBefore(M,I.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(M,r.firstChild)),s.state.loading|=4}}var Uh={$$typeof:dt,Provider:null,Consumer:null,_currentValue:gt,_currentValue2:gt,_threadCount:0};function Rg(r,s,d,y,M,I,Y,ue,De){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yi(0),this.hiddenUpdates=yi(null),this.identifierPrefix=y,this.onUncaughtError=M,this.onCaughtError=I,this.onRecoverableError=Y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=De,this.incompleteTransitions=new Map}function Xp(r,s,d,y,M,I,Y,ue,De,Je,ht,xt){return r=new Rg(r,s,d,Y,De,Je,ht,xt,ue),s=1,I===!0&&(s|=24),I=fa(3,null,null,s),r.current=I,I.stateNode=r,s=ko(),s.refCount++,r.pooledCache=s,s.refCount++,I.memoizedState={element:y,isDehydrated:d,cache:s},yh(I),r}function ng(r){return r?(r=gi,r):gi}function rg(r,s,d,y,M,I){M=ng(M),y.context===null?y.context=M:y.pendingContext=M,y=Fo(s),y.payload={element:d},I=I===void 0?null:I,I!==null&&(y.callback=I),d=pl(r,y,s),d!==null&&(Bs(d,r,s),As(d,r,s))}function Nf(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var d=r.retryLane;r.retryLane=d!==0&&d<s?d:s}}function Ff(r,s){Nf(r,s),(r=r.alternate)&&Nf(r,s)}function ag(r){if(r.tag===13||r.tag===31){var s=Yr(r,67108864);s!==null&&Bs(s,r,67108864),Ff(r,67108864)}}function sg(r){if(r.tag===13||r.tag===31){var s=Os();s=Qi(s);var d=Yr(r,s);d!==null&&Bs(d,r,s),Ff(r,s)}}var Id=!0;function kd(r,s,d,y){var M=Ke.T;Ke.T=null;var I=mt.p;try{mt.p=2,Yp(r,s,d,y)}finally{mt.p=I,Ke.T=M}}function og(r,s,d,y){var M=Ke.T;Ke.T=null;var I=mt.p;try{mt.p=8,Yp(r,s,d,y)}finally{mt.p=I,Ke.T=M}}function Yp(r,s,d,y){if(Id){var M=Rd(y);if(M===null)Yl(r,s,y,Vh,d),lg(r,y);else if(Bg(M,r,s,d,y))y.stopPropagation();else if(lg(r,y),s&4&&-1<Og.indexOf(r)){for(;M!==null;){var I=Us(M);if(I!==null)switch(I.tag){case 3:if(I=I.stateNode,I.current.memoizedState.isDehydrated){var Y=ke(I.pendingLanes);if(Y!==0){var ue=I;for(ue.pendingLanes|=2,ue.entangledLanes|=2;Y;){var De=1<<31-Fe(Y);ue.entanglements[1]|=De,Y&=~De}Tl(I),(gn&6)===0&&(md=pr()+500,uo(0))}}break;case 31:case 13:ue=Yr(I,2),ue!==null&&Bs(ue,I,2),_d(),Ff(I,2)}if(I=Rd(y),I===null&&Yl(r,s,y,Vh,d),I===M)break;M=I}M!==null&&y.stopPropagation()}else Yl(r,s,y,null,d)}}function Rd(r){return r=Qo(r),jf(r)}var Vh=null;function jf(r){if(Vh=null,r=$a(r),r!==null){var s=E(r);if(s===null)r=null;else{var d=s.tag;if(d===13){if(r=T(s),r!==null)return r;r=null}else if(d===31){if(r=u(s),r!==null)return r;r=null}else if(d===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return Vh=r,null}function Qc(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Sa()){case Ha:return 2;case $o:return 8;case ms:case Al:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Uf=!1,_c=null,qo=null,yc=null,Od=new Map,Zh=new Map,Iu=[],Og="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function lg(r,s){switch(r){case"focusin":case"focusout":_c=null;break;case"dragenter":case"dragleave":qo=null;break;case"mouseover":case"mouseout":yc=null;break;case"pointerover":case"pointerout":Od.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zh.delete(s.pointerId)}}function Bd(r,s,d,y,M,I){return r===null||r.nativeEvent!==I?(r={blockedOn:s,domEventName:d,eventSystemFlags:y,nativeEvent:I,targetContainers:[M]},s!==null&&(s=Us(s),s!==null&&ag(s)),r):(r.eventSystemFlags|=y,s=r.targetContainers,M!==null&&s.indexOf(M)===-1&&s.push(M),r)}function Bg(r,s,d,y,M){switch(s){case"focusin":return _c=Bd(_c,r,s,d,y,M),!0;case"dragenter":return qo=Bd(qo,r,s,d,y,M),!0;case"mouseover":return yc=Bd(yc,r,s,d,y,M),!0;case"pointerover":var I=M.pointerId;return Od.set(I,Bd(Od.get(I)||null,r,s,d,y,M)),!0;case"gotpointercapture":return I=M.pointerId,Zh.set(I,Bd(Zh.get(I)||null,r,s,d,y,M)),!0}return!1}function ug(r){var s=$a(r.target);if(s!==null){var d=E(s);if(d!==null){if(s=d.tag,s===13){if(s=T(d),s!==null){r.blockedOn=s,Pr(r.priority,function(){sg(d)});return}}else if(s===31){if(s=u(d),s!==null){r.blockedOn=s,Pr(r.priority,function(){sg(d)});return}}else if(s===3&&d.stateNode.current.memoizedState.isDehydrated){r.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Nd(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var d=Rd(r.nativeEvent);if(d===null){d=r.nativeEvent;var y=new d.constructor(d.type,d);Uu=y,d.target.dispatchEvent(y),Uu=null}else return s=Us(d),s!==null&&ag(s),r.blockedOn=d,!1;s.shift()}return!0}function cg(r,s,d){Nd(r)&&d.delete(s)}function Fd(){Uf=!1,_c!==null&&Nd(_c)&&(_c=null),qo!==null&&Nd(qo)&&(qo=null),yc!==null&&Nd(yc)&&(yc=null),Od.forEach(cg),Zh.forEach(cg)}function Vf(r,s){r.blockedOn===s&&(r.blockedOn=null,Uf||(Uf=!0,j.unstable_scheduleCallback(j.unstable_NormalPriority,Fd)))}var Zf=null;function hg(r){Zf!==r&&(Zf=r,j.unstable_scheduleCallback(j.unstable_NormalPriority,function(){Zf===r&&(Zf=null);for(var s=0;s<r.length;s+=3){var d=r[s],y=r[s+1],M=r[s+2];if(typeof y!="function"){if(jf(y||d)===null)continue;break}var I=Us(d);I!==null&&(r.splice(s,3),s-=3,Wn(I,{pending:!0,data:M,method:d.method,action:y},y,M))}}))}function vc(r){function s(De){return Vf(De,r)}_c!==null&&Vf(_c,r),qo!==null&&Vf(qo,r),yc!==null&&Vf(yc,r),Od.forEach(s),Zh.forEach(s);for(var d=0;d<Iu.length;d++){var y=Iu[d];y.blockedOn===r&&(y.blockedOn=null)}for(;0<Iu.length&&(d=Iu[0],d.blockedOn===null);)ug(d),d.blockedOn===null&&Iu.shift();if(d=(r.ownerDocument||r).$$reactFormReplay,d!=null)for(y=0;y<d.length;y+=3){var M=d[y],I=d[y+1],Y=M[bt]||null;if(typeof I=="function")Y||hg(d);else if(Y){var ue=null;if(I&&I.hasAttribute("formAction")){if(M=I,Y=I[bt]||null)ue=Y.formAction;else if(jf(M)!==null)continue}else ue=Y.action;typeof ue=="function"?d[y+1]=ue:(d.splice(y,3),y-=3),hg(d)}}}function Wp(){function r(I){I.canIntercept&&I.info==="react-transition"&&I.intercept({handler:function(){return new Promise(function(Y){return M=Y})},focusReset:"manual",scroll:"manual"})}function s(){M!==null&&(M(),M=null),y||setTimeout(d,20)}function d(){if(!y&&!navigation.transition){var I=navigation.currentEntry;I&&I.url!=null&&navigation.navigate(I.url,{state:I.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,M=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(d,100),function(){y=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),M!==null&&(M(),M=null)}}}function Kp(r){this._internalRoot=r}Gf.prototype.render=Kp.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(R(409));var d=s.current,y=Os();rg(d,y,r,s,null,null)},Gf.prototype.unmount=Kp.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;rg(r.current,2,null,r,null,null),_d(),s[li]=null}};function Gf(r){this._internalRoot=r}Gf.prototype.unstable_scheduleHydration=function(r){if(r){var s=kn();r={blockedOn:null,target:r,priority:s};for(var d=0;d<Iu.length&&s!==0&&s<Iu[d].priority;d++);Iu.splice(d,0,r),d===0&&ug(r)}};var Qp=P.version;if(Qp!=="19.2.4")throw Error(R(527,Qp,"19.2.4"));mt.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(R(188)):(r=Object.keys(r).join(","),Error(R(268,r)));return r=X(s),r=r!==null?ce(r):null,r=r===null?null:r.stateNode,r};var dg={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Ke,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qf.isDisabled&&qf.supportsFiber)try{ae=qf.inject(dg),be=qf}catch{}}return rm.createRoot=function(r,s){if(!N(r))throw Error(R(299));var d=!1,y="",M=wh,I=vl,Y=xl;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(y=s.identifierPrefix),s.onUncaughtError!==void 0&&(M=s.onUncaughtError),s.onCaughtError!==void 0&&(I=s.onCaughtError),s.onRecoverableError!==void 0&&(Y=s.onRecoverableError)),s=Xp(r,1,!1,null,null,d,y,null,M,I,Y,Wp),r[li]=s.current,Pp(r),new 
9Kp(s)},rm.hydrateRoot=function(r,s,d){if(!N(r))throw Error(R(299));var y=!1,M="",I=wh,Y=vl,ue=xl,De=null;return d!=null&&(d.unstable_strictMode===!0&&(y=!0),d.identifierPrefix!==void 0&&(M=d.identifierPrefix),d.onUncaughtError!==void 0&&(I=d.onUncaughtError),d.onCaughtError!==void 0&&(Y=d.onCaughtError),d.onRecoverableError!==void 0&&(ue=d.onRecoverableError),d.formState!==void 0&&(De=d.formState)),s=Xp(r,1,!0,s,d??null,y,M,De,I,Y,ue,Wp),s.context=ng(null),d=s.current,y=Os(),y=Qi(y),M=Fo(y),M.callback=null,pl(d,M,y),d=y,s.current.lanes=d,rn(s,d),Tl(s),r[li]=s.current,Pp(r),new Gf(s)},rm.version="19.2.4",rm}var F_;function pv(){if(F_)return Yg.exports;F_=1;function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(P){console.error(P)}}return j(),Yg.exports=fv(),Yg.exports}var wy=pv();const Ai=j=>typeof j=="string",am=()=>{let j,P;const D=new Promise((R,N)=>{j=R,P=N});return D.resolve=j,D.reject=P,D},j_=j=>j==null?"":""+j,mv=(j,P,D)=>{j.forEach(R=>{P[R]&&(D[R]=P[R])})},gv=/###/g,U_=j=>j&&j.indexOf("###")>-1?j.replace(gv,"."):j,V_=j=>!j||Ai(j),lm=(j,P,D)=>{const R=Ai(P)?P.split("."):P;let N=0;for(;N<R.length-1;){if(V_(j))return{};const E=U_(R[N]);!j[E]&&D&&(j[E]=new D),Object.prototype.hasOwnProperty.call(j,E)?j=j[E]:j={},++N}return V_(j)?{}:{obj:j,k:U_(R[N])}},Z_=(j,P,D)=>{const{obj:R,k:N}=lm(j,P,Object);if(R!==void 0||P.length===1){R[N]=D;return}let E=P[P.length-1],T=P.slice(0,P.length-1),u=lm(j,T,Object);for(;u.obj===void 0&&T.length;)E=`${T[T.length-1]}.${E}`,T=T.slice(0,T.length-1),u=lm(j,T,Object),u?.obj&&typeof u.obj[`${u.k}.${E}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${E}`]=D},_v=(j,P,D,R)=>{const{obj:N,k:E}=lm(j,P,Object);N[E]=N[E]||[],N[E].push(D)},xg=(j,P)=>{const{obj:D,k:R}=lm(j,P);if(D&&Object.prototype.hasOwnProperty.call(D,R))return D[R]},yv=(j,P,D)=>{const R=xg(j,D);return R!==void 0?R:xg(P,D)},Ty=(j,P,D)=>{for(const R in P)R!=="__proto__"&&R!=="constructor"&&(R in j?Ai(j[R])||j[R]instanceof String||Ai(P[R])||P[R]instanceof String?D&&(j[R]=P[R]):Ty(j[R],P[R],D):j[R]=P[R]);return j},Yf=j=>j.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const xv=j=>Ai(j)?j.replace(/[&<>"'\/]/g,P=>vv[P]):j;class bv{constructor(P){this.capacity=P,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(P){const D=this.regExpMap.get(P);if(D!==void 0)return D;const R=new RegExp(P);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(P,R),this.regExpQueue.push(P),R}}const wv=[" ",",","?","!",";"],Tv=new bv(20),Sv=(j,P,D)=>{P=P||"",D=D||"";const R=wv.filter(T=>P.indexOf(T)<0&&D.indexOf(T)<0);if(R.length===0)return!0;const N=Tv.getRegExp(`(${R.map(T=>T==="?"?"\\?":T).join("|")})`);let E=!N.test(j);if(!E){const T=j.indexOf(D);T>0&&!N.test(j.substring(0,T))&&(E=!0)}return E},l_=(j,P,D=".")=>{if(!j)return;if(j[P])return Object.prototype.hasOwnProperty.call(j,P)?j[P]:void 0;const R=P.split(D);let N=j;for(let E=0;E<R.length;){if(!N||typeof N!="object")return;let T,u="";for(let V=E;V<R.length;++V)if(V!==E&&(u+=D),u+=R[V],T=N[u],T!==void 0){if(["string","number","boolean"].indexOf(typeof T)>-1&&V<R.length-1)continue;E+=V-E+1;break}N=T}return N},cm=j=>j?.replace("_","-"),Cv={type:"logger",log(j){this.output("log",j)},warn(j){this.output("warn",j)},error(j){this.output("error",j)},output(j,P){console?.[j]?.apply?.(console,P)}};class bg{constructor(P,D={}){this.init(P,D)}init(P,D={}){this.prefix=D.prefix||"i18next:",this.logger=P||Cv,this.options=D,this.debug=D.debug}log(...P){return this.forward(P,"log","",!0)}warn(...P){return this.forward(P,"warn","",!0)}error(...P){return this.forward(P,"error","")}deprecate(...P){return this.forward(P,"warn","WARNING DEPRECATED: ",!0)}forward(P,D,R,N){return N&&!this.debug?null:(Ai(P[0])&&(P[0]=`${R}${this.prefix} ${P[0]}`),this.logger[D](P))}create(P){return new bg(this.logger,{prefix:`${this.prefix}:${P}:`,...this.options})}clone(P){return P=P||this.options,P.prefix=P.prefix||this.prefix,new bg(this.logger,P)}}var bc=new bg;class Mg{constructor(){this.observers={}}on(P,D){return P.split(" ").forEach(R=>{this.observers[R]||(this.observers[R]=new Map);const N=this.observers[R].get(D)||0;this.observers[R].set(D,N+1)}),this}off(P,D){if(this.observers[P]){if(!D){delete this.observers[P];return}this.observers[P].delete(D)}}emit(P,...D){this.observers[P]&&Array.from(this.observers[P].entries()).forEac
9h(([N,E])=>{for(let T=0;T<E;T++)N(...D)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([N,E])=>{for(let T=0;T<E;T++)N.apply(N,[P,...D])})}}class G_ extends Mg{constructor(P,D={ns:["translation"],defaultNS:"translation"}){super(),this.data=P||{},this.options=D,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(P){this.options.ns.indexOf(P)<0&&this.options.ns.push(P)}removeNamespaces(P){const D=this.options.ns.indexOf(P);D>-1&&this.options.ns.splice(D,1)}getResource(P,D,R,N={}){const E=N.keySeparator!==void 0?N.keySeparator:this.options.keySeparator,T=N.ignoreJSONStructure!==void 0?N.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;P.indexOf(".")>-1?u=P.split("."):(u=[P,D],R&&(Array.isArray(R)?u.push(...R):Ai(R)&&E?u.push(...R.split(E)):u.push(R)));const V=xg(this.data,u);return!V&&!D&&!R&&P.indexOf(".")>-1&&(P=u[0],D=u[1],R=u.slice(2).join(".")),V||!T||!Ai(R)?V:l_(this.data?.[P]?.[D],R,E)}addResource(P,D,R,N,E={silent:!1}){const T=E.keySeparator!==void 0?E.keySeparator:this.options.keySeparator;let u=[P,D];R&&(u=u.concat(T?R.split(T):R)),P.indexOf(".")>-1&&(u=P.split("."),N=D,D=u[1]),this.addNamespaces(D),Z_(this.data,u,N),E.silent||this.emit("added",P,D,R,N)}addResources(P,D,R,N={silent:!1}){for(const E in R)(Ai(R[E])||Array.isArray(R[E]))&&this.addResource(P,D,E,R[E],{silent:!0});N.silent||this.emit("added",P,D,R)}addResourceBundle(P,D,R,N,E,T={silent:!1,skipCopy:!1}){let u=[P,D];P.indexOf(".")>-1&&(u=P.split("."),N=R,R=D,D=u[1]),this.addNamespaces(D);let V=xg(this.data,u)||{};T.skipCopy||(R=JSON.parse(JSON.stringify(R))),N?Ty(V,R,E):V={...V,...R},Z_(this.data,u,V),T.silent||this.emit("added",P,D,R)}removeResourceBundle(P,D){this.hasResourceBundle(P,D)&&delete this.data[P][D],this.removeNamespaces(D),this.emit("removed",P,D)}hasResourceBundle(P,D){return this.getResource(P,D)!==void 0}getResourceBundle(P,D){return D||(D=this.options.defaultNS),this.getResource(P,D)}getDataByLanguage(P){return this.data[P]}hasLanguageSomeTranslations(P){const D=this.getDataByLanguage(P);return!!(D&&Object.keys(D)||[]).find(N=>D[N]&&Object.keys(D[N]).length>0)}toJSON(){return this.data}}var Sy={processors:{},addPostProcessor(j){this.processors[j.name]=j},handle(j,P,D,R,N){return j.forEach(E=>{P=this.processors[E]?.process(P,D,R,N)??P}),P}};const Cy=Symbol("i18next/PATH_KEY");function Mv(){const j=[],P=Object.create(null);let D;return P.get=(R,N)=>(D?.revoke?.(),N===Cy?j:(j.push(N),D=Proxy.revocable(R,P),D.proxy)),Proxy.revocable(Object.create(null),P).proxy}function u_(j,P){const{[Cy]:D}=j(Mv());return D.join(P?.keySeparator??".")}const q_={},Jg=j=>!Ai(j)&&typeof j!="boolean"&&typeof j!="number";class wg extends Mg{constructor(P,D={}){super(),mv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
9i18nFormat","utils"],P,this),this.options=D,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=bc.create("translator")}changeLanguage(P){P&&(this.language=P)}exists(P,D={interpolation:{}}){const R={...D};if(P==null)return!1;const N=this.resolve(P,R);if(N?.res===void 0)return!1;const E=Jg(N.res);return!(R.returnObjects===!1&&E)}extractFromKey(P,D){let R=D.nsSeparator!==void 0?D.nsSeparator:this.options.nsSeparator;R===void 0&&(R=":");const N=D.keySeparator!==void 0?D.keySeparator:this.options.keySeparator;let E=D.ns||this.options.defaultNS||[];const T=R&&P.indexOf(R)>-1,u=!this.options.userDefinedKeySeparator&&!D.keySeparator&&!this.options.userDefinedNsSeparator&&!D.nsSeparator&&!Sv(P,R,N);if(T&&!u){const V=P.match(this.interpolator.nestingRegexp);if(V&&V.length>0)return{key:P,namespaces:Ai(E)?[E]:E};const X=P.split(R);(R!==N||R===N&&this.options.ns.indexOf(X[0])>-1)&&(E=X.shift()),P=X.join(N)}return{key:P,namespaces:Ai(E)?[E]:E}}translate(P,D,R){let N=typeof D=="object"?{...D}:D;if(typeof N!="object"&&this.options.overloadTranslationOptionHandler&&(N=this.options.overloadTranslationOptionHandler(arguments)),typeof N=="object"&&(N={...N}),N||(N={}),P==null)return"";typeof P=="function"&&(P=u_(P,{...this.options,...N})),Array.isArray(P)||(P=[String(P)]);const E=N.returnDetails!==void 0?N.returnDetails:this.options.returnDetails,T=N.keySeparator!==void 0?N.keySeparator:this.options.keySeparator,{key:u,namespaces:V}=this.extractFromKey(P[P.length-1],N),X=V[V.length-1];let ce=N.nsSeparator!==void 0?N.nsSeparator:this.options.nsSeparator;ce===void 0&&(ce=":");const ne=N.lng||this.language,ye=N.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(ne?.toLowerCase()==="cimode")return ye?E?{res:`${X}${ce}${u}`,usedKey:u,exactUsedKey:u,usedLng:ne,usedNS:X,usedParams:this.getUsedParamsDetails(N)}:`${X}${ce}${u}`:E?{res:u,usedKey:u,exactUsedKey:u,usedLng:ne,usedNS:X,usedParams:this.getUsedParamsDetails(N)}:u;const Se=this.resolve(P,N);let Ie=Se?.res;const Te=Se?.usedKey||u,ve=Se?.exactUsedKey||u,lt=["[object Number]","[object Function]","[object RegExp]"],Tt=N.joinArrays!==void 0?N.joinArrays:this.options.joinArrays,dt=!this.i18nFormat||this.i18nFormat.handleAsObject,Bt=N.count!==void 0&&!Ai(N.count),Vt=wg.hasDefaultValue(N),ui=Bt?this.pluralResolver.getSuffix(ne,N.count,N):"",Ft=N.ordinal&&Bt?this.pluralResolver.getSuffix(ne,N.count,{ordinal:!1}):"",vi=Bt&&!N.ordinal&&N.count===0,Kt=vi&&N[`defaultValue${this.options.pluralSeparator}zero`]||N[`defaultValue${ui}`]||N[`defaultValue${Ft}`]||N.defaultValue;let qt=Ie;dt&&!Ie&&Vt&&(qt=Kt);const Ht=Jg(qt),Xt=Object.prototype.toString.apply(qt);if(dt&&qt&&Ht&&lt.indexOf(Xt)<0&&!(Ai(Tt)&&Array.isArray(qt))){if(!N.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const si=this.options.returnedObjectHandler?this.options.returnedObjectHandler(Te,qt,{...N,ns:V}):`key '${u} (${this.language})' returned an object instead of string.`;return E?(Se.res=si,Se.usedParams=this.getUsedParamsDetails(N),Se):si}if(T){const si=Array.isArray(qt),ii=si?[]:{},Vi=si?ve:Te;for(const Ke in qt)if(Object.prototype.hasOwnProperty.call(qt,Ke)){const mt=`${Vi}${T}${Ke}`;Vt&&!Ie?ii[Ke]=this.translate(mt,{...N,defaultValue:Jg(Kt)?Kt[Ke]:void 0,joinArrays:!1,ns:V}):ii[Ke]=this.translate(mt,{...N,joinArrays:!1,ns:V}),ii[Ke]===mt&&(ii[Ke]=qt[Ke])}Ie=ii}}else if(dt&&Ai(Tt)&&Array.isArray(Ie))Ie=Ie.join(Tt),Ie&&(Ie=this.extendTranslation(Ie,P,N,R));else{let si=!1,ii=!1;!this.isValidLookup(Ie)&&Vt&&(si=!0,Ie=Kt),this.isValidLookup(Ie)||(ii=!0,Ie=u);const Ke=(N.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ii?void 0:Ie,mt=Vt&&Kt!==Ie&&this.options.updateMissing;if(ii||si||mt){if(this.logger.log(mt?"updateKey":"missingKey",ne,X,u,mt?Kt:Ie),T){const ze=this.resolve(u,{...N,keySeparator:!1});ze&&ze.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let gt=[];const Yt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,N.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Yt&&Yt[0])for(let ze=0;ze<Yt.length;ze++)gt.push(Yt[ze]);else this.options.saveMissingTo==="all"?gt=this.languageUtils.toResolveHierarchy(N.lng||this.language):gt.push(N.lng||this.language);const It=(ze,rt,Et)=>{const Pt=Vt&&Et!==Ie?Et:Ke;this.options.missingKeyHandler?this.options.missingKeyHandler(ze,X,rt,Pt,mt,N):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ze,X,rt,Pt,mt,N),this.emit
vendor: 20,003 bytes, line 9
9("missingKey",ze,X,rt,Ie)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Bt?gt.forEach(ze=>{const rt=this.pluralResolver.getSuffixes(ze,N);vi&&N[`defaultValue${this.options.pluralSeparator}zero`]&&rt.indexOf(`${this.options.pluralSeparator}zero`)<0&&rt.push(`${this.options.pluralSeparator}zero`),rt.forEach(Et=>{It([ze],u+Et,N[`defaultValue${Et}`]||Kt)})}):It(gt,u,Kt))}Ie=this.extendTranslation(Ie,P,N,Se,R),ii&&Ie===u&&this.options.appendNamespaceToMissingKey&&(Ie=`${X}${ce}${u}`),(ii||si)&&this.options.parseMissingKeyHandler&&(Ie=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${X}${ce}${u}`:u,si?Ie:void 0,N))}return E?(Se.res=Ie,Se.usedParams=this.getUsedParamsDetails(N),Se):Ie}extendTranslation(P,D,R,N,E){if(this.i18nFormat?.parse)P=this.i18nFormat.parse(P,{...this.options.interpolation.defaultVariables,...R},R.lng||this.language||N.usedLng,N.usedNS,N.usedKey,{resolved:N});else if(!R.skipInterpolation){R.interpolation&&this.interpolator.init({...R,interpolation:{...this.options.interpolation,...R.interpolation}});const V=Ai(P)&&(R?.interpolation?.skipOnVariables!==void 0?R.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let X;if(V){const ne=P.match(this.interpolator.nestingRegexp);X=ne&&ne.length}let ce=R.replace&&!Ai(R.replace)?R.replace:R;if(this.options.interpolation.defaultVariables&&(ce={...this.options.interpolation.defaultVariables,...ce}),P=this.interpolator.interpolate(P,ce,R.lng||this.language||N.usedLng,R),V){const ne=P.match(this.interpolator.nestingRegexp),ye=ne&&ne.length;X<ye&&(R.nest=!1)}!R.lng&&N&&N.res&&(R.lng=this.language||N.usedLng),R.nest!==!1&&(P=this.interpolator.nest(P,(...ne)=>E?.[0]===ne[0]&&!R.context?(this.logger.warn(`It seems you are nesting recursively key: ${ne[0]} in key: ${D[0]}`),null):this.translate(...ne,D),R)),R.interpolation&&this.interpolator.reset()}const T=R.postProcess||this.options.postProcess,u=Ai(T)?[T]:T;return P!=null&&u?.length&&R.applyPostProcessor!==!1&&(P=Sy.handle(u,P,D,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...N,usedParams:this.getUsedParamsDetails(R)},...R}:R,this)),P}resolve(P,D={}){let R,N,E,T,u;return Ai(P)&&(P=[P]),P.forEach(V=>{if(this.isValidLookup(R))return;const X=this.extractFromKey(V,D),ce=X.key;N=ce;let ne=X.namespaces;this.options.fallbackNS&&(ne=ne.concat(this.options.fallbackNS));const ye=D.count!==void 0&&!Ai(D.count),Se=ye&&!D.ordinal&&D.count===0,Ie=D.context!==void 0&&(Ai(D.context)||typeof D.context=="number")&&D.context!=="",Te=D.lngs?D.lngs:this.languageUtils.toResolveHierarchy(D.lng||this.language,D.fallbackLng);ne.forEach(ve=>{this.isValidLookup(R)||(u=ve,!q_[`${Te[0]}-${ve}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(q_[`${Te[0]}-${ve}`]=!0,this.logger.warn(`key "${N}" for languages "${Te.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),Te.forEach(lt=>{if(this.isValidLookup(R))return;T=lt;const Tt=[ce];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(Tt,ce,lt,ve,D);else{let Bt;ye&&(Bt=this.pluralResolver.getSuffix(lt,D.count,D));const Vt=`${this.options.pluralSeparator}zero`,ui=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(ye&&(D.ordinal&&Bt.indexOf(ui)===0&&Tt.push(ce+Bt.replace(ui,this.options.pluralSeparator)),Tt.push(ce+Bt),Se&&Tt.push(ce+Vt)),Ie){const Ft=`${ce}${this.options.contextSeparator||"_"}${D.context}`;Tt.push(Ft),ye&&(D.ordinal&&Bt.indexOf(ui)===0&&Tt.push(Ft+Bt.replace(ui,this.options.pluralSeparator)),Tt.push(Ft+Bt),Se&&Tt.push(Ft+Vt))}}let dt;for(;dt=Tt.pop();)this.isValidLookup(R)||(E=dt,R=this.getResource(lt,ve,dt,D))}))})}),{res:R,usedKey:N,exactUsedKey:E,usedLng:T,usedNS:u}}isValidLookup(P){return P!==void 0&&!(!this.options.returnNull&&P===null)&&!(!this.options.returnEmptyString&&P==="")}getResource(P,D,R,N={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(P,D,R,N):this.resourceStore.getResource(P,D,R,N)}getUsedParamsDetails(P={}){const D=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],R=P.replace&&!Ai(P.replace);let N=R?P.replace:P;if(R&&typeof P.count<"u"&&(N.count=P.count),this.options.interpolation.defaultVariables&&(N={...this.options.interpolation.defaultVariables,...N}),!R){N={...N};for(const E of D)delete N[E]}return N}static hasDefaultValue(P){const D="defaultValue";for(const R in P)if(Object.prototype.hasOwnProperty.call(P,R)&&D===R.substring(0,D.length)&&P[R]!==void 0)return!0;return!1}}class H_{constructor(P){this.options=P,this.supportedLngs=this.options.supportedLngs||!1,this.logger=bc.create("languageUtils")}getScriptPartFromCode(P){if(P=cm(P),!P||P.indexOf("-")<0)return null;const D=P.split("-");return D.length===2||(D.pop(),D[D.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(D.join("-"))}getLanguagePartFromCode(P){if(P=cm(P),!P||P.indexOf("-")<0)return P;const D=P.split("-");return this.formatLanguageCode(D[0])}formatLanguageCode(P){if(Ai(P)&&P.indexOf("-")>-1){let D;try{D=Intl.getCanonicalLocales(P)[0]}catch{}return D&&this.options.lowerCaseLng&&(D=D.toLowerCase()),D||(this.options.lowerCaseLng?P.toLowerCase():P)}return this.options.cleanCode||this.options.lowerCaseLng?P.toLowerCase():P}isSupportedCode(P){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(P=this.getLanguagePartFromCode(P)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(P)>-1}getBestMatchFromCodes(P){if(!P)return null;let D;return P.forEach(R=>{if(D)return;const N=this.formatLanguageCode(R);(!this.options.supportedLngs||this.isSupportedCode(N))&&(D=N)}),!D&&this.options.supportedLngs&&P.forEach(R=>{if(D)return;const N=this.getScriptPartFromCode(R);if(this.isSupportedCode(N))return D=N;const E=this.getLanguagePartFromCode(R);if(this.isSupportedCode(E))return D=E;D=this.options.supportedLngs.find(T=>{if(T===E)return T;if(!(T.indexOf("-")<0&&E.indexOf("-")<0)&&(T.indexOf("-")>0&&E.indexOf("-")<0&&T.substring(0,T.indexOf("-"))===E||T.indexOf(E)===0&&E.length>1))return T})}),D||(D=this.getFallbackCodes(this.options.fallbackLng)[0]),D}getFallbackCodes(P,D){if(!P)return[];if(typeof P=="function"&&(P=P(D)),Ai(P)&&(P=[P]),Array.isArray(P))return P;if(!D)return P.default||[];let R=P[D];return R||(R=P[this.getScriptPartFromCode(D)]),R||(R=P[this.formatLanguageCode(D)]),R||(R=P[this.getLanguagePartFromCode(D)]),R||(R=P.default),R||[]}toResolveHierarchy(P,D){const R=this.getFallbackCodes((D===!1?[]:D)||this.options.fallbackLng||[],P),N=[],E=T=>{T&&(this.isSupportedCode(T)?N.push(T):this.logger.warn(`rejecting language code not found in supportedLngs: ${T}`))};return Ai(P)&&(P.indexOf("-")>-1||P.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&E(this.formatLanguageCode(P)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&E(this.getScriptPartFromCode(P)),this.options.load!=="currentOnly"&&E(this.getLanguagePartFromCode(P))):Ai(P)&&E(this.formatLanguageCode(P)),R.forEach(T=>{N.indexOf(T)<0&&E(this.formatLanguageCode(T))}),N}}const $_={zero:0,one:1,two:2,few:3,many:4,other:5},X_={select:j=>j===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ev{constructor(P,D={}){this.languageUtils=P,this.options=D,this.logger=bc.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(P,D={}){const R=cm(P==="dev"?"en":P),N=D.ordinal?"ordinal":"cardinal",E=JSON.stringify({cleanedCode:R,type:N});if(E in this.pluralRulesCache)return this.pluralRulesCache[E];let T;try{T=new Intl.PluralRules(R,{type:N})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),X_;if(!P.match(/-|_/))return X_;const V=this.languageUtils.getLanguagePartFromCode(P);T=this.getRule(V,D)}return this.pluralRulesCache[E]=T,T}needsPlural(P,D={}){let R=this.getRule(P,D);return R||(R=this.getRule("dev",D)),R?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(P,D,R={}){return this.getSuffixes(P,R).map(N=>`${D}${N}`)}getSuffixes(P,D={}){let R=this.getRule(P,D);return R||(R=this.getRule("dev",D)),R?R.resolvedOptions().pluralCategories.sort((N,E)=>$_[N]-$_[E]).map(N=>`${this.options.prepend}${D.ordinal?`ordinal${this.options.prepend}`:""}${N}`):[]}getSuffix(P,D,R={}){const N=this.getRule(P,R);return N?`${this.options.prepend}${R.ordinal?`ordinal${this.options.prepend}`:""}${N.select(D)}`:(this.logger.warn(`no plural rule found for: ${P}`),this.getSuffix("dev",D,R))}}const Y_=(j,P,D,R=".",N=!0)=>{let E=yv(j,P,D);return!E&&N&&Ai(D)&&(E=l_(j,D,R),E===void 0&&(E=l_(P,D,R))),E},e_=j=>j.replace(/\$/g,"$$$$");class W_{constructor(P={}){this.logger=bc.create("interpolator"),this.options=P,this.format=P?.interpolation?.format||(D=>D),this.init(P)}init(P={}){P.interpolation||(P.interpolation={escapeValue:!0});const{escape:D,escapeValue:R,useRawValueToEscape:N,prefix:E,prefixEscaped:T,suffix:u,suffixEscaped:V,formatSeparator:X,unescapeSuffix:ce,unescapePrefix:ne,nestingPrefix:ye,nestingPrefixEscaped:Se,nestingSuffix:Ie,nestingSuffixEscaped:Te,nestingOptionsSeparator:ve,maxReplaces:lt,alwaysFormat:Tt}=P.interpolation;this.escape=D!==void 0?D:xv,this.escapeValue=R!==void 0?R:!0,this.useRawValueToEscape=N!==void 0?N:!1,this.prefix=E?Yf(E):T||"{{",this.suffix=u?Yf(u):V||"}}",this.formatSeparator=X||",",this.unescapePrefix=ce?"":ne||"-",this.unescapeSuffix=this.unescapePrefix?"":ce||"",this.nestingPrefix=ye?Yf(ye):Se||Yf("$t("),this.nestingSuffix=Ie?Yf(Ie):Te||Yf(")"),this.nestingOptionsSeparator=ve||",",this.maxReplaces=lt||1e3,this.alwaysFormat=Tt!==void 0?Tt:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const P=(D,R)=>D?.source===R?(D.lastIndex=0,D):new RegExp(R,"g");this.regexp=P(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=P(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=P(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(P,D,R,N){let E,T,u;const V=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},X=Se=>{if(Se.indexOf(this.formatSeparator)<0){const lt=Y_(D,V,Se,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(lt,void 0,R,{...N,...D,interpolationkey:Se}):lt}const Ie=Se.split(this.formatSeparator),Te=Ie.shift().trim(),ve=Ie.join(this.formatSeparator).trim();return this.format(Y_(D,V,Te,this.options.keySeparator,this.options.ignoreJSONStructure),ve,R,{...N,...D,interpolationkey:Te})};this.resetRegExp();const ce=N?.missingInterpolationHandler||this.options.missingInterpolationHandler,ne=N?.interpolation?.skipOnVariables!==void 0?N.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:Se=>e_(Se)},{regex:this.regexp,safeValue:Se=>this.escapeValue?e_(this.escape(Se)):e_(Se)}].forEach(Se=>{for(u=0;E=Se.regex.exec(P);){const Ie=E[1].trim();if(T=X(Ie),T===void 0)if(typeof ce=="function"){const ve=ce(P,E,N);T=Ai(ve)?ve:""}else if(N&&Object.prototype.hasOwnProperty.call(N,Ie))T="";else if(ne){T=E[0];continue}else this.logger.warn(`missed to pass in variable ${Ie} for interpolating ${P}`),T="";else!Ai(T)&&!this.useRawValueToEscape&&(T=j_(T));const Te=Se.safeValue(T);if(P=P.replace(E[0],Te),ne?(Se.regex.lastIndex+=T.length,Se.regex.lastIndex-=E[0].length):Se.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),P}nest(P,D,R={}){let N,E,T;const u=(V,X)=>{const ce=this.nestingOptionsSeparator;if(V.indexOf(ce)<0)return V;const ne=V.split(new RegExp(`${ce}[ ]*{`));let ye=`{${ne[1]}`;V=ne[0],ye=this.interpolate(ye,T);const Se=ye.match(/'/g),Ie=ye.match(/"/g);((Se?.length??0)%2===0&&!Ie||Ie.length%2!==0)&&(ye=ye.replace(/'/g,'"'));try{T=JSON.parse(ye),X&&(T={...X,...T})}catch(Te){return this.logger.warn(`failed parsing options string in nesting for key ${V}`,Te),`${V}${ce}${ye}`}return T.defaultValue&&T.defaultValue.indexOf(this.prefix)>-1&&delete T.defaultValue,V};for(;N=this.nestingRegexp.exec(P);){let V=[];T={...R},T=T.replace&&!Ai(T.replace)?T.replace:T,T.applyPostProcessor=!1,delete T.defaultValue;const X=/{.*}/.test(N[1])?N[1].lastIndexOf("}")+1:N[1].indexOf(this.formatSeparator);if(X!==-1&&(V=N[1].slice(X).split(this.formatSeparator).map(ce=>ce.trim()).filter(Boolean),N[1]=N[1].slice(0,X)),E=D(u.call(this,N[1].trim(),T),T),E&&N[0]===P&&!Ai(E))return E;Ai(E)||(E=j_(E)),E||(this.logger.warn(`missed to resolve ${N[1]} for nesting ${P}`),E=""),V.length&&(E=V.reduce((ce,ne)=>this.format(ce,ne,R.lng,{...R,interpolationkey:N[1].trim()}),E.trim())),P=P.replace(N[0],E),this.regexp.lastIndex=0}return P}}const Av=j=>{let P=j.toLowerCase().trim();const D={};if(j.indexOf("(")>-1){const R=j.split("(");P=R[0].toLowerCase().trim();const N=R[1].substring(0,R[1].length-1);P==="currency"&&N.indexOf(":")<0?D.currency||(D.currency=N.trim()):P==="relativetime"&&N.indexOf(":")<0?D.range||(D.range=N.trim()):N.split(";").forEach(T=>{if(T){const[u,...V]=T.split(":"),X=V.join(":").trim().replace(/^'+|'+$/g,""),ce=u.trim();D[ce]||(D[ce]=X),X==="false"&&(D[ce]=!1),X==="true"&&(D[ce]=!0),isNaN(X)||(D[ce]=parseInt(X,10))}})}return{formatName:P,formatOptions:D}},K_=j=>{const P={};return(D,R,N)=>{let E=N;N&&N.interpolationkey&&N.formatParams&&N.formatParams[N.interpolationkey]&&N[N.interpolationkey]&&(E={...E,[N.interpolationkey]:void 0});const T=R+JSON.stringify(E);let u=P[T];return u||(u=j(cm(R),N),P[T]=u),u(D)}},Pv=j=>(P,D,R)=>j(cm(D),R)(P);class zv{constructor(P={}){this.logger=bc.create("formatter"),this.options=P,this.init(P)}init(P,D={interpolation:{}}){this.formatSeparator=D.interpolation.formatSeparator||",";const R=D.cacheInBuiltFormats?K_:Pv;this.formats={number:R((N,E)=>{const T=new Intl.NumberFormat(N,{...E});return u=>T.format(u)}),currency:R((N,E)=>{const T=new Intl.NumberFormat(N,{...E,style:"currency"});return u=>T.format(u)}),datetime:R((N,E)=>{const T=new Intl.DateTimeFormat(N,{...E});return u=>T.format(u)}),relativetime:R((N,E)=>{const T=new Intl.RelativeTimeFormat(N,{...E});return u=>T.format(u,E.range||"day")}),list:R((N,E)=>{const T=new Intl.ListFormat(N,{...E});return u=>T.format(u)})}}add(P,D){this.formats[P.toLowerCase().trim()]=D}addCached(P,D){this.formats[P.toLowerCase().trim()]=K_(D)}format(P,D,R,N={}){const E=D.split(this.formatSeparator);if(E.length>1&&E[0].indexOf("(")>1&&E[0].indexOf(")")<0&&E.find(u=>u.indexOf(")")>-1)){const u=E.findIndex(V=>V.indexOf(")")>-1);E[0]=[E[0],...E.splice(1,u)].join(this.formatSeparator)}return E.reduce((u,V)=>{const{formatName:X,formatOptions:ce}=Av(V);if(this.formats[X]){let ne=u;try{const ye=N?.formatParams?.[N.interpolationkey]||{},Se=ye.locale||ye.lng||N.locale||N.lng||R;ne=this.formats[X](u,Se,{...ce,...N,...ye})}catch(ye){this.logger.warn(ye)}return ne}else this.logger.warn(`there was no format function for ${X}`);return u},P)}}const Lv=(j,P)=>{j.pending[P]!==void 0&&(delete j.pending[P],j.pendingCount--)};class Dv extends Mg{constructor(P,D,R,N={}){super(),this.backend=P,this.store=D,this.services=R,this.languageUtils=R.languageUtils,this.options=N,this.logger=bc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=N.maxParallelReads||10,this.readingCalls=0,this.maxRetries=N.maxRetries>=0?N.maxRetries:5,this.retryTimeout=N.retryTimeout>=1?N.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(R,N.backend,N)}queueLoad(P,D,R,N){const E={},T={},u={},V={};return P.forEach(X=>{let ce=!0;D.forEach(ne=>{const ye=`${X}|${ne}`;!R.reload&&this.store.hasResourceBundle(X,ne)?this.state[ye]=2:this.state[ye]<0||(this.state[ye]===1?T[ye]===void 0&&(T[ye]=!0):(this.state[ye]=1,ce=!1,T[ye]===void 0&&(T[ye]=!0),E[ye]===void 0&&(E[ye]=!0),V[ne]===void 0&&(V[ne]=!0)))}),ce||(u[X]=!0)}),(Object.keys(E).length||Object.keys(T).length)&&this.queue.push({pending:T,pendingCount:Object.keys(T).length,loaded:{},errors:[],callback:N}),{toLoad:Object.keys(E),pending:Object.keys(T),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(V)}}loaded(P,D,R){const N=P.split("|"),E=N[0],T=N[1];D&&this.emit("failedLoading",E,T,D),!D&&R&&this.store.addResourceBundle(E,T,R,void 0,void 0,{skipCopy:!0}),this.state[P]=D?-1:2,D&&R&&(this.state[P]=0);const u={};this.queue.forEach(V=>{_v(V.loaded,[E],T),Lv(V,P),D&&V.errors.push(D),V.pendingCount===0&&!V.done&&(Object.keys(V.loaded).forEach(X=>{u[X]||(u[X]={});const ce=V.loaded[X];ce.length&&ce.forEach(ne=>{u[X][ne]===void 0&&(u[X][ne]=!0)})}),V.done=!0,V.errors.length?V.callback(V.errors):V.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(V=>!V.done)}read(P,D,R,N=0,E=this.retryTimeout,T){if(!P.length)return T(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:P,ns:D,fcName:R,tried:N,wait:E,callback:T});return}this.readingCalls++;const u=(X,ce)=>{if(this.readingCalls--,this.waitingReads.length>0){const ne=this.waitingReads.shift();this.read(ne.lng,ne.ns,ne.fcName,ne.tried,ne.wait,ne.callback)}if(X&&ce&&N<this.maxRetries){setTimeout(()=>{this.read.call(this,P,D,R,N+1,E*2,T)},E);return}T(X,ce)},V=this.backend[R].bind(this.backend);if(V.length===2){try{const X=V(P,D);X&&typeof X.then=="function"?X.then(ce=>u(null,ce)).catch(u):u(null,X)}catch(X){u(X)}return}return V(P,D,u)}prepareLoading(P,D,R={},N){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),N&&N();Ai(P)&&(P=this.languageUtils.toResolveHierarchy(P)),Ai(D)&&(D=[D]);const E=this.queueLoad(P,D,R,N);if(!E.toLoad.length)return E.pending.length||N(),null;E.toLoad.forEach(T=>{this.loadOne(T)})}load(P,D,R){this.prepareLoading(P,D,{},R)}reload(P,D,R){this.prepareLoading(P,D,{reload:!0},R)}loadOne(P,D=""){const R=P.split("|"),N=R[0],E=R[1];this.read(N,E,"read",void 0,void 0,(T,u)=>{T&&this.logger.warn(`${D}loading namespace ${E} for language ${N} failed`,T),!T&&u&&this.logger.log(`${D}loaded namespace ${E} for language ${N}`,u),this.loaded(P,T,u)})}saveMissing(P,D,R,N,E,T={},u=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(D)){this.logger.warn(`did not save key "${R}" as the namespace "${D}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(R==null||R==="")){if(this.backend?.create){const V={...T,isUpdate:E},X=this.backend.create.bind(this.backend);if(X.length<6)try{let ce;X.length===5?ce=X(P,D,R,N,V):ce=X(P,D,R,N),ce&&typeof ce.then=="function"?ce.then(ne=>u(null,ne)).catch(u):u(null,ce)}catch(ce){u(ce)}else X(P,D,R,N,u,V)}!P||!P[0]||this.store.addResource(P[0],D,R,N)}}}const t_=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:j=>{let P={};if(typeof j[1]=="object"&&(P=j[1]),Ai(j[1])&&(P.defaultValue=j[1]),Ai(j[2])&&(P.tDescription=j[2]),typeof j[2]=="object"||typeof j[3]=="object"){const D=j[3]||j[2];
9Object.keys(D).forEach(R=>{P[R]=D[R]})}return P},interpolation:{escapeValue:!0,format:j=>j,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Q_=j=>(Ai(j.ns)&&(j.ns=[j.ns]),Ai(j.fallbackLng)&&(j.fallbackLng=[j.fallbackLng]),Ai(j.fallbackNS)&&(j.fallbackNS=[j.fallbackNS]),j.supportedLngs?.indexOf?.("cimode")<0&&(j.supportedLngs=j.supportedLngs.concat(["cimode"])),typeof j.initImmediate=="boolean"&&(j.initAsync=j.initImmediate),j),mg=()=>{},Iv=j=>{Object.getOwnPropertyNames(Object.getPrototypeOf(j)).forEach(D=>{typeof j[D]=="function"&&(j[D]=j[D].bind(j))})},kv=j=>!!(j?.modules?.backend?.name?.indexOf("Locize")>0||j?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||j?.options?.backend?.backends&&j.options.backend.backends.some(P=>P?.name?.indexOf("Locize")>0||P?.constructor?.name?.indexOf("Locize")>0));class um extends Mg{constructor(P={},D){if(super(),this.options=Q_(P),this.services={},this.logger=bc,this.modules={external:[]},Iv(this),D&&!this.isInitialized&&!P.isClone){if(!this.options.initAsync)return this.init(P,D),this;setTimeout(()=>{this.init(P,D)},0)}}init(P={},D){this.isInitializing=!0,typeof P=="function"&&(D=P,P={}),P.defaultNS==null&&P.ns&&(Ai(P.ns)?P.defaultNS=P.ns:P.ns.indexOf("translation")<0&&(P.defaultNS=P.ns[0]));const R=t_();this.options={...R,...this.options,...Q_(P)},this.options.interpolation={...R.interpolation,...this.options.interpolation},P.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=P.keySeparator),P.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=P.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=R.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!kv(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const N=X=>X?typeof X=="function"?new X:X:null;if(!this.options.isClone){this.modules.logger?bc.init(N(this.modules.logger),this.options):bc.init(null,this.options);let X;this.modules.formatter?X=this.modules.formatter:X=zv;const ce=new H_(this.options);this.store=new G_(this.options.resources,this.options);const ne=this.services;ne.logger=bc,ne.resourceStore=this.store,ne.languageUtils=ce,ne.pluralResolver=new Ev(ce,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==R.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),X&&(!this.options.interpolation.format||this.options.interpolation.format===R.interpolation.format)&&(ne.formatter=N(X),ne.formatter.init&&ne.formatter.init(ne,this.options),this.options.interpolation.format=ne.formatter.format.bind(ne.formatter)),ne.interpolator=new W_(this.options),ne.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},ne.backendConnector=new Dv(N(this.modules.backend),ne.resourceStore,ne,this.options),ne.backendConnector.on("*",(Se,...Ie)=>{this.emit(Se,...Ie)}),this.modules.languageDetector&&(ne.languageDetector=N(this.modules.languageDetector),ne.languageDetector.init&&ne.languageDetector.init(ne,this.options.detection,this.options)),this.modules.i18nFormat&&(ne.i18nFormat=N(this.modules.i18nFormat),ne.i18nFormat.init&&ne.i18nFormat.init(this)),this.translator=new wg(this.services,this.options),this.translator.on("*",(Se,...Ie)=>{this.emit(Se,...Ie)}),this.modules.external.forEach(Se=>{Se.init&&Se.init(this)})}if(this.format=this.options.interpolation.format,D||(D=mg),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const X=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);X.length>0&&X[0]!=="dev"&&(this.options.lng=X[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(X=>{this[X]=(...ce)=>this.store[X](...ce)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(X=>{this[X]=(...ce)=>(this.store[X](...ce),this)});const u=am(),V=()=>{const X=(ce,ne)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit
9("initialized",this.options),u.resolve(ne),D(ce,ne)};if(this.languages&&!this.isInitialized)return X(null,this.t.bind(this));this.changeLanguage(this.options.lng,X)};return this.options.resources||!this.options.initAsync?V():setTimeout(V,0),u}loadResources(P,D=mg){let R=D;const N=Ai(P)?P:this.language;if(typeof P=="function"&&(R=P),!this.options.resources||this.options.partialBundledLanguages){if(N?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return R();const E=[],T=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(X=>{X!=="cimode"&&E.indexOf(X)<0&&E.push(X)})};N?T(N):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(V=>T(V)),this.options.preload?.forEach?.(u=>T(u)),this.services.backendConnector.load(E,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),R(u)})}else R(null)}reloadResources(P,D,R){const N=am();return typeof P=="function"&&(R=P,P=void 0),typeof D=="function"&&(R=D,D=void 0),P||(P=this.languages),D||(D=this.options.ns),R||(R=mg),this.services.backendConnector.reload(P,D,E=>{N.resolve(),R(E)}),N}use(P){if(!P)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!P.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return P.type==="backend"&&(this.modules.backend=P),(P.type==="logger"||P.log&&P.warn&&P.error)&&(this.modules.logger=P),P.type==="languageDetector"&&(this.modules.languageDetector=P),P.type==="i18nFormat"&&(this.modules.i18nFormat=P),P.type==="postProcessor"&&Sy.addPostProcessor(P),P.type==="formatter"&&(this.modules.formatter=P),P.type==="3rdParty"&&this.modules.external.push(P),this}setResolvedLanguage(P){if(!(!P||!this.languages)&&!(["cimode","dev"].indexOf(P)>-1)){for(let D=0;D<this.languages.length;D++){const R=this.languages[D];if(!(["cimode","dev"].indexOf(R)>-1)&&this.store.hasLanguageSomeTranslations(R)){this.resolvedLanguage=R;break}}!this.resolvedLanguage&&this.languages.indexOf(P)<0&&this.store.hasLanguageSomeTranslations(P)&&(this.resolvedLanguage=P,this.languages.unshift(P))}}changeLanguage(P,D){this.isLanguageChangingTo=P;const R=am();this.emit("languageChanging",P);const N=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},E=(u,V)=>{V?this.isLanguageChangingTo===P&&(N(V),this.translator.changeLanguage(V),this.isLanguageChangingTo=void 0,this.emit("languageChanged",V),this.logger.log("languageChanged",V)):this.isLanguageChangingTo=void 0,R.resolve((...X)=>this.t(...X)),D&&D(u,(...X)=>this.t(...X))},T=u=>{!P&&!u&&this.services.languageDetector&&(u=[]);const V=Ai(u)?u:u&&u[0],X=this.store.hasLanguageSomeTranslations(V)?V:this.services.languageUtils.getBestMatchFromCodes(Ai(u)?[u]:u);X&&(this.language||N(X),this.translator.language||this.translator.changeLanguage(X),this.services.languageDetector?.cacheUserLanguage?.(X)),this.loadResources(X,ce=>{E(ce,X)})};return!P&&this.services.languageDetector&&!this.services.languageDetector.async?T(this.services.languageDetector.detect()):!P&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(T):this.services.languageDetector.detect(T):T(P),R}getFixedT(P,D,R){const N=(E,T,...u)=>{let V;typeof T!="object"?V=this.options.overloadTranslationOptionHandler([E,T].concat(u)):V={...T},V.lng=V.lng||N.lng,V.lngs=V.lngs||N.lngs,V.ns=V.ns||N.ns,V.keyPrefix!==""&&(V.keyPrefix=V.keyPrefix||R||N.keyPrefix);const X=this.options.keySeparator||".";let ce;return V.keyPrefix&&Array.isArray(E)?ce=E.map(ne=>(typeof ne=="function"&&(ne=u_(ne,{...this.options,...T})),`${V.keyPrefix}${X}${ne}`)):(typeof E=="function"&&(E=u_(E,{...this.options,...T})),ce=V.keyPrefix?`${V.keyPrefix}${X}${E}`:E),this.t(ce,V)};return Ai(P)?N.lng=P:N.lngs=P,N.ns=D,N.keyPrefix=R,N}t(...P){return this.translator?.translate(...P)}exists(...P){return this.translator?.exists(...P)}setDefaultNamespace(P){this.options.defaultNS=P}hasLoadedNamespace(P,D={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
9if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const R=D.lng||this.resolvedLanguage||this.languages[0],N=this.options?this.options.fallbackLng:!1,E=this.languages[this.languages.length-1];if(R.toLowerCase()==="cimode")return!0;const T=(u,V)=>{const X=this.services.backendConnector.state[`${u}|${V}`];return X===-1||X===0||X===2};if(D.precheck){const u=D.precheck(this,T);if(u!==void 0)return u}return!!(this.hasResourceBundle(R,P)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||T(R,P)&&(!N||T(E,P)))}loadNamespaces(P,D){const R=am();return this.options.ns?(Ai(P)&&(P=[P]),P.forEach(N=>{this.options.ns.indexOf(N)<0&&this.options.ns.push(N)}),this.loadResources(N=>{R.resolve(),D&&D(N)}),R):(D&&D(),Promise.resolve())}loadLanguages(P,D){const R=am();Ai(P)&&(P=[P]);const N=this.options.preload||[],E=P.filter(T=>N.indexOf(T)<0&&this.services.languageUtils.isSupportedCode(T));return E.length?(this.options.preload=N.concat(E),this.loadResources(T=>{R.resolve(),D&&D(T)}),R):(D&&D(),Promise.resolve())}dir(P){if(P||(P=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!P)return"rtl";try{const N=new Intl.Locale(P);if(N&&N.getTextInfo){const E=N.getTextInfo();if(E&&E.direction)return E.direction}}catch{}const D=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],R=this.services?.languageUtils||new H_(t_());return P.toLowerCase().indexOf("-latn")>1?"ltr":D.indexOf(R.getLanguagePartFromCode(P))>-1||P.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(P={},D){const R=new um(P,D);return R.createInstance=um.createInstance,R}cloneInstance(P={},D=mg){const R=P.forkResourceStore;R&&delete P.forkResourceStore;const N={...this.options,...P,isClone:!0},E=new um(N);if((P.debug!==void 0||P.prefix!==void 0)&&(E.logger=E.logger.clone(P)),["store","services","language"].forEach(u=>{E[u]=this[u]}),E.services={...this.services},E.services.utils={hasLoadedNamespace:E.hasLoadedNamespace.bind(E)},R){const u=Object.keys(this.store.data).reduce((V,X)=>(V[X]={...this.store.data[X]},V[X]=Object.keys(V[X]).reduce((ce,ne)=>(ce[ne]={...V[X][ne]}
9,ce),V[X]),V),{});E.store=new G_(u,N),E.services.resourceStore=E.store}if(P.interpolation){const V={...t_().interpolation,...this.options.interpolation,...P.interpolation},X={...N,interpolation:V};E.services.interpolator=new W_(X)}return E.translator=new wg(E.services,N),E.translator.on("*",(u,...V)=>{E.emit(u,...V)}),E.init(N,D),E.translator.options=N,E.translator.backendConnector.services.utils={hasLoadedNamespace:E.hasLoadedNamespace.bind(E)},E}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const po=um.createInstance();po.createInstance;po.dir;po.init;po.loadResources;po.reloadResources;po.use;po.changeLanguage;po.getFixedT;po.t;po.exists;po.setDefaultNamespace;po.hasLoadedNamespace;po.loadNamespaces;po.loadLanguages;const Rv=(j,P,D,R)=>{const N=[D,{code:P,...R||{}}];if(j?.services?.logger?.forward)return j.services.logger.forward(N,"warn","react-i18next::",!0);Zd(N[0])&&(N[0]=`react-i18next:: ${N[0]}`),j?.services?.logger?.warn?j.services.logger.warn(...N):console?.warn&&console.warn(...N)},J_={},My=(j,P,D,R)=>{Zd(D)&&J_[D]||(Zd(D)&&(J_[D]=new Date),Rv(j,P,D,R))},Ey=(j,P)=>()=>{if(j.isInitialized)P();else{const D=()=>{setTimeout(()=>{j.off("initialized",D)},0),P()};j.on("initialized",D)}},c_=(j,P,D)=>{j.loadNamespaces(P,Ey(j,D))},ey=(j,P,D,R)=>{if(Zd(D)&&(D=[D]),j.options.preload&&j.options.preload.indexOf(P)>-1)return c_(j,D,R);D.forEach(N=>{j.options.ns.indexOf(N)<0&&j.options.ns.push(N)}),j.loadLanguages(P,Ey(j,R))},Ov=(j,P,D={})=>!P.languages||!P.languages.length?(My(P,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:P.languages}),!0):P.hasLoadedNamespace(j,{lng:D.lng,precheck:(R,N)=>{if(D.bindI18n&&D.bindI18n.indexOf("languageChanging")>-1&&R.services.backendConnector.backend&&R.isLanguageChangingTo&&!N(R.isLanguageChangingTo,j))return!1}}),Zd=j=>typeof j=="string",Bv=j=>typeof j=="object"&&j!==null,Nv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Fv={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},jv=j=>Fv[j],Uv=j=>j.replace(Nv,jv);let h_={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Uv,transDefaultProps:void 0};const Vv=(j={})=>{h_={...h_,...j}},Zv=()=>h_;let Ay;const Gv=j=>{Ay=j},qv=()=>Ay,Hv={type:"3rdParty",init(j){Vv(j.options.react),Gv(j)}},$v=Qe.createContext();class Xv{constructor(){this.usedNamespaces={}}addUsedNamespaces(P){P.forEach(D=>{this.usedNamespaces[D]||(this.usedNamespaces[D]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var i_={exports:{}},n_={};var ty;function Yv(){if(ty)return n_;ty=1;var j=Cg();function P(ne,ye){return ne===ye&&(ne!==0||1/ne===1/ye)||ne!==ne&&ye!==ye}var D=typeof Object.is=="function"?Object.is:P,R=j.useState,N=j.useEffect,E=j.useLayoutEffect,T=j.useDebugValue;function u(ne,ye){var Se=ye(),Ie=R({inst:{value:Se,getSnapshot:ye}}),Te=Ie[0].inst,ve=Ie[1];return E(function(){Te.value=Se,Te.getSnapshot=ye,V(Te)&&ve({inst:Te})},[ne,Se,ye]),N(function(){return V(Te)&&ve({inst:Te}),ne(function(){V(Te)&&ve({inst:Te})})},[ne]),T(Se),Se}function V(ne){var ye=ne.getSnapshot;ne=ne.value;try{var Se=ye();return!D(ne,Se)}catch{return!0}}function X(ne,ye){return ye()}var ce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?X:u;return n_.useSyncExternalStore=j.useSyncExternalStore!==void 0?j.useSyncExternalStore:ce,n_}var iy;
9function Wv(){return iy||(iy=1,i_.exports=Yv()),i_.exports}var Kv=Wv();const Qv=(j,P)=>Zd(P)?P:Bv(P)&&Zd(P.defaultValue)?P.defaultValue:Array.isArray(j)?j[j.length-1]:j,Jv={t:Qv,ready:!1},e0=()=>()=>{},qa=(j,P={})=>{const{i18n:D}=P,{i18n:R,defaultNS:N}=Qe.useContext($v)||{},E=D||R||qv();E&&!E.reportNamespaces&&(E.reportNamespaces=new Xv),E||My(E,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const T=Qe.useMemo(()=>({...Zv(),...E?.options?.react,...P}),[E,P]),{useSuspense:u,keyPrefix:V}=T,X=N||E?.options?.defaultNS,ce=Zd(X)?[X]:X||["translation"],ne=Qe.useMemo(()=>ce,ce);E?.reportNamespaces?.addUsedNamespaces?.(ne);const ye=Qe.useRef(0),Se=Qe.useCallback(Kt=>{if(!E)return e0;const{bindI18n:qt,bindI18nStore:Ht}=T,Xt=()=>{ye.current+=1,Kt()};return qt&&E.on(qt,Xt),Ht&&E.store.on(Ht,Xt),()=>{qt&&qt.split(" ").forEach(si=>E.off(si,Xt)),Ht&&Ht.split(" ").forEach(si=>E.store.off(si,Xt))}},[E,T]),Ie=Qe.useRef(),Te=Qe.useCallback(()=>{if(!E)return Jv;const Kt=!!(E.isInitialized||E.initializedStoreOnce)&&ne.every(Vi=>Ov(Vi,E,T)),qt=P.lng||E.language,Ht=ye.current,Xt=Ie.current;if(Xt&&Xt.ready===Kt&&Xt.lng===qt&&Xt.keyPrefix===V&&Xt.revision===Ht)return Xt;const ii={t:E.getFixedT(qt,T.nsMode==="fallback"?ne:ne[0],V),ready:Kt,lng:qt,keyPrefix:V,revision:Ht};return Ie.current=ii,ii},[E,ne,V,T,P.lng]),[ve,lt]=Qe.useState(0),{t:Tt,ready:dt}=Kv.useSyncExternalStore(Se,Te,Te);Qe.useEffect(()=>{if(E&&!dt&&!u){const Kt=()=>lt(qt=>qt+1);P.lng?ey(E,P.lng,ne,Kt):c_(E,ne,Kt)}},[E,P.lng,ne,dt,u,ve]);const Bt=E||{},Vt=Qe.useRef(null),ui=Qe.useRef(),Ft=Kt=>{const qt=Object.getOwnPropertyDescriptors(Kt);qt.__original&&delete qt.__original;const Ht=Object.create(Object.getPrototypeOf(Kt),qt);if(!Object.prototype.hasOwnProperty.call(Ht,"__original"))try{Object.defineProperty(Ht,"__original",{value:Kt,writable:!1,enumerable:!1,configurable:!1})}catch{}return Ht},vi=Qe.useMemo(()=>{const Kt=Bt,qt=Kt?.language;let Ht=Kt;Kt&&(Vt.current&&Vt.current.__original===Kt?ui.current!==qt?(Ht=Ft(Kt),Vt.current=Ht,ui.current=qt):Ht=Vt.current:(Ht=Ft(Kt),Vt.current=Ht,ui.current=qt));const Xt=[Tt,Ht,dt];return Xt.t=Tt,Xt.i18n=Ht,Xt.ready=dt,Xt},[Tt,Bt,dt,Bt.resolvedLanguage,Bt.language,Bt.languages]);if(E&&u&&!dt)throw new Promise(Kt=>{const qt=()=>Kt();P.lng?ey(E,P.lng,ne,qt):c_(E,ne,qt)});return vi},{slice:t0,forEach:i0}=[];function n0(j){return i0.call(t0.call(arguments,1),P=>{if(P)for(const D in P)j[D]===void 0&&(j[D]=P[D])}),j}
9function r0(j){return typeof j!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(D=>D.test(j))}const ny=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,a0=function(j,P){const R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},N=encodeURIComponent(P);let E=`${j}=${N}`;if(R.maxAge>0){const T=R.maxAge-0;if(Number.isNaN(T))throw new Error("maxAge should be a Number");E+=`; Max-Age=${Math.floor(T)}`}if(R.domain){if(!ny.test(R.domain))throw new TypeError("option domain is invalid");E+=`; Domain=${R.domain}`}if(R.path){if(!ny.test(R.path))throw new TypeError("option path is invalid");E+=`; Path=${R.path}`}if(R.expires){if(typeof R.expires.toUTCString!="function")throw new TypeError("option expires is invalid");E+=`; Expires=${R.expires.toUTCString()}`}if(R.httpOnly&&(E+="; HttpOnly"),R.secure&&(E+="; Secure"),R.sameSite)switch(typeof R.sameSite=="string"?R.sameSite.toLowerCase():R.sameSite){case!0:E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"strict":E+="; SameSite=Strict";break;case"none":E+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return R.partitioned&&(E+="; Partitioned"),E},ry={create(j,P,D,R){let N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};D&&(N.expires=new Date,N.expires.setTime(N.expires.getTime()+D*60*1e3)),R&&(N.domain=R),document.cookie=a0(j,P,N)},read(j){const P=`${j}=`,D=document.cookie.split(";");for(let R=0;R<D.length;R++){let N=D[R];for(;N.charAt(0)===" ";)N=N.substring(1,N.length);if(N.indexOf(P)===0)return N.substring(P.length,N.length)}return null},remove(j,P){this.create(j,"",-1,P)}};var s0={name:"cookie",lookup(j){let{lookupCookie:P}=j;if(P&&typeof document<"u")return ry.read(P)||void 0},cacheUserLanguage(j,P){let{lookupCookie:D,cookieMinutes:R,cookieDomain:N,cookieOptions:E}=P;D&&typeof document<"u"&&ry.create(D,j,R,N,E)}},o0={name:"querystring",lookup(j){let{lookupQuerystring:P}=j,D;if(typeof window<"u"){let{search:R}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(R=window.location.hash.substring(window.location.hash.indexOf("?")));const E=R.substring(1).split("&");for(let T=0;T<E.length;T++){const u=E[T].indexOf("=");u>0&&E[T].substring(0,u)===P&&(D=E[T].substring(u+1))}}return D}},l0={name:"hash",lookup(j){let{lookupHash:P,lookupFromHashIndex:D}=j,R;if(typeof window<"u"){const{hash:N}=window.location;if(N&&N.length>2){const E=N.substring(1);if(P){const T=E.split("&");for(let u=0;u<T.length;u++){const V=T[u].indexOf("=");V>0&&T[u].substring(0,V)===P&&(R=T[u].substring(V+1))}}if(R)return R;if(!R&&D>-1){const T=N.match(/\/([a-zA-Z-]*)/g);return Array.isArray(T)?T[typeof D=="number"?D:0]?.replace("/",""):void 0}}}return R}};let Wf=null;const ay=()=>{if(Wf!==null)return Wf;try{if(Wf=typeof window<"u"&&window.localStorage!==null,!Wf)return!1;const j="i18next.translate.boo";window.localStorage.setItem(j,"foo"),window.localStorage.removeItem(j)}catch{Wf=!1}return Wf};var u0={name:"localStorage",lookup(j){let{lookupLocalStorage:P}=j;if(P&&ay())return window.localStorage.getItem(P)||void 0},cacheUserLanguage(j,P){let{lookupLocalStorage:D}=P;D&&ay()&&window.localStorage.setItem(D,j)}};let Kf=null;const sy=()=>{if(Kf!==null)return Kf;try{if(Kf=typeof window<"u"&&window.sessionStorage!==null,!Kf)return!1;const j="i18next.translate.boo";window.sessionStorage.setItem(j,"foo"),window.sessionStorage.removeItem(j)}catch{Kf=!1}return Kf};var c0={name:"sessionStorage",lookup(j){let{lookupSessionStorage:P}=j;if(P&&sy())return window.sessionStorage.getItem(P)||void 0},cacheUserLanguage(j,P){let{lookupSessionStorage:D}=P;D&&sy()&&window.sessionStorage.setItem(D,j)}},h0={name:"navigator",lookup(j){const P=[];if(typeof navigator<"u"){const{languages:D,userLanguage:R,language:N}=navigator;if(D)for(let E=0;E<D.length;E++)P.push(D[E]);R&&P.push(R),N&&P.push(N)}return P.length>0?P:void 0}},d0={name:"htmlTag",lookup(j){let{htmlTag:P}=j,D;const R=P||(typeof document<"u"?document.documentElement:null);return R&&typeof R.getAttribute=="function"&&(D=R.getAttribute("lang")),D}},f0={name:"path",lookup(j){let{lookupFromPathIndex:P}=j;if(typeof window>"u")return;const D=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(D)?D[typeof P=="number"?P:0]?.replace("/",""):void 0}},p0={name:"subdomain",lookup(j){let{lookupFromSubdomainIndex:P}=j;const D=typeof P=="number"?P+1:1,R=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(R)return R[D]}};let Py=!1;try{document.cookie,Py=!0}catch{}const zy=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Py||zy.splice(1,1);const m0=()=>({order:zy,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:j=>j});class Ly{constructor(P){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(P,D)}init(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=P,this.options=n0(D,this.options||{},m0()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=N=>N.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=R,this.addDetector(s0),this.addDetector(o0),this.addDetector(u0),this.addDetector(c0),this.addDetector(h0),this.addDetector(d0),this.addDetector(f0),this.addDetector(p0),this.addDetector(l0)}addDetector(P){return this.detectors[P.name]=P,this}detect(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,D=[];return P.forEach(R=>{if(this.detectors[R]){let N=this.detectors[R].lookup(this.options);N&&typeof N=="string"&&(N=[N]),N&&(D=D.concat(N))}}),D=D.filter(R=>R!=null&&!r0(R)).map(R=>this.options.convertDetectedLanguage(R)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?D:D.length>0?D[0]:null}
9cacheUserLanguage(P){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;D&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(P)>-1||D.forEach(R=>{this.detectors[R]&&this.detectors[R].cacheUserLanguage(P,this.options)}))}}Ly.type="languageDetector";const g0={title:"Kirschblüten-Finder Stadt Zürich",subtitle:"Finde Kirschblütenbäume in der Stadt Zürich",bloomInfo:"Kirschblütenzeit in der Stadt Zürich: Ende März bis Mitte April"},_0={title:"Arten filtern",selectAll:"Alle auswählen",deselectAll:"Alle abwählen",treeCount:"{{count}} Bäume",totalTrees:"{{count}} Bäume auf der Karte"},y0={title:"Nächste Bäume",findNearest:"Meinen Standort verwenden",stopLocation:"Standort deaktivieren",distance:"{{distance}} m entfernt",noLocation:"Standort nicht verfügbar",loading:"Standort wird ermittelt...",showOnMap:"Auf Karte zeigen",navigate:"Hierher navigieren"},v0={title:"Spazierwege",showRoute:"Route anzeigen",startWalk:"Spaziergang starten",clearRoute:"Route entfernen",endWalk:"Spaziergang beenden",trees:"{{count}} Bäume",length:"ca. {{length}} Min. Gehweg",distance:"{{distance}} m",navigateTransit:"Anfahrt planen",start:"Start",end:"Ziel",sortPopular:"Beliebteste",sortNearby:"In meiner Nähe",sortTrees:"Viele Bäume"},x0={species:"Art",location:"Standort",planted:"Gepflanzt",crownDiameter:"Kronendurchmesser",meters:"{{value}} m",navigate:"Hierher navigieren",category:"Kategorie"},b0={active:"Kirschblütenzeit! Die Bäume blühen jetzt.",countdown:"Noch {{days}} Tage bis zur Kirschblüte",countdownSpecies:"Noch {{days}} Tage — {{species}} blüht als Erste",after:"Noch {{days}} Tage bis zur nächsten Kirschblüte",showBlooming:"Nur blühende",showAll:"Alle zeigen",timeline:"Blühkalender",bloomingNow:"Blüht",inDays:"In {{days}} T.",addToCalendar:"Erinnerung setzen",downloadICS:"Kalenderdatei (.ics) laden",googleCalendar:"Google Kalender",reminderTitle:"Kirschblütenzeit Stadt Zürich",reminderDescription:"Die Kirschblütenzeit beginnt in der Stadt Zürich! Zeit, die blühenden Bäume zu besuchen."},w0={share:"Teilen",copyLink:"Link kopieren",copied:"Kopiert!"},T0={title:"Kartenstil",light:"Light Base Map",color:"Karte farbig",grey:"Karte grau",satellite:"Luftbild"},S0={title:"Kirschblüten-Finder Stadt Zürich",subtitle:"Entdecke über 1'400 Kirschblütenbäume in der Stadt Zürich",trees:"Bäume",species:"Arten",routes:"Spazierwege",explore:"Karte entdecken"},C0={activeWalk:"Aktiver Spaziergang",openMaps:"Navigation",endWalk:"Beenden",distance:"{{km}} km"},M0={explore:"Entdecken"},E0={title:"Entdecken",quartettTitle:"Kirschblüten-Quartett",quartettIntro:"Superlative unter Zürichs Kirschblütenbäumen",allCity:"Ganze Stadt Zürich",noTreesInKreis:"Keine Kirschbäume in diesem Kreis",oldest:"Ältester Baum",youngest:"Jüngster Baum",biggest:"Grösste Krone",smallest:"Kleinste Krone",loneliest:"Einsamster Baum",topQuartier:"Meiste Bäume",rareSpecies:"Seltenste Art",planted:"Gepflanzt",crown:"Krone",trees:"Bäume",bingoTitle:"Kirschblüten-Bingo",bingoSpecies:"Arten entdecken",bingoRoutes:"Spazierwege",bingoSpecial:"Challenges",seeSpecies:"{{species}} entdecken",walkRoute:"{{route}} laufen",fiveSpecies:"5 Arten besucht",allSpecies:"Alle Arten besucht",threeRoutes:"3 Routen gelaufen",allRoutes:"Alle Routen gelaufen",takePhoto:"Foto gemacht",shareApp:"App geteilt",bingoReset:"Zurücksetzen"},A0={dataSource:"Daten: Stadt Zürich, Grün Stadt Zürich (CC-0)",impressum:"Impressum",imageTerms:"Bild-Upload AGB",shareApp:"App teilen"},P0={communityPhotos:"Community-Fotos",addPhoto:"Foto hinzufügen",uploading:"Wird hochgeladen...",uploadSuccess:"Hochgeladen! Wird nach Prüfung angezeigt.",uploadError:"Fehler beim Hochladen",tooLarge:"Bild zu gross (max. 10 MB)",invalidType:"Nur Bilder erlaubt",pendingReview:"Wird geprüft"},z0={title:"Kirschblüten-Finder Zürich",text:"Über 1'400 Kirschblütenbäume in Zürich entdecken — Spazierwege, Blühkalender & mehr. Perfekt für den Frühling!"},L0={title:"Impressum",operator:"Betreiberin",developer:"Entwicklerin",howBuilt:"Über Design und AI",contact:"Kontakt",version:"Version",dataCredits:"Daten & Quellen",treeData:"Baumdaten",treeDataDesc:"Stadt Zürich / Grün Stadt Zürich — Baumkataster, Open Data (CC-0 Lizenz)",basemap:"Kartendaten",basemapDesc:"swisstopo — Light Base Map (Vektor-Kacheln)",rout
9ing:"Routing",routingDesc:"OSRM — Open Source Routing Machine (Fussgänger-Routing)"},D0={app:g0,filter:_0,nearest:y0,routes:v0,popup:x0,bloom:b0,share:w0,layers:T0,onboarding:S0,walk:C0,sidebar:M0,entdecken:E0,footer:A0,photos:P0,shareApp:z0,impressum:L0},I0={title:"Cherry Blossom Finder City of Zurich",subtitle:"Find cherry blossom trees in the City of Zurich",bloomInfo:"Cherry blossom season in the City of Zurich: late March to mid-April"},k0={title:"Filter Species",selectAll:"Select all",deselectAll:"Deselect all",treeCount:"{{count}} trees",totalTrees:"{{count}} trees on map"},R0={title:"Nearest Trees",findNearest:"Use my location",stopLocation:"Stop location",distance:"{{distance}} m away",noLocation:"Location not available",loading:"Finding your location...",showOnMap:"Show on map",navigate:"Navigate here"},O0={title:"Walking Routes",showRoute:"Show route",startWalk:"Start Walk",clearRoute:"Clear route",endWalk:"End Walk",trees:"{{count}} trees",length:"~{{length}} min walk",distance:"{{distance}} m",navigateTransit:"Get directions",start:"Start",end:"End",sortPopular:"Most Popular",sortNearby:"Near Me",sortTrees:"Most Trees"},B0={species:"Species",location:"Location",planted:"Planted",crownDiameter:"Crown diameter",meters:"{{value}} m",navigate:"Navigate here",category:"Category"},N0={active:"Cherry blossom season! The trees are blooming now.",countdown:"{{days}} days until cherry blossom season",countdownSpecies:"{{days}} days — {{species}} blooms first",after:"{{days}} days until next cherry blossom season",showBlooming:"Show blooming",showAll:"Show all",timeline:"Bloom Calendar",bloomingNow:"Blooming",inDays:"In {{days}} d.",addToCalendar:"Set reminder",downloadICS:"Download calendar file (.ics)",googleCalendar:"Google Calendar",reminderTitle:"Cherry Blossom Season City of Zurich",reminderDescription:"Cherry blossom season starts in the City of Zurich! Time to visit the blooming trees."},F0={share:"Share",copyLink:"Copy link",copied:"Copied!"},j0={title:"Map style",light:"Light Base Map",color:"Color map",grey:"Grey map",satellite:"Satellite"},U0={title:"Cherry Blossom Finder City of Zurich",subtitle:"Discover over 1,400 cherry blossom trees across the City of Zurich",trees:"Trees",species:"Species",routes:"Walking Routes",explore:"Explore Map"},V0={activeWalk:"Active Walk",openMaps:"Navigate",endWalk:"End Walk",distance:"{{km}} km"},Z0={explore:"Explore"},G0={title:"Discover",quartettTitle:"Cherry Blossom Quartett",quartettIntro:"Superlatives among Zurich's cherry blossom trees",allCity:"All of Zurich",noTreesInKreis:"No cherry trees in this district",oldest:"Oldest Tree",youngest:"Youngest Tree",biggest:"Biggest Crown",smallest:"Smallest Crown",loneliest:"Loneliest Tree",topQuartier:"Most Trees",rareSpecies:"Rarest Species",planted:"Planted",crown:"Crown",trees:"Trees",bingoTitle:"Cherry Blossom Bingo",bingoSpecies:"Discover Species",bingoRoutes:"Walking Routes",bingoSpecial:"Challenges",seeSpecies:"See {{species}}",walkRoute:"Walk {{route}}",fiveSpecies:"5 species visited",allSpecies:"All species visited",threeRoutes:"3 routes walked",allRoutes:"All routes walked",takePhoto:"Photo taken",shareApp:"App shared",bingoReset:"Reset"},q0={dataSource:"Data: City of Zurich, Grün Stadt Zürich (CC-0)",impressum:"Imprint",imageTerms:"Image Upload Terms",shareApp:"Share app"},H0={communityPhotos:"Community photos",addPhoto:"Add photo",uploading:"Uploading...",uploadSuccess:"Uploaded! Will appear after review.",uploadError:"Upload failed",tooLarge:"Image too large (max 10 MB)",invalidType:"Only images allowed",pendingReview:"Pending review"},$0={title:"Cherry Blossom Finder Zurich",text:"Discover 1,400+ cherry blossom trees in Zurich — walking routes, bloom calendar & more. Your perfect spring guide!"},X0={title:"Imprint",operator:"Operator",developer:"Developer",howBuilt:"On design and AI",contact:"Contact",version:"Version",dataCredits:"Data & Sources",treeData:"Tree Data",treeDataDesc:"City of Zurich / Grün Stadt Zürich — Tree Registry, Open Data (CC-0 License)",basemap:"Base Map",basemapDesc:"swisstopo — Light Base Map (Vector Tiles)",rout
9ing:"Routing",routingDesc:"OSRM — Open Source Routing Machine (Pedestrian Routing)"},Y0={app:I0,filter:k0,nearest:R0,routes:O0,popup:B0,bloom:N0,share:F0,layers:j0,onboarding:U0,walk:V0,sidebar:Z0,entdecken:G0,footer:q0,photos:H0,shareApp:$0,impressum:X0};po.use(Ly).use(Hv).init({resources:{de:{translation:D0},en:{translation:Y0}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});function W0(){const{t:j}=qa();return te.jsx("header",{className:"header",children:te.jsxs("div",{className:"header-title",children:[te.jsx("img",{className:"header-icon",src:"/img/icon-28.png",alt:"",width:"28",height:"28"}),te.jsx("h1",{children:j("app.title")})]})})}const Jf={autumnalis:[{start:{month:10,day:1},end:{month:11,day:31}},{start:{month:2,day:1},end:{month:3,day:10}}],subhirtella:[{start:{month:2,day:20},end:{month:3,day:15}}],yedoensis:[{start:{month:2,day:25},end:{month:3,day:15}}],"avium-plena":[{start:{month:3,day:15},end:{month:4,day:5}}],serrulata:[{start:{month:3,day:5},end:{month:3,day:30}}],kanzan:[{start:{month:3,day:20},end:{month:4,day:10}}],"serrulata-other":[{start:{month:3,day:10},end:{month:4,day:10}}],amanogawa:[{start:{month:3,day:20},end:{month:4,day:10}}],cerasifera:[{start:{month:2,day:1},end:{month:2,day:31}}]};function dm(j,P){const D=Jf[j];if(!D)return!1;const R=P.getMonth(),N=P.getDate();return D.some(({start:E,end:T})=>{const u=R>E.month||R===E.month&&N>=E.day,V=R<T.month||R===T.month&&N<=T.day;return E.month<=T.month?u&&V:u||V})}function Dy(j){return Object.keys(Jf).filter(P=>dm(P,j))}function p_(j,P){if(dm(j,P))return 0;const D=Jf[j];if(!D)return null;const R=P.getTime();let N=1/0;for(const{start:E}of D){let T=new Date(P.getFullYear(),E.month,E.day);if(T.getTime()>R){const V=Math.ceil((T-R)/864e5);N=Math.min(N,V)}T=new Date(P.getFullYear()+1,E.month,E.day);const u=Math.ceil((T-R)/(1e3*60*60*24));N=Math.min(N,u)}return N===1/0?null:N}const th={kanzan:{id:"kanzan",latinName:"Prunus serrulata 'Kanzan'",color:"#D63384",image:{url:"/img/species/kanzan.jpg",attribution:"Marie-Lan Nguyen, CC BY 2.5"},de:{name:"Japanische Nelkenkirsche",description:"Stark gefüllte, tiefrosa Blüten, sehr auffällig"},en:{name:"Kanzan Cherry",description:"Heavily double, deep pink blossoms, very striking"}},"avium-plena":{id:"avium-plena",latinName:"Prunus avium 'Plena'",color:"#4CAF50",image:{url:"/img/species/avium-plena.jpg",attribution:"SLiMHANNYA, CC BY-SA 4.0"},de:{name:"Gefülltblühende Vogelkirsche",description:"Reinweisse, gefüllte Blüten, sehr edel"},en:{name:"Double Wild Cherry",description:"Pure white, double blossoms, very elegant"}},serrulata:{id:"serrulata",latinName:"Prunus serrulata",color:"#E91E8C",image:{url:"/img/species/serrulata.jpg",attribution:"Tangopaso, Public domain"},de:{name:"Japanische Blütenkirsche",description:"Zierkirsche mit üppiger rosa Blüte"},en:{name:"Japanese Cherry",description:"Ornamental cherry with lush pink blossoms"}},subhirtella:{id:"subhirtella",latinName:"Prunus subhirtella",color:"#9C27B0",image:{url:"/img/species/subhirtella.jpg",attribution:"Captain-tucker, CC BY-SA 3.0"},de:{name:"Hänge-Zierkirsche",description:"Frühblühend, feinrosa, sehr poetisch"},en:{name:"Weeping Cherry",description:"Early blooming, delicate pink, very poetic"}},"serrulata-other":{id:"serrulata-other",latinName:"Prunus serrulata (Sorten)",color:"#FF7043",image:{url:"/img/species/serrulata-other.jpg",attribution:"Tony Hisgett, CC BY 2.0"},de:{name:"Weitere Zierkirschen",description:"Weitere Sorten der Japanischen Blütenkirsche"},en:{name:"Other Ornamental Cherries",description:"Additional Japanese cherry cultivars"}},amanogawa:{id:"amanogawa",latinName:"Prunus serrulata 'Amanogawa'",color:"#5C6BC0",image:{url:"/img/species/amanogawa.jpg",attribution:"Arz, CC BY-SA 3.0"},de:{name:"Säulen-Zierkirsche",description:"Schlanker Wuchs, zartrosa Blüten"},en:{name:"Columnar Cherry",description:"Slender growth, soft pink blossoms"}},autumnalis:{id:"autumnalis",latinName:"Prunus × subhirtella 'Autumnalis'",color:"#FF8F00",image:{url:"/img/species/autumnalis.jpg",attribution:"PROPOLI87, CC BY-SA 4.0"},de:{name:"Higan-Kirsche / Herbstkirsche",description:"Blüht im Frühling und oft nochmals im Herbst"},en:{name:"Higan Cherry / Autumn Cherry",description:"Blooms in spring and often again in autumn"}},yedoensis:{id:"yedoensis",latinName:"Prunus × yedoensis",color:"#EC407A",image:{url:"/img/species/yedoensis.jpg",attribution:"Uberlemur, CC BY-SA 3.0"},de:{name:"Yoshino-Kirsche",description:"Zartrosa bis weiss, ikonische Sakura"},en:{name:"Yoshino Cherry",description:"Soft pink to white, iconic sakura"}},cerasifera:{id:"cerasifera",latinName:"Prunus cerasifera 'Woodii'",color:"#8E24AA",image:{url:"/img/species/cerasifera.jpg",attribution:"Unsplash"},de:{name:"Kirschpflaume",description:"Dunkelrotes Laub, zartrosa Blüten im Vorfrühling"},en:{name:"Cherry Plum",description:"Dark red foliage, soft pink blossoms in early spring"}}},Qf=["kanzan","avium-plena","serrulata","subhirtella","serrulata-other","amanogawa","autumnalis","yedoensis"];function K0(j,P,D){const R=E=>{const T=E.getFullYear(),u=String(E.getMonth()+1).padStart(2,"0"),V=String(E.getDate()).padStart(2,"0");return`${T}${u}${V}`},N=new Date(D);return N.setDate(N.getDate()+1),["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//CherryBlossomZurich//EN","BEGIN:VEVENT",`DTSTART;VALUE=DATE:${R(D)}`,`DTEND;VALUE=DATE:${R(N)}
9`,`SUMMARY:${j}`,`DESCRIPTION:${P.replace(/\n/g,"\\n")}`,"LOCATION:Zurich, Switzerland",`UID:cherryblossom-${R(D)}@hanami.martina-meyer.ch`,"END:VEVENT","END:VCALENDAR"].join(`\r
10`)}function Q0(j,P){const D=new Blob([P],{type:"text/calendar;charset=utf-8"}),R=URL.createObjectURL(D),N=document.createElement("a");N.href=R,N.download=j,N.click(),URL.revokeObjectURL(R)}function J0(j,P,D){const R=T=>{const u=T.getFullYear(),V=String(T.getMonth()+1).padStart(2,"0"),X=String(T.getDate()).padStart(2,"0");return`${u}${V}${X}`},N=new Date(D);return N.setDate(N.getDate()+1),`https://calendar.google.com/calendar/render?${new URLSearchParams({action:"TEMPLATE",text:j,details:P,location:"Zurich, Switzerland",dates:`${R(D)}/${R(N)}`})}`}function ex({seasonStart:j,label:P}){const{t:D}=qa(),[R,N]=Qe.useState(!1),E=Qe.useRef(null);Qe.useEffect(()=>{if(!R)return;function V(X){E.current&&!E.current.contains(X.target)&&N(!1)}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[R]);function T(){const V=D("bloom.reminderTitle"),X=D("bloom.reminderDescription"),ce=K0(V,X,j);Q0("cherry-blossom-zurich.ics",ce),N(!1)}function u(){const V=D("bloom.reminderTitle"),X=D("bloom.reminderDescription"),ce=J0(V,X,j);window.open(ce,"_blank"),N(!1)}return te.jsxs("div",{className:"bloom-reminder",ref:E,children:[te.jsxs("button",{className:`bloom-action-btn ${R?"bloom-action-btn--on":""}`,onClick:()=>N(!R),children:[te.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[te.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),te.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),te.jsx("span",{children:P})]}),R&&te.jsxs("div",{className:"bloom-reminder-dropdown",children:[te.jsxs("button",{className:"bloom-reminder-option",onClick:T,children:["📥 ",D("bloom.downloadICS")]}),te.jsxs("button",{className:"bloom-reminder-option",onClick:u,children:["📆 ",D("bloom.googleCalendar")]})]})]})}function tx(j){const P=Dy(j);if(P.length>0)return{phase:"blooming",bloomingSpecies:P};let D=1/0,R=null;for(const u of Object.keys(Jf)){const V=p_(u,j);V!==null&&V<D&&(D=V,R=u)}const N=j.getFullYear(),E=new Date(N,2,20),T=j<E?E:new Date(N+1,2,20);return{phase:D<=365?"before":"after",daysUntil:D,nextSpeciesId:R,seasonStart:T}}function ix({bloomFilterActive:j,onBloomFilterChange:P,onOpenCalendar:D}){const{t:R,i18n:N}=qa(),E=N.language?.startsWith("de")?"de":"en",u=tx(new Date),V=u.nextSpeciesId?th[u.nextSpeciesId]?.[E]?.name||u.nextSpeciesId:null,X=E==="de"?"Kalender":"Calendar",ce=E==="de"?"Erinnern":"Remind me",ne=te.jsxs("button",{className:"bloom-action-btn",onClick:D,children:[te.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[te.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),te.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),te.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),te.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),te.jsx("span",{children:X})]});if(u.phase==="blooming")return te.jsx("div",{className:"bloom-banner-wrapper",children:te.jsxs("div",{className:"bloom-banner bloom-banner--active",children:[te.jsx("span",{className:"bloom-icon",children:"🌸"}),te.jsx("span",{className:"bloom-text",children:R("bloom.active")}),te.jsx("button",{className:`bloom-action-btn ${j?"bloom-action-btn--on":""}`,onClick:()=>P(!j),children:R(j?"bloom.showAll":"bloom.showBlooming")}),ne]})});const ye=V?R("bloom.countdownSpecies",{days:u.daysUntil,species:V}):R("bloom.countdown",{days:u.daysUntil});return te.jsx("div",{className:"bloom-banner-wrapper",children:te.jsxs("div",{className:"bloom-banner bloom-banner--before",children:[te.jsx("span",{className:"bloom-icon",children:"⏳"}),te.jsx("span",{className:"bloom-text",children:ye}),te.jsx(ex,{seasonStart:u.seasonStart,label:ce}),ne]})})}const nx={month:1},Tg=104,rx=["autumnalis","cerasifera","subhirtella","yedoensis","serrulata","avium-plena","kanzan","serrulata-other","amanogawa"];function d_(j,P){const D=[0,28,59,89],R=j-nx.month;return R<0||R>3?-1:D[R]+(P-1)}function ax(j){const P=d_(j.start.month,j.start.day),D=d_(j.end.month,j.end.day);if(P<0||D<0)return null;const R=Math.max(0,P/Tg*100),N=Math.max(2,(D-P+1)/Tg*100);return{left:`${R}%`,width:`${N}%`}}function sx(){const j=new Date,P=d_(j.getMonth(),j.getDate());return P<0||P>Tg?null:`${(P/Tg*100).toFixed(2)}%`}function ox({lang:j,autoExpanded:P}){const{t:D}=qa(),[R,N]=Qe.useState(!!P),E=new Date,T=sx(),u=j==="de"?["Feb","Mär","Apr","Mai"]:["Feb","Mar","Apr","May"],V=rx.map(X=>{const ce=th[X],ne=Jf[X]||[],ye=dm(X,E),Se=p_(X,E),Ie=ce?.[j]?.n
10ame||X,Te=ce?.color||"#FF69B4";return{speciesId:X,periods:ne,blooming:ye,days:Se,speciesName:Ie,color:Te}});return te.jsxs("div",{className:"bloom-timeline",children:[!P&&te.jsxs("button",{className:"bloom-timeline-toggle",onClick:()=>N(!R),children:[te.jsx("span",{children:D("bloom.timeline")}),te.jsx("span",{className:`bloom-timeline-arrow ${R?"bloom-timeline-arrow--open":""}`,children:"▸"})]}),R&&te.jsxs("div",{className:"bloom-timeline-content",children:[te.jsx("div",{className:"bloom-timeline-months",children:u.map((X,ce)=>te.jsx("span",{className:"bloom-timeline-month",children:X},ce))}),te.jsxs("div",{className:"bloom-timeline-rows",children:[te.jsx("div",{className:"bloom-timeline-labels-col",children:V.map(({speciesId:X,blooming:ce,days:ne,speciesName:ye,color:Se})=>te.jsxs("div",{className:"bloom-timeline-label",children:[te.jsx("span",{className:"bloom-timeline-dot",style:{background:Se,borderColor:Se==="#FFFFFF"?"#ccc":Se}}),te.jsx("span",{className:"bloom-timeline-name",title:ye,children:ye}),ce&&te.jsx("span",{className:"bloom-timeline-badge bloom-timeline-badge--active",children:D("bloom.bloomingNow")}),!ce&&ne!==null&&ne<=60&&te.jsx("span",{className:"bloom-timeline-badge bloom-timeline-badge--upcoming",children:D("bloom.inDays",{days:ne})})]},X))}),te.jsxs("div",{className:"bloom-timeline-tracks-col",children:[T&&te.jsx("div",{className:"bloom-timeline-today",style:{left:T}}),V.map(({speciesId:X,periods:ce,color:ne})=>te.jsx("div",{className:"bloom-timeline-bar-track",children:ce.map((ye,Se)=>{const Ie=ax(ye);return Ie?te.jsx("div",{className:"bloom-timeline-bar",style:{...Ie,background:ne==="#FFFFFF"?"#ddd":ne}},Se):null})},X))]})]})]})]})}function lx({open:j,onClose:P}){const{t:D,i18n:R}=qa(),N=R.language?.startsWith("de")?"de":"en";return Qe.useEffect(()=>{if(!j)return;const E=T=>{T.key==="Escape"&&P()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[j,P]),j?te.jsx("div",{className:"bloom-dialog-backdrop",onClick:P,children:te.jsxs("div",{className:"bloom-dialog",onClick:E=>E.stopPropagation(),children:[te.jsxs("div",{className:"bloom-dialog-header",children:[te.jsxs("span",{className:"bloom-dialog-title",children:["🌸"," ",D("bloom.timeline")]}),te.jsx("button",{className:"bloom-dialog-close",onClick:P,children:"✕"})]}),te.jsx("div",{className:"bloom-dialog-body",children:te.jsx(ox,{lang:N,autoExpanded:!0})})]})}):null}function Iy(j,P){const D=Qe.useRef(P);Qe.useEffect(function(){P!==D.current&&j.attributionControl!=null&&(D.current!=null&&j.attributionControl.removeAttribution(D.current),P!=null&&j.attributionControl.addAttribution(P)),D.current=P},[j,P])}function ux(j,P,D){P.center!==D.center&&j.setLatLng(P.center),P.radius!=null&&P.radius!==D.radius&&j.setRadius(P.radius)}var Sg=by();const cx=1;function hx(j){return Object.freeze({__version:cx,map:j})}function Eg(j,P){return Object.freeze({...j,...P})}const m_=Qe.createContext(null);function fm(){const j=Qe.use(m_);if(j==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return j}function ky(j){function P(D,R){const{instance:N,context:E}=j(D).current;Qe.useImperativeHandle(R,()=>N);const{children:T}=D;return T==null?null:o_.createElement(m_,{value:E},T)}return Qe.forwardRef(P)}function dx(j){function P(D,R){const[N,E]=Qe.useState(!1),{instance:T}=j(D,E).current;Qe.useImperativeHandle(R,()=>T),Qe.useEffect(function(){N&&T.update()},[T,N,D.children]);const u=T._contentNode;return u?Sg.createPortal(D.children,u):null}return Qe.forwardRef(P)}function Ry(j){function P(D,R){const{instance:N}=j(D).current;return Qe.useImperativeHandle(R,()=>N),null}return Qe.forwardRef(P)}function fx(j){return function(D){const R=fm(),N=j(D,R),{instance:E}=N.current,T=Qe.useRef(D.position),{position:u}=D;return Qe.useEffect(function(){return E.addTo(R.map),function(){E.remove()}},[R.map,E]),Qe.useEffect(function(){u!=null&&u!==T.current&&(E.setPosition(u),T.current=u)},[E,u]),N}}function g_(j,P){const D=Qe.useRef(void 0);Qe.useEffect(function(){return P!=null&&j.instance.on(P),D.current=P,function(){D.current!=null&&j.instance.off(D.current),D.current=null}},[j,P])}function Ag(j,P){const D=j.pane??P.pane;return D?{...j,pane:D}:j}function px(j,P){return function(R,N){const E=fm(),T=j(Ag(R,E),E);return Iy(E.map,R.attribution),g_(T.current,R.eventHandlers),P(T.current,E,R,N),T}}var sm={exports:{}};var mx=sm.exports,oy;function Oy(){return oy||(oy=1,(function(j,P){(function(D,R){R(P)})(mx,(function(D){var R="1.9.4";function N(l){var _,S,B,$;for(S=1,B=arguments.length;S<B;S++){$=arguments[S];for(_ in $)l[_]=$[_]}return l}var E=Object.create||(function(){function l(){}return function(_){return l.prototype=_,new l}})();function T(l,_){var S=Array.prototype.slice;
10if(l.bind)return l.bind.apply(l,S.call(arguments,1));var B=S.call(arguments,2);return function(){return l.apply(_,B.length?B.concat(S.call(arguments)):arguments)}}var u=0;function V(l){return"_leaflet_id"in l||(l._leaflet_id=++u),l._leaflet_id}function X(l,_,S){var B,$,oe,Ee;return Ee=function(){B=!1,$&&(oe.apply(S,$),$=!1)},oe=function(){B?$=arguments:(l.apply(S,arguments),setTimeout(Ee,_),B=!0)},oe}function ce(l,_,S){var B=_[1],$=_[0],oe=B-$;return l===B&&S?l:((l-$)%oe+oe)%oe+$}function ne(){return!1}function ye(l,_){if(_===!1)return l;var S=Math.pow(10,_===void 0?6:_);return Math.round(l*S)/S}function Se(l){return l.trim?l.trim():l.replace(/^\s+|\s+$/g,"")}function Ie(l){return Se(l).split(/\s+/)}function Te(l,_){Object.prototype.hasOwnProperty.call(l,"options")||(l.options=l.options?E(l.options):{});for(var S in _)l.options[S]=_[S];return l.options}function ve(l,_,S){var B=[];for(var $ in l)B.push(encodeURIComponent(S?$.toUpperCase():$)+"="+encodeURIComponent(l[$]));return(!_||_.indexOf("?")===-1?"?":"&")+B.join("&")}var lt=/\{ *([\w_ -]+) *\}/g;function Tt(l,_){return l.replace(lt,function(S,B){var $=_[B];if($===void 0)throw new Error("No value provided for variable "+S);return typeof $=="function"&&($=$(_)),$})}var dt=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"};function Bt(l,_){for(var S=0;S<l.length;S++)if(l[S]===_)return S;return-1}var Vt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function ui(l){return window["webkit"+l]||window["moz"+l]||window["ms"+l]}var Ft=0;function vi(l){var _=+new Date,S=Math.max(0,16-(_-Ft));return Ft=_+S,window.setTimeout(l,S)}var Kt=window.requestAnimationFrame||ui("RequestAnimationFrame")||vi,qt=window.cancelAnimationFrame||ui("CancelAnimationFrame")||ui("CancelRequestAnimationFrame")||function(l){window.clearTimeout(l)};function Ht(l,_,S){if(S&&Kt===vi)l.call(_);else return Kt.call(window,T(l,_))}function Xt(l){l&&qt.call(window,l)}var si={__proto__:null,extend:N,create:E,bind:T,get lastId(){return u},stamp:V,throttle:X,wrapNum:ce,falseFn:ne,formatNum:ye,trim:Se,splitWords:Ie,setOptions:Te,getParamString:ve,template:Tt,isArray:dt,indexOf:Bt,emptyImageUrl:Vt,requestFn:Kt,cancelFn:qt,requestAnimFrame:Ht,cancelAnimFrame:Xt};function ii(){}ii.extend=function(l){var _=function(){Te(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},S=_.__super__=this.prototype,B=E(S);B.constructor=_,_.prototype=B;for(var $ in this)Object.prototype.hasOwnProperty.call(this,$)&&$!=="prototype"&&$!=="__super__"&&(_[$]=this[$]);return l.statics&&N(_,l.statics),l.includes&&(Vi(l.includes),N.apply(null,[B].concat(l.includes))),N(B,l),delete B.statics,delete B.includes,B.options&&(B.options=S.options?E(S.options):{},N(B.options,l.options)),B._initHooks=[],B.callInitHooks=function(){if(!this._initHooksCalled){S.callInitHooks&&S.callInitHooks.call(this),this._initHooksCalled=!0;for(var oe=0,Ee=B._initHooks.length;oe<Ee;oe++)B._initHooks[oe].call(this)}},_},ii.include=function(l){var _=this.prototype.options;return N(this.prototype,l),l.options&&(this.prototype.options=_,this.mergeOptions(l.options)),this},ii.mergeOptions=function(l){return N(this.prototype.options,l),this},ii.addInitHook=function(l){var _=Array.prototype.slice.call(arguments,1),S=typeof l=="function"?l:function(){this[l].apply(this,_)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(S),this};function Vi(l){if(!(typeof L>"u"||!L||!L.Mixin)){l=dt(l)?l:[l];for(var _=0;_<l.length;
10_++)l[_]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Ke={on:function(l,_,S){if(typeof l=="object")for(var B in l)this._on(B,l[B],_);else{l=Ie(l);for(var $=0,oe=l.length;$<oe;$++)this._on(l[$],_,S)}return this},off:function(l,_,S){if(!arguments.length)delete this._events;else if(typeof l=="object")for(var B in l)this._off(B,l[B],_);else{l=Ie(l);for(var $=arguments.length===1,oe=0,Ee=l.length;oe<Ee;oe++)$?this._off(l[oe]):this._off(l[oe],_,S)}return this},_on:function(l,_,S,B){if(typeof _!="function"){console.warn("wrong listener type: "+typeof _);return}if(this._listens(l,_,S)===!1){S===this&&(S=void 0);var $={fn:_,ctx:S};B&&($.once=!0),this._events=this._events||{},this._events[l]=this._events[l]||[],this._events[l].push($)}},_off:function(l,_,S){var B,$,oe;if(this._events&&(B=this._events[l],!!B)){if(arguments.length===1){if(this._firingCount)for($=0,oe=B.length;$<oe;$++)B[$].fn=ne;delete this._events[l];return}if(typeof _!="function"){console.warn("wrong listener type: "+typeof _);return}var Ee=this._listens(l,_,S);if(Ee!==!1){var je=B[Ee];this._firingCount&&(je.fn=ne,this._events[l]=B=B.slice()),B.splice(Ee,1)}}},fire:function(l,_,S){if(!this.listens(l,S))return this;var B=N({},_,{type:l,target:this,sourceTarget:_&&_.sourceTarget||this});if(this._events){var $=this._events[l];if($){this._firingCount=this._firingCount+1||1;for(var oe=0,Ee=$.length;oe<Ee;oe++){var je=$[oe],tt=je.fn;je.once&&this.off(l,tt,je.ctx),tt.call(je.ctx||this,B)}this._firingCount--}}return S&&this._propagateEvent(B),this},listens:function(l,_,S,B){typeof l!="string"&&console.warn('"string" type argument expected');var $=_;typeof _!="function"&&(B=!!_,$=void 0,S=void 0);var oe=this._events&&this._events[l];if(oe&&oe.length&&this._listens(l,$,S)!==!1)return!0;if(B){for(var Ee in this._eventParents)if(this._eventParents[Ee].listens(l,_,S,B))return!0}return!1},_listens:function(l,_,S){if(!this._events)return!1;var B=this._events[l]||[];if(!_)return!!B.length;S===this&&(S=void 0);for(var $=0,oe=B.length;$<oe;$++)if(B[$].fn===_&&B[$].ctx===S)return $;return!1},once:function(l,_,S){if(typeof l=="object")for(var B in l)this._on(B,l[B],_,!0);else{l=Ie(l);for(var $=0,oe=l.length;$<oe;$++)this._on(l[$],_,S,!0)}return this},addEventParent:function(l){return this._eventParents=this._eventParents||{},this._eventParents[V(l)]=l,this},removeEventParent:function(l){return this._eventParents&&delete this._eventParents[V(l)],this},_propagateEvent:function(l){for(var _ in this._eventParents)this._eventParents[_].fire(l.type,N({layer:l.target,propagatedFrom:l.target},l),!0)}};Ke.addEventListener=Ke.on,Ke.removeEventListener=Ke.clearAllEventListeners=Ke.off,Ke.addOneTimeEventListener=Ke.once,Ke.fireEvent=Ke.fire,Ke.hasEventListeners=Ke.listens;var mt=ii.extend(Ke);function gt(l,_,S){this.x=S?Math.round(l):l,this.y=S?Math.round(_):_}var Yt=Math.trunc||function(l){return l>0?Math.floor(l):Math.ceil(l)};gt.prototype={clone:function(){return new gt(this.x,this.y)},add:function(l){return this.clone()._add(It(l))},_add:function(l){return this.x+=l.x,this.y+=l.y,this},subtract:function(l){return this.clone()._subtract(It(l))},_subtract:function(l){return this.x-=l.x,this.y-=l.y,this},divideBy:function(l){return this.clone()._divideBy(l)},_divideBy:function(l){return this.x/=l,this.y/=l,this},multiplyBy:function(l){return this.clone()._multiplyBy(l)},_multiplyBy:function(l){return this.x*=l,this.y*=l,this},scaleBy:function(l){return new gt(this.x*l.x,this.y*l.y)},unscaleBy:function(l){return new gt(this.x/l.x,this.y/l.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Yt(this.x),this.y=Yt(this.y),this},distanceTo:function(l){l=It(l);var _=l.x-this.x,S=l.y-this.y;return Math.sqrt(_*_+S*S)},equals:function(l){return l=It(l),l.x===this.x&&l.y===this.y},contains:function(l){return l=It(l),Math.abs(l.x)<=Math.abs(this.x)&&Math.abs(l.
10y)<=Math.abs(this.y)},toString:function(){return"Point("+ye(this.x)+", "+ye(this.y)+")"}};function It(l,_,S){return l instanceof gt?l:dt(l)?new gt(l[0],l[1]):l==null?l:typeof l=="object"&&"x"in l&&"y"in l?new gt(l.x,l.y):new gt(l,_,S)}function ze(l,_){if(l)for(var S=_?[l,_]:l,B=0,$=S.length;B<$;B++)this.extend(S[B])}ze.prototype={extend:function(l){var _,S;if(!l)return this;if(l instanceof gt||typeof l[0]=="number"||"x"in l)_=S=It(l);else if(l=rt(l),_=l.min,S=l.max,!_||!S)return this;return!this.min&&!this.max?(this.min=_.clone(),this.max=S.clone()):(this.min.x=Math.min(_.x,this.min.x),this.max.x=Math.max(S.x,this.max.x),this.min.y=Math.min(_.y,this.min.y),this.max.y=Math.max(S.y,this.max.y)),this},getCenter:function(l){return It((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,l)},getBottomLeft:function(){return It(this.min.x,this.max.y)},getTopRight:function(){return It(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(l){var _,S;return typeof l[0]=="number"||l instanceof gt?l=It(l):l=rt(l),l instanceof ze?(_=l.min,S=l.max):_=S=l,_.x>=this.min.x&&S.x<=this.max.x&&_.y>=this.min.y&&S.y<=this.max.y},intersects:function(l){l=rt(l);var _=this.min,S=this.max,B=l.min,$=l.max,oe=$.x>=_.x&&B.x<=S.x,Ee=$.y>=_.y&&B.y<=S.y;return oe&&Ee},overlaps:function(l){l=rt(l);var _=this.min,S=this.max,B=l.min,$=l.max,oe=$.x>_.x&&B.x<S.x,Ee=$.y>_.y&&B.y<S.y;return oe&&Ee},isValid:function(){return!!(this.min&&this.max)},pad:function(l){var _=this.min,S=this.max,B=Math.abs(_.x-S.x)*l,$=Math.abs(_.y-S.y)*l;return rt(It(_.x-B,_.y-$),It(S.x+B,S.y+$))},equals:function(l){return l?(l=rt(l),this.min.equals(l.getTopLeft())&&this.max.equals(l.getBottomRight())):!1}};function rt(l,_){return!l||l instanceof ze?l:new ze(l,_)}
10function Et(l,_){if(l)for(var S=_?[l,_]:l,B=0,$=S.length;B<$;B++)this.extend(S[B])}Et.prototype={extend:function(l){var _=this._southWest,S=this._northEast,B,$;if(l instanceof St)B=l,$=l;else if(l instanceof Et){if(B=l._southWest,$=l._northEast,!B||!$)return this}else return l?this.extend(Ct(l)||Pt(l)):this;return!_&&!S?(this._southWest=new St(B.lat,B.lng),this._northEast=new St($.lat,$.lng)):(_.lat=Math.min(B.lat,_.lat),_.lng=Math.min(B.lng,_.lng),S.lat=Math.max($.lat,S.lat),S.lng=Math.max($.lng,S.lng)),this},pad:function(l){var _=this._southWest,S=this._northEast,B=Math.abs(_.lat-S.lat)*l,$=Math.abs(_.lng-S.lng)*l;return new Et(new St(_.lat-B,_.lng-$),new St(S.lat+B,S.lng+$))},getCenter:function(){return new St((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new St(this.getNorth(),this.getWest())},getSouthEast:function(){return new St(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(l){typeof l[0]=="number"||l instanceof St||"lat"in l?l=Ct(l):l=Pt(l);var _=this._southWest,S=this._northEast,B,$;
10return l instanceof Et?(B=l.getSouthWest(),$=l.getNorthEast()):B=$=l,B.lat>=_.lat&&$.lat<=S.lat&&B.lng>=_.lng&&$.lng<=S.lng},intersects:function(l){l=Pt(l);var _=this._southWest,S=this._northEast,B=l.getSouthWest(),$=l.getNorthEast(),oe=$.lat>=_.lat&&B.lat<=S.lat,Ee=$.lng>=_.lng&&B.lng<=S.lng;return oe&&Ee},overlaps:function(l){l=Pt(l);var _=this._southWest,S=this._northEast,B=l.getSouthWest(),$=l.getNorthEast(),oe=$.lat>_.lat&&B.lat<S.lat,Ee=$.lng>_.lng&&B.lng<S.lng;return oe&&Ee},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(l,_){return l?(l=Pt(l),this._southWest.equals(l.getSouthWest(),_)&&this._northEast.equals(l.getNorthEast(),_)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Pt(l,_){return l instanceof Et?l:new Et(l,_)}function St(l,_,S){if(isNaN(l)||isNaN(_))throw new Error("Invalid LatLng object: ("+l+", "+_+")");this.lat=+l,this.lng=+_,S!==void 0&&(this.alt=+S)}St.prototype={equals:function(l,_){if(!l)return!1;l=Ct(l);var S=Math.max(Math.abs(this.lat-l.lat),Math.abs(this.lng-l.lng));return S<=(_===void 0?1e-9:_)},toString:function(l){return"LatLng("+ye(this.lat,l)+", "+ye(this.lng,l)+")"},distanceTo:function(l){return wi.distance(this,Ct(l))},wrap:function(){return wi.wrapLatLng(this)},toBounds:function(l){var _=180*l/40075017,S=_/Math.cos(Math.PI/180*this.lat);return Pt([this.lat-_,this.lng-S],[this.lat+_,this.lng+S])},clone:function(){return new St(this.lat,this.lng,this.alt)}};function Ct(l,_,S){return l instanceof St?l:dt(l)&&typeof l[0]!="object"?l.length===3?new St(l[0],l[1],l[2]):l.length===2?new St(l[0],l[1]):null:l==null?l:typeof l=="object"&&"lat"in l?new St(l.lat,"lng"in l?l.lng:l.lon,l.alt):_===void 0?null:new St(l,_,S)}var ri={latLngToPoint:function(l,_){var S=this.projection.project(l),B=this.scale(_);return this.transformation._transform(S,B)},pointToLatLng:function(l,_){var S=this.scale(_),B=this.transformation.untransform(l,S);return this.projection.unproject(B)},project:function(l){return this.projection.project(l)},unproject:function(l){return this.projection.unproject(l)},scale:function(l){return 256*Math.pow(2,l)},zoom:function(l){return Math.log(l/256)/Math.LN2},getProjectedBounds:function(l){if(this.infinite)return null;var _=this.projection.bounds,S=this.scale(l),B=this.transformation.transform(_.min,S),$=this.transformation.transform(_.max,S);return new ze(B,$)},infinite:!1,wrapLatLng:function(l){var _=this.wrapLng?ce(l.lng,this.wrapLng,!0):l.lng,S=this.wrapLat?ce(l.lat,this.wrapLat,!0):l.lat,B=l.alt;return new St(S,_,B)},wrapLatLngBounds:function(l){var _=l.getCenter(),S=this.wrapLatLng(_),B=_.lat-S.lat,$=_.lng-S.lng;if(B===0&&$===0)return l;
10var oe=l.getSouthWest(),Ee=l.getNorthEast(),je=new St(oe.lat-B,oe.lng-$),tt=new St(Ee.lat-B,Ee.lng-$);return new Et(je,tt)}},wi=N({},ri,{wrapLng:[-180,180],R:6371e3,distance:function(l,_){var S=Math.PI/180,B=l.lat*S,$=_.lat*S,oe=Math.sin((_.lat-l.lat)*S/2),Ee=Math.sin((_.lng-l.lng)*S/2),je=oe*oe+Math.cos(B)*Math.cos($)*Ee*Ee,tt=2*Math.atan2(Math.sqrt(je),Math.sqrt(1-je));return this.R*tt}}),Wi=6378137,vr={R:Wi,MAX_LATITUDE:85.0511287798,project:function(l){var _=Math.PI/180,S=this.MAX_LATITUDE,B=Math.max(Math.min(S,l.lat),-S),$=Math.sin(B*_);return new gt(this.R*l.lng*_,this.R*Math.log((1+$)/(1-$))/2)},unproject:function(l){var _=180/Math.PI;return new St((2*Math.atan(Math.exp(l.y/this.R))-Math.PI/2)*_,l.x*_/this.R)},bounds:(function(){var l=Wi*Math.PI;return new ze([-l,-l],[l,l])})()};function Ur(l,_,S,B){if(dt(l)){this._a=l[0],this._b=l[1],this._c=l[2],this._d=l[3];return}this._a=l,this._b=_,this._c=S,this._d=B}Ur.prototype={transform:function(l,_){return this._transform(l.clone(),_)},_transform:function(l,_){return _=_||1,l.x=_*(this._a*l.x+this._b),l.y=_*(this._c*l.y+this._d),l},untransform:function(l,_){return _=_||1,new gt((l.x/_-this._b)/this._a,(l.y/_-this._d)/this._c)}};function xr(l,_,S,B){return new Ur(l,_,S,B)}var Ho=N({},wi,{code:"EPSG:3857",projection:vr,transformation:(function(){var l=.5/(Math.PI*vr.R);return xr(l,.5,-l,.5)})()}),En=N({},Ho,{code:"EPSG:900913"});function Vr(l){return document.createElementNS("http://www.w3.org/2000/svg",l)}function ta(l,_){var S="",B,$,oe,Ee,je,tt;for(B=0,oe=l.length;B<oe;B++){for(je=l[B],$=0,Ee=je.length;$<Ee;$++)tt=je[$],S+=($?"L":"M")+tt.x+" "+tt.y;S+=_?Ve.svg?"z":"x":""}return S||"M0 0"}var yn=document.documentElement.style,Ta="ActiveXObject"in window,mo=Ta&&!document.addEventListener,js="msLaunchUri"in navigator&&!("documentMode"in document),ia=Qi("webkit"),ps=Qi("android"),go=Qi("android 2")||Qi("android 3"),pr=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Sa=ps&&Qi("Google")&&pr<537&&!("AudioNode"in window),Ha=!!window.opera,$o=!js&&Qi("chrome"),ms=Qi("gecko")&&!ia&&!Ha&&!Ta,Al=!$o&&Qi("safari"),Be=Qi("phantom"),ee="OTransition"in yn,ie=navigator.platform.indexOf("Win")===0,ae=Ta&&"transition"in yn,be="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!go,Pe="MozPerspective"in yn,Fe=!window.L_DISABLE_3D&&(ae||be||Pe)&&!ee&&!Be,Ue=typeof orientation<"u"||Qi("mobile"),Ne=Ue&&ia,Ze=Ue&&be,ct=!window.PointerEvent&&window.MSPointerEvent,it=!!(window.PointerEvent||ct),yt="ontouchstart"in window||!!window.TouchEvent,ke=!window.L_NO_TOUCH&&(yt||it),oi=Ue&&Ha,Hi=Ue&&ms,Gt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Wt=(function(){var l=!1;try{var _=Object.defineProperty({},"passive",{get:function(){l=!0}});window.addEventListener("testPassiveEventSupport",ne,_),window.removeEventListener("testPassiveEventSupport",ne,_)}catch{}return l})(),yi=(function(){return!!document.createElement("canvas").getContext})(),rn=!!(document.createElementNS&&Vr("svg").createSVGRect),dn=!!rn&&(function(){var l=document.createElement("div");return l.innerHTML="<svg/>",(l.firstChild&&l.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),tr=!rn&&(function(){try{var l=document.createElement("div");l.innerHTML='<v:shape adj="1"/>';var _=l.firstChild;return _.style.behavior="url(#default#VML)",_&&typeof _.adj=="object"}catch{return!1}})(),ir=navigator.platform.indexOf("Mac")===0,An=navigator.platform.indexOf("Linux")===0;function Qi(l){return navigator.userAgent.toLowerCase().indexOf(l)>=0}var Ve={ie:Ta,ielt9:mo,edge:js,webkit:ia,android:ps,android23:go,androidStock:Sa,opera:Ha,chrome:$o,gecko:ms,safari:Al,phantom:Be,opera12:ee,win:ie,ie3d:ae,webkit3d:be,gecko3d:Pe,any3d:Fe,mobile:Ue,mobileWebkit:Ne,mobileWebkit3d:Ze,msPointer:ct,pointer:it,touch:ke,touchNative:yt,mobileOpera:oi,mobileGecko:Hi,retina:Gt,passiveEvents:Wt,canvas:yi,svg:rn,vml:tr,inlineSvg:dn,mac:ir,linux:An},kn=Ve.msPointer?"MSPointerDown":"pointerdown",Pr=Ve.msPointer?"MSPointerMove":"pointermove",Zr=Ve.msPointer?"MSPointerUp":"pointerup",Pi=Ve.msPointer?"MSPointerCancel":"pointercancel",bt={touchstart:kn,touchmove:Pr,touchend:Zr,touchcancel:Pi},li={touchstart:_s,touchmove:Ca,touchend:Ca,touchcancel:Ca},hi={},na=!1;function Nu(l,_,S){return _==="touchstart"&&Us(),li[_]?(S=li[_].bind(this,S),l.addEventListener(bt[_],S,!1),S):(console.warn("wrong event specified:",_),ne)}function gs(l,_,S){if(!bt[_]){console.warn("wrong event specified:",_);return}l.removeEventListener(bt[_],S,!1)}function fi(l){hi[l.pointerId]=l}function Xo(l){hi[l.pointerId]&&(hi[l.pointerId]=l)}function $a(l){delete hi[l.pointerId]}function Us(){na||(document.addEventListener(kn,fi,!0),document.addEventListener(Pr,Xo,!0),document.addEventListener(Zr,$a,!0),document.addEventListener(Pi,$a,!0),na=!0)}function Ca(l,_){if(_.pointerType!==(_.MSPOINTER_TYPE_MOUSE||"mouse")){_.touches=[];for(var S in hi)_.touches.push(hi[S]);_.changedTouches=[_],l(_)}}function _s(l,_){_.MSPOINTER_TYPE_TOUCH&&_.pointerType===_.MSPOINTER_TYPE_TOUCH&&Ti(_),Ca(l,_)}function Rn(l){var _={},S,B;for(B in l)S=l[B],_[B]=S&&S.bind?S.bind(l):S;return l=_,_.type="dblclick",_.detail=2,_.isTrusted=!1,_._simulated=!0,_}var Pl=200;function zr(l,_){l.addEventListener("dblclick",_);var S=0,B;function $(oe){if(oe.detail!==1){B=oe.detail;return}if(!(oe.pointerType==="mouse"||oe.sourceCapabilities&&!oe.sourceCapabilities.firesTouchEvents)){var Ee=la(oe);if(!(Ee.some(function(tt){return tt instanceof HTMLLabelElement&&tt.attributes.for})&&!Ee.some(function(tt){return tt instanceof HTMLInputElement||tt instanceof HTMLSelectElement}))){var je=Date.now();je-S<=Pl?(B++,B===2&&_(Rn(oe))):B=1,S=je}}}return l.addEventListener("click",$),{dblclick:_,simDblclick:$}}function Oi(l,_){l.removeEventListener("dblclick",_.dblclick),l.removeEventListener("click",_.simDblclick)}var Xa=Ko(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ys=Ko(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Yo=ys==="webkitTransition"||ys==="OTransition"?ys+"End":"transitionend";function Vs(l){return typeof l=="string"?document.getElementById(l):l}function Gr(l,_){var S=l.style[_]||l.currentStyle&&l.currentStyle[_];if((!S||S==="auto")&&document.defaultView){var B=document.defaultView.getComputedStyle(l,null);S=B?B[_]:null}return S==="auto"?null:S}function Bi(l,_,S){var B=document.createElement(l);return B.className=_||"",S&&S.appendChild(B),B}function $i(l){var _=l.parentNode;_&&_.removeChild(l)}function qr(l){for(;l.firstChild;)l.removeChild(l.firstChild)}function zi(l){var _=l.parentNode;_&&_.lastChild!==l&&_.appendChild(l)}function _o(l){var _=l.parentNode;_&&_.firstChild!==l&&_.insertBefore(l,_.firstChild)}function Fu(l,_){if(l.classList!==void 0)return l.classList.contains(_);var S=Ql(l);return S.length>0&&new RegExp("(^|\\s)"+_+"(\\s|$)").test(S)}function xi(l,_){if(l.classList!==void 0)for(var S=Ie(_),B=0,$=S.length;B<$;B++)l.classList.add(S[B]);else if(!Fu(l,_)){var oe=Ql(l);Wo(l,(oe?oe+" ":"")+_)}}function On(l,_){l.classList!==void 0?l.classList.remove(_):Wo(l,Se((" "+Ql(l)+" ").replace(" "+_+" "," ")))}function Wo(l,_){l.className.baseVal===void 0?l.className=_:l.className.baseVal=_}function Ql(l){return l.correspondingElement&&(l=l.correspondingElement),l.className.baseVal===void 0?l.className:l.className.baseVal}function vn(l,_){"opacity"in l.style?l.style.opacity=_:"filter"in l.style&&Jl(l,_)}function Jl(l,_){var S=!1,B="DXImageTransform.Microsoft.Alpha";try{S=l.filters.item(B)}catch{if(_===1)return}_=Math.round(_*100),S?(S.Enabled=_!==100,S.Opacity=_):l.style.filter+=" progid:"+B+"(opacity="+_+")"}function Ko(l){for(var _=document.documentElement.style,S=0;S<l.length;S++)if(l[S]in _)return l[S];return!1}function Ya(l,_,S){var B=_||new gt(0,0);l.style[Xa]=(Ve.ie3d?"translate("+B.x+"px,"+B.y+"px)":"translate3d("+B.x+"px,"+B.y+"px,0)")+(S?" scale("+S+")":"")}function fn(l,_){l._leaflet_pos=_,Ve.any3d?Ya(l,_):(l.style.left=_.x+"px",l.style.top=_.y+"px")}function yo(l){return l._leaflet_pos||new gt(0,0)}var vs,Ma,ju;if("onselectstart"in document)vs=function(){Qt(window,"selectstart",Ti)},Ma=function(){jt(window,"selectstart",Ti)};else{var Wa=Ko(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);vs=function(){if(Wa){var l=document.documentElement.style;ju=l[Wa],l[Wa]="none"}},Ma=function(){Wa&&(document.documentElement.style[Wa]=ju,ju=void 0)}}function zl(){Qt(window,"dragstart",Ti)}function Zs(){jt(window,"dragstart",Ti)}var Ka,vo;function mi(l){for(;l.tabIndex===-1;)l=l.parentNode;l.style&&(ra(),Ka=l,vo=l.style.outlineStyle,l.style.outlineStyle="none",Qt(window,"keydown",ra))}function ra(){Ka&&(Ka.style.outlineStyle=vo,Ka=void 0,vo=void 0,jt(window,"keydown",ra))}function Uu(l){do l=l.parentNode;while((!l.offsetWidth||!l.offsetHeight)&&l!==document.body);return l}function Qo(l){var _=l.getBoundingClientRect();
10return{x:_.width/l.offsetWidth||1,y:_.height/l.offsetHeight||1,boundingClientRect:_}}var or={__proto__:null,TRANSFORM:Xa,TRANSITION:ys,TRANSITION_END:Yo,get:Vs,getStyle:Gr,create:Bi,remove:$i,empty:qr,toFront:zi,toBack:_o,hasClass:Fu,addClass:xi,removeClass:On,setClass:Wo,getClass:Ql,setOpacity:vn,testProp:Ko,setTransform:Ya,setPosition:fn,getPosition:yo,get disableTextSelection(){return vs},get enableTextSelection(){return Ma},disableImageDrag:zl,enableImageDrag:Zs,preventOutline:mi,restoreOutline:ra,getSizedParentNode:Uu,getScale:Qo};function Qt(l,_,S,B){if(_&&typeof _=="object")for(var $ in _)wn(l,$,_[$],S);else{_=Ie(_);for(var oe=0,Ee=_.length;oe<Ee;oe++)wn(l,_[oe],S,B)}return this}var Ni="_leaflet_events";function jt(l,_,S,B){if(arguments.length===1)Ji(l),delete l[Ni];else if(_&&typeof _=="object")for(var $ in _)br(l,$,_[$],S);else if(_=Ie(_),arguments.length===2)Ji(l,function(je){return Bt(_,je)!==-1});else for(var oe=0,Ee=_.length;oe<Ee;oe++)br(l,_[oe],S,B);return this}function Ji(l,_){for(var S in l[Ni]){var B=S.split(/\d/)[0];(!_||_(B))&&br(l,B,null,null,S)}}
10var aa={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function wn(l,_,S,B){var $=_+V(S)+(B?"_"+V(B):"");if(l[Ni]&&l[Ni][$])return this;var oe=function(je){return S.call(B||l,je||window.event)},Ee=oe;!Ve.touchNative&&Ve.pointer&&_.indexOf("touch")===0?oe=Nu(l,_,oe):Ve.touch&&_==="dblclick"?oe=zr(l,oe):"addEventListener"in l?_==="touchstart"||_==="touchmove"||_==="wheel"||_==="mousewheel"?l.addEventListener(aa[_]||_,oe,Ve.passiveEvents?{passive:!1}:!1):_==="mouseenter"||_==="mouseleave"?(oe=function(je){je=je||window.event,wr(l,je)&&Ee(je)},l.addEventListener(aa[_],oe,!1)):l.addEventListener(_,Ee,!1):l.attachEvent("on"+_,oe),l[Ni]=l[Ni]||{},l[Ni][$]=oe}function br(l,_,S,B,$){$=$||_+V(S)+(B?"_"+V(B):"");var oe=l[Ni]&&l[Ni][$];if(!oe)return this;!Ve.touchNative&&Ve.pointer&&_.indexOf("touch")===0?gs(l,_,oe):Ve.touch&&_==="dblclick"?Oi(l,oe):"removeEventListener"in l?l.removeEventListener(aa[_]||_,oe,!1):l.detachEvent("on"+_,oe),l[Ni][$]=null}function Tn(l){return l.stopPropagation?l.stopPropagation():l.originalEvent?l.originalEvent._stopped=!0:l.cancelBubble=!0,this}function Hr(l){return wn(l,"wheel",Tn),this}function sa(l){return Qt(l,"mousedown touchstart dblclick contextmenu",Tn),l._leaflet_disable_click=!0,this}function Ti(l){return l.preventDefault?l.preventDefault():l.returnValue=!1,this}function oa(l){return Ti(l),Tn(l),this}function la(l){if(l.composedPath)return l.composedPath();for(var _=[],S=l.target;S;)_.push(S),S=S.parentNode;return _}function xo(l,_){if(!_)return new gt(l.clientX,l.clientY);var S=Qo(_),B=S.boundingClientRect;return new gt((l.clientX-B.left)/S.x-_.clientLeft,(l.clientY-B.top)/S.y-_.clientTop)}var $r=Ve.linux&&Ve.chrome?window.devicePixelRatio:Ve.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function $n(l){return Ve.edge?l.wheelDeltaY/2:l.deltaY&&l.deltaMode===0?-l.deltaY/$r:l.deltaY&&l.deltaMode===1?-l.deltaY*20:l.deltaY&&l.deltaMode===2?-l.deltaY*60:l.deltaX||l.deltaZ?0:l.wheelDelta?(l.wheelDeltaY||l.wheelDelta)/2:l.detail&&Math.abs(l.detail)<32765?-l.detail*20:l.detail?l.detail/-32765*60:0}function wr(l,_){var S=_.relatedTarget;if(!S)return!0;try{for(;S&&S!==l;)S=S.parentNode}catch{return!1}return S!==l}var eu={__proto__:null,on:Qt,off:jt,stopPropagation:Tn,disableScrollPropagation:Hr,disableClickPropagation:sa,preventDefault:Ti,stop:oa,getPropagationPath:la,getMousePosition:xo,getWheelDelta:$n,isExternalTarget:wr,addListener:Qt,removeListener:jt},bo=mt.extend({run:function(l,_,S,B){this.stop(),this._el=l,this._inProgress=!0,this._duration=S||.25,this._easeOutPower=1/Math.max(B||.5,.2),this._startPos=yo(l),this._offset=_.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Ht(this._animate,this),this._step()},_step:function(l){var _=+new Date-this._startTime,S=this._duration*1e3;_<S?this._runFrame(this._easeOut(_/S),l):(this._runFrame(1),this._complete())},_runFrame:function(l,_){var S=this._startPos.add(this._offset.multiplyBy(l));_&&S._round(),fn(this._el,S),this.fire("step")},_complete:function(){Xt(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(l){return 1-Math.pow(1-l,this._easeOutPower)}}),Ci=mt.extend({options:{crs:Ho,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(l,_){_=Te(this,_),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(l),this._initLayout(),this._onResize=T(this._onResize,this),this._initEvents(),_.maxBounds&&this.setMaxBounds(_.maxBounds),_.zoom!==void 0&&(this._zoom=this._limitZoom(_.zoom)),_.center&&_.zoom!==void 0&&this.setView(Ct(_.center),_.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ys&&Ve.any3d&&!Ve.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Qt(this._proxy,Yo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
10,setView:function(l,_,S){if(_=_===void 0?this._zoom:this._limitZoom(_),l=this._limitCenter(Ct(l),_,this.options.maxBounds),S=S||{},this._stop(),this._loaded&&!S.reset&&S!==!0){S.animate!==void 0&&(S.zoom=N({animate:S.animate},S.zoom),S.pan=N({animate:S.animate,duration:S.duration},S.pan));var B=this._zoom!==_?this._tryAnimatedZoom&&this._tryAnimatedZoom(l,_,S.zoom):this._tryAnimatedPan(l,S.pan);if(B)return clearTimeout(this._sizeTimer),this}return this._resetView(l,_,S.pan&&S.pan.noMoveStart),this},setZoom:function(l,_){return this._loaded?this.setView(this.getCenter(),l,{zoom:_}):(this._zoom=l,this)},zoomIn:function(l,_){return l=l||(Ve.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+l,_)},zoomOut:function(l,_){return l=l||(Ve.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-l,_)},setZoomAround:function(l,_,S){var B=this.getZoomScale(_),$=this.getSize().divideBy(2),oe=l instanceof gt?l:this.latLngToContainerPoint(l),Ee=oe.subtract($).multiplyBy(1-1/B),je=this.containerPointToLatLng($.add(Ee));return this.setView(je,_,{zoom:S})},_getBoundsCenterZoom:function(l,_){_=_||{},l=l.getBounds?l.getBounds():Pt(l);var S=It(_.paddingTopLeft||_.padding||[0,0]),B=It(_.paddingBottomRight||_.padding||[0,0]),$=this.getBoundsZoom(l,!1,S.add(B));if($=typeof _.maxZoom=="number"?Math.min(_.maxZoom,$):$,$===1/0)return{center:l.getCenter(),zoom:$};
10var oe=B.subtract(S).divideBy(2),Ee=this.project(l.getSouthWest(),$),je=this.project(l.getNorthEast(),$),tt=this.unproject(Ee.add(je).divideBy(2).add(oe),$);return{center:tt,zoom:$}},fitBounds:function(l,_){if(l=Pt(l),!l.isValid())throw new Error("Bounds are not valid.");var S=this._getBoundsCenterZoom(l,_);return this.setView(S.center,S.zoom,_)},fitWorld:function(l){return this.fitBounds([[-90,-180],[90,180]],l)},panTo:function(l,_){return this.setView(l,this._zoom,{pan:_})},panBy:function(l,_){if(l=It(l).round(),_=_||{},!l.x&&!l.y)return this.fire("moveend");if(_.animate!==!0&&!this.getSize().contains(l))return this._resetView(this.unproject(this.project(this.getCenter()).add(l)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new bo,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),_.noMoveStart||this.fire("movestart"),_.animate!==!1){xi(this._mapPane,"leaflet-pan-anim");var S=this._getMapPanePos().subtract(l).round();this._panAnim.run(this._mapPane,S,_.duration||.25,_.easeLinearity)}else this._rawPanBy(l),this.fire("move").fire("moveend");return this},flyTo:function(l,_,S){if(S=S||{},S.animate===!1||!Ve.any3d)return this.setView(l,_,S);this._stop();var B=this.project(this.getCenter()),$=this.project(l),oe=this.getSize(),Ee=this._zoom;l=Ct(l),_=_===void 0?Ee:_;var je=Math.max(oe.x,oe.y),tt=je*this.getZoomScale(Ee,_),vt=$.distanceTo(B)||1,Rt=1.42,ni=Rt*Rt;function Mi(zn){var Pa=zn?-1:1,Ss=zn?tt:je,Cs=tt*tt-je*je+Pa*ni*ni*vt*vt,Qs=2*Ss*ni*vt,rs=Cs/Qs,za=Math.sqrt(rs*rs+1)-rs,Ms=za<1e-9?-18:Math.log(za);return Ms}function Xn(zn){return(Math.exp(zn)-Math.exp(-zn))/2}function Nn(zn){return(Math.exp(zn)+Math.exp(-zn))/2}function ma(zn){return Xn(zn)/Nn(zn)}var Ki=Mi(0);function ji(zn){return je*(Nn(Ki)/Nn(Ki+Rt*zn))}function Ii(zn){return je*(Nn(Ki)*ma(Ki+Rt*zn)-Xn(Ki))/ni}function Ks(zn){return 1-Math.pow(1-zn,1.5)}var Aa=Date.now(),Sn=(Mi(1)-Ki)/Rt,ga=S.duration?1e3*S.duration:1e3*Sn*.8;function Wr(){var zn=(Date.now()-Aa)/ga,Pa=Ks(zn)*Sn;zn<=1?(this._flyToFrame=Ht(Wr,this),this._move(this.unproject(B.add($.subtract(B).multiplyBy(Ii(Pa)/vt)),Ee),this.getScaleZoom(je/ji(Pa),Ee),{flyTo:!0})):this._move(l,_)._moveEnd(!0)}return this._moveStart(!0,S.noMoveStart),Wr.call(this),this},flyToBounds:function(l,_){var S=this._getBoundsCenterZoom(l,_);return this.flyTo(S.center,S.zoom,_)},setMaxBounds:function(l){return l=Pt(l),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),l.isValid()?(this.options.maxBounds=l,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(l){var _=this.options.minZoom;return this.options.minZoom=l,this._loaded&&_!==l&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(l):this},setMaxZoom:function(l){var _=this.options.maxZoom;return this.options.maxZoom=l,this._loaded&&_!==l&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(l):this},panInsideBounds:function(l,_){this._enforcingBounds=!0;var S=this.getCenter(),B=this._limitCenter(S,this._zoom,Pt(l));return S.equals(B)||this.panTo(B,_),this._enforcingBounds=!1,this},panInside:function(l,_){_=_||{};var S=It(_.paddingTopLeft||_.padding||[0,0]),B=It(_.paddingBottomRight||_.padding||[0,0]),$=this.project(this.getCenter()),oe=this.project(l),Ee=this.getPixelBounds(),je=rt([Ee.min.add(S),Ee.max.subtract(B)]),tt=je.getSize();if(!je.contains(oe)){this._enforcingBounds=!0;var vt=oe.subtract(je.getCenter()),Rt=je.extend(oe).getSize().subtract(tt);$.x+=vt.x<0?-Rt.x:Rt.x,$.y+=vt.y<0?-Rt.y:Rt.y,this.panTo(this.unproject($),_),this._enforcingBounds=!1}return this},invalidateSize:function(l){if(!this._loaded)return this;l=N({animate:!1,pan:!0},l===!0?{animate:!0}:l);var _=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var S=this.getSize(),B=_.divideBy(2).round(),$=S.divideBy(2).round(),oe=B.subtract($);return!oe.x&&!oe.y?this:(l.animate&&l.pan?this.panBy(oe):(l.pan&&this._rawPanBy(oe),this.fire("move"),l.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(T(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:_,newSize:S}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(l){if(l=this._locateOptions=N({timeout:1e4,watch:!1},l),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var _=T(this._handleGeolocationResponse,this),S=T(this._handleGeolocationError,this);return l.watch?this._locationWatchId=navigator.geolocation.watchPosition(_,S,l):navigator.geolocation.getCurrentPosition(_,S,l),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(l){if(this._container._leaflet_id){var _=l.code,S=l.message||(_===1?"permission denied":_===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:_,message:"Geolocation error: "+S+"."})}},_handleGeolocationResponse:function(l){if(this._container._leaflet_id){var _=l.coords.latitude,S=l.coords.longitude,B=new St(_,S),$=B.toBounds(l.coords.accuracy*2),oe=this._locateOptions;if(oe.setView){var Ee=this.getBoundsZoom($);this.setView(B,oe.maxZoom?Math.min(Ee,oe.maxZoom):Ee)}var je={latlng:B,bounds:$,timestamp:l.timestamp};for(var tt in l.coords)typeof l.coords[tt]=="number"&&(je[tt]=l.coords[tt]);this.fire("locationfound",je)}},addHandler:function(l,_){if(!_)return this;var S=this[l]=new _(this);return this._handlers.push(S),this.options[l]&&S.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),$i(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Xt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var l;
10for(l in this._layers)this._layers[l].remove();for(l in this._panes)$i(this._panes[l]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(l,_){var S="leaflet-pane"+(l?" leaflet-"+l.replace("Pane","")+"-pane":""),B=Bi("div",S,_||this._mapPane);return l&&(this._panes[l]=B),B},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var l=this.getPixelBounds(),_=this.unproject(l.getBottomLeft()),S=this.unproject(l.getTopRight());return new Et(_,S)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(l,_,S){l=Pt(l),S=It(S||[0,0]);var B=this.getZoom()||0,$=this.getMinZoom(),oe=this.getMaxZoom(),Ee=l.getNorthWest(),je=l.getSouthEast(),tt=this.getSize().subtract(S),vt=rt(this.project(je,B),this.project(Ee,B)).getSize(),Rt=Ve.any3d?this.options.zoomSnap:1,ni=tt.x/vt.x,Mi=tt.y/vt.y,Xn=_?Math.max(ni,Mi):Math.min(ni,Mi);return B=this.getScaleZoom(Xn,B),Rt&&(B=Math.round(B/(Rt/100))*(Rt/100),B=_?Math.ceil(B/Rt)*Rt:Math.floor(B/Rt)*Rt),Math.max($,Math.min(oe,B))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new gt(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(l,_){var S=this._getTopLeftPoint(l,_);return new ze(S,S.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(l){return this.options.crs.getProjectedBounds(l===void 0?this.getZoom():l)},getPane:function(l){return typeof l=="string"?this._panes[l]:l},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(l,_){var S=this.options.crs;return _=_===void 0?this._zoom:_,S.scale(l)/S.scale(_)},getScaleZoom:function(l,_){var S=this.options.crs;_=_===void 0?this._zoom:_;var B=S.zoom(l*S.scale(_));return isNaN(B)?1/0:B},project:function(l,_){return _=_===void 0?this._zoom:_,this.options.crs.latLngToPoint(Ct(l),_)},unproject:function(l,_){return _=_===void 0?this._zoom:_,this.options.crs.pointToLatLng(It(l),_)},layerPointToLatLng:function(l){var _=It(l).add(this.getPixelOrigin());return this.unproject(_)},latLngToLayerPoint:function(l){var _=this.project(Ct(l))._round();return _._subtract(this.getPixelOrigin())},wrapLatLng:function(l){return this.options.crs.wrapLatLng(Ct(l))},wrapLatLngBounds:function(l){return this.options.crs.wrapLatLngBounds(Pt(l))},distance:function(l,_){return this.options.crs.distance(Ct(l),Ct(_))},containerPointToLayerPoint:function(l){return It(l).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(l){return It(l).add(this._getMapPanePos())},containerPointToLatLng:function(l){var _=this.containerPointToLayerPoint(It(l));return this.layerPointToLatLng(_)},latLngToContainerPoint:function(l){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ct(l)))},mouseEventToContainerPoint:function(l){return xo(l,this._container)},mouseEventToLayerPoint:function(l){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(l))},mouseEventToLatLng:function(l){return this.layerPointToLatLng(this.mouseEventToLayerPoint(l))},_initContainer:function(l){var _=this._container=Vs(l);if(_){if(_._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Qt(_,"scroll",this._onScroll,this),this._containerId=V(_)},_initLayout:function(){var l=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ve.any3d,xi(l,"leaflet-container"+(Ve.touch?" leaflet-touch":"")+(Ve.retina?" leaflet-retina":"")+(Ve.ielt9?" leaflet-oldie":"")+(Ve.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var _=Gr(l,"position");_!=="absolute"&&_!=="relative"&&_!=="fixed"&&_!=="sticky"&&(l.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var l=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),fn(this._mapPane,new gt(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(xi(l.markerPane,"leaflet-zoom-hide"),xi(l.shadowPane,"leaflet-zoom-hide"))},_resetView:function(l,_,S){fn(this._mapPane,new gt(0,0));var B=!this._loaded;this._loaded=!0,_=this._limitZoom(_),this.fire("viewprereset");var $=this._zoom!==_;this._moveStart($,S)._move(l,_)._moveEnd($),this.fire("viewreset"),B&&this.fire("load")},_moveStart:function(l,_){return l&&this.fire("zoomstart"),_||this.fire("movestart"),this},_move:function(l,_,S,B){_===void 0&&(_=this._zoom);var $=this._zoom!==_;return this._zoom=_,this._lastCenter=l,this._pixelOrigin=this._getNewPixelOrigin(l),B?S&&S.pinch&&this.fire("zoom",S):(($||S&&S.pinch)&&this.fire("zoom",S),this.fire("move",S)),this},_moveEnd:function(l){return l&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Xt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(l){fn(this._mapPane,this._getMapPanePos().subtract(l))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(l){this._targets={},this._targets[V(this._container)]=this;var _=l?jt:Qt;_(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&_(window,"resize",this._onResize,this),Ve.any3d&&this.options.transform3DLimit&&(l?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Xt(this._resizeRequest),this._resizeRequest=Ht(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var l=this._getMapPanePos();
10Math.max(Math.abs(l.x),Math.abs(l.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(l,_){for(var S=[],B,$=_==="mouseout"||_==="mouseover",oe=l.target||l.srcElement,Ee=!1;oe;){if(B=this._targets[V(oe)],B&&(_==="click"||_==="preclick")&&this._draggableMoved(B)){Ee=!0;break}if(B&&B.listens(_,!0)&&($&&!wr(oe,l)||(S.push(B),$))||oe===this._container)break;oe=oe.parentNode}return!S.length&&!Ee&&!$&&this.listens(_,!0)&&(S=[this]),S},_isClickDisabled:function(l){for(;l&&l!==this._container;){if(l._leaflet_disable_click)return!0;l=l.parentNode}},_handleDOMEvent:function(l){var _=l.target||l.srcElement;if(!(!this._loaded||_._leaflet_disable_events||l.type==="click"&&this._isClickDisabled(_))){var S=l.type;S==="mousedown"&&mi(_),this._fireDOMEvent(l,S)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(l,_,S){if(l.type==="click"){var B=N({},l);B.type="preclick",this._fireDOMEvent(B,B.type,S)}var $=this._findEventTargets(l,_);if(S){for(var oe=[],Ee=0;Ee<S.length;Ee++)S[Ee].listens(_,!0)&&oe.push(S[Ee]);$=oe.concat($)}if($.length){_==="contextmenu"&&Ti(l);var je=$[0],tt={originalEvent:l};if(l.type!=="keypress"&&l.type!=="keydown"&&l.type!=="keyup"){var vt=je.getLatLng&&(!je._radius||je._radius<=10);tt.containerPoint=vt?this.latLngToContainerPoint(je.getLatLng()):this.mouseEventToContainerPoint(l),tt.layerPoint=this.containerPointToLayerPoint(tt.containerPoint),tt.latlng=vt?je.getLatLng():this.layerPointToLatLng(tt.layerPoint)}for(Ee=0;Ee<$.length;Ee++)if($[Ee].fire(_,tt,!0),tt.originalEvent._stopped||$[Ee].options.bubblingMouseEvents===!1&&Bt(this._mouseEvents,_)!==-1)return}},_draggableMoved:function(l){return l=l.dragging&&l.dragging.enabled()?l:this,l.dragging&&l.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var l=0,_=this._handlers.length;l<_;l++)this._handlers[l].disable()},whenReady:function(l,_){return this._loaded?l.call(_||this,{target:this}):this.on("load",l,_),this},_getMapPanePos:function(){return yo(this._mapPane)||new gt(0,0)},_moved:function(){var l=this._getMapPanePos();return l&&!l.equals([0,0])},_getTopLeftPoint:function(l,_){var S=l&&_!==void 0?this._getNewPixelOrigin(l,_):this.getPixelOrigin();return S.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(l,_){var S=this.getSize()._divideBy(2);return this.project(l,_)._subtract(S)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(l,_,S){var B=this._getNewPixelOrigin(S,_);return this.project(l,_)._subtract(B)},_latLngBoundsToNewLayerBounds:function(l,_,S){var B=this._getNewPixelOrigin(S,_);
10return rt([this.project(l.getSouthWest(),_)._subtract(B),this.project(l.getNorthWest(),_)._subtract(B),this.project(l.getSouthEast(),_)._subtract(B),this.project(l.getNorthEast(),_)._subtract(B)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(l){return this.latLngToLayerPoint(l).subtract(this._getCenterLayerPoint())},_limitCenter:function(l,_,S){if(!S)return l;var B=this.project(l,_),$=this.getSize().divideBy(2),oe=new ze(B.subtract($),B.add($)),Ee=this._getBoundsOffset(oe,S,_);return Math.abs(Ee.x)<=1&&Math.abs(Ee.y)<=1?l:this.unproject(B.add(Ee),_)},_limitOffset:function(l,_){if(!_)return l;var S=this.getPixelBounds(),B=new ze(S.min.add(l),S.max.add(l));return l.add(this._getBoundsOffset(B,_))},_getBoundsOffset:function(l,_,S){var B=rt(this.project(_.getNorthEast(),S),this.project(_.getSouthWest(),S)),$=B.min.subtract(l.min),oe=B.max.subtract(l.max),Ee=this._rebound($.x,-oe.x),je=this._rebound($.y,-oe.y);return new gt(Ee,je)},_rebound:function(l,_){return l+_>0?Math.round(l-_)/2:Math.max(0,Math.ceil(l))-Math.max(0,Math.floor(_))},_limitZoom:function(l){var _=this.getMinZoom(),S=this.getMaxZoom(),B=Ve.any3d?this.options.zoomSnap:1;return B&&(l=Math.round(l/B)*B),Math.max(_,Math.min(S,l))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){On(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(l,_){var S=this._getCenterOffset(l)._trunc();return(_&&_.animate)!==!0&&!this.getSize().contains(S)?!1:(this.panBy(S,_),!0)},_createAnimProxy:function(){var l=this._proxy=Bi("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(l),this.on("zoomanim",function(_){var S=Xa,B=this._proxy.style[S];Ya(this._proxy,this.project(_.center,_.zoom),this.getZoomScale(_.zoom,1)),B===this._proxy.style[S]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){$i(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var l=this.getCenter(),_=this.getZoom();Ya(this._proxy,this.project(l,_),this.getZoomScale(_,1))},_catchTransitionEnd:function(l){this._animatingZoom&&l.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(l,_,S){if(this._animatingZoom)return!0;if(S=S||{},!this._zoomAnimated||S.animate===!1||this._nothingToAnimate()||Math.abs(_-this._zoom)>this.options.zoomAnimationThreshold)return!1;var B=this.getZoomScale(_),$=this._getCenterOffset(l)._divideBy(1-1/B);return S.animate!==!0&&!this.getSize().contains($)?!1:(Ht(function(){this._moveStart(!0,S.noMoveStart||!1)._animateZoom(l,_,!0)},this),!0)},_animateZoom:function(l,_,S,B){this._mapPane&&(S&&(this._animatingZoom=!0,this._animateToCenter=l,this._animateToZoom=_,xi(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:l,zoom:_,noUpdate:B}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(T(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&On(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function en(l,_){return new Ci(l,_)}var mr=ii.extend({options:{position:"topright"},initialize:function(l){Te(this,l)},getPosition:function(){return this.options.position},setPosition:function(l){var _=this._map;return _&&_.removeControl(this),this.options.position=l,_&&_.addControl(this),this},getContainer:function(){return this._container},addTo:function(l){this.remove(),this._map=l;var _=this._container=this.onAdd(l),S=this.getPosition(),B=l._controlCorners[S];return xi(_,"leaflet-control"),S.indexOf("bottom")!==-1?B.insertBefore(_,B.firstChild):B.appendChild(_),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?($i(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(l){this._map&&l&&l.screenX>0&&l.screenY>0&&this._map.getContainer().focus()}}),bi=function(l){return new mr(l)};Ci.include({addControl:function(l){return l.addTo(this),this},removeControl:function(l){return l.remove(),this}
vendor: 5,172 bytes, line 10
10,_initControlPos:function(){var l=this._controlCorners={},_="leaflet-",S=this._controlContainer=Bi("div",_+"control-container",this._container);function B($,oe){var Ee=_+$+" "+_+oe;l[$+oe]=Bi("div",Ee,S)}B("top","left"),B("top","right"),B("bottom","left"),B("bottom","right")},_clearControlPos:function(){for(var l in this._controlCorners)$i(this._controlCorners[l]);$i(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var pi=mr.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(l,_,S,B){return S<B?-1:B<S?1:0}},initialize:function(l,_,S){Te(this,S),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var B in l)this._addLayer(l[B],B);for(B in _)this._addLayer(_[B],B,!0)},onAdd:function(l){this._initLayout(),this._update(),this._map=l,l.on("zoomend",this._checkDisabledLayers,this);for(var _=0;_<this._layers.length;_++)this._layers[_].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(l){return mr.prototype.addTo.call(this,l),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(l,_){return this._addLayer(l,_),this._map?this._update():this},addOverlay:function(l,_){return this._addLayer(l,_,!0),this._map?this._update():this},removeLayer:function(l){l.off("add remove",this._onLayerChange,this);var _=this._getLayer(V(l));return _&&this._layers.splice(this._layers.indexOf(_),1),this._map?this._update():this},expand:function(){xi(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var l=this._map.getSize().y-(this._container.offsetTop+50);return l<this._section.clientHeight?(xi(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=l+"px"):On(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return On(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var l="leaflet-control-layers",_=this._container=Bi("div",l),S=this.options.collapsed;_.setAttribute("aria-haspopup",!0),sa(_),Hr(_);var B=this._section=Bi("section",l+"-list");S&&(this._map.on("click",this.collapse,this),Qt(_,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var $=this._layersLink=Bi("a",l+"-toggle",_);$.href="#",$.title="Layers",$.setAttribute("role","button"),Qt($,{keydown:function(oe){oe.keyCode===13&&this._expandSafely()},click:function(oe){Ti(oe),this._expandSafely()}},this),S||this.expand(),this._baseLayersList=Bi("div",l+"-base",B),this._separator=Bi("div",l+"-separator",B),this._overlaysList=Bi("div",l+"-overlays",B),_.appendChild(B)},_getLayer:function(l){for(var _=0;_<this._layers.length;_++)if(this._layers[_]&&V(this._layers[_].layer)===l)return this._layers[_]},_addLayer:function(l,_,S){this._map&&l.on("add remove",this._onLayerChange,this),this._layers.push({layer:l,name:_,overlay:S}),this.options.sortLayers&&this._layers.sort(T(function(B,$){return this.options.sortFunction(B.layer,$.layer,B.name,$.name)},this)),this.options.autoZIndex&&l.setZIndex&&(this._lastZIndex++,l.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;qr(this._baseLayersList),qr(this._overlaysList),this._layerControlInputs=[];var l,_,S,B,$=0;for(S=0;S<this._layers.length;S++)B=this._layers[S],this._addItem(B),_=_||B.overlay,l=l||!B.overlay,$+=B.overlay?0:1;return this.options.hideSingleBase&&(l=l&&$>1,this._baseLayersList.style.display=l?"":"none"),this._separator.style.display=_&&l?"":"none",this},_onLayerChange:function(l){this._handlingClick||this._update();var _=this._getLayer(V(l.target)),S=_.overlay?l.type==="add"?"overlayadd":"overlayremove":l.type==="add"?"baselayerchange":null;S&&this._map.fire(S,_)},_createRadioElement:function(l,_){var S='<input type="radio" class="leaflet-control-layers-selector" name="'+l+'"'+(_?' checked="checked"':"")+"/>",B=document.createElement("div");return B.innerHTML=S,B.firstChild},_addItem:function(l){var _=document.createElement("label"),S=this._map.hasLayer(l.layer),B;l.overlay?(B=document.createElement("input"),B.type="checkbox",B.className="leaflet-control-layers-selector",B.defaultChecked=S):B=this._createRadioElement("leaflet-base-layers_"+V(this),S),this._layerControlInputs.push(B),B.layerId=V(l.layer),Qt(B,"click",this._onInputClick,this);var $=document.createElement("span");$.innerHTML=" "+l.name;var oe=document.createElement("span");_.appendChild(oe),oe.appendChild(B),oe.appendChild($);var Ee=l.overlay?this._overlaysList:this._baseLayersList;return Ee.appendChild(_),this._checkDisabledLayers(),_},_onInputClick:function(){if(!this._preventClick){var l=this._layerControlInputs,_,S,B=[],$=[];this._handlingClick=!0;for(var oe=l.length-1;oe>=0;oe--)_=l[oe],S=this._getLayer(_.layerId).layer,_.checked?B.push(S):_.checked||$.push(S);for(oe=0;oe<$.length;oe++)this._map.hasLayer($[oe])&&this._map.removeLayer($[oe]);for(oe=0;
10oe<B.length;oe++)this._map.hasLayer(B[oe])||this._map.addLayer(B[oe]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var l=this._layerControlInputs,_,S,B=this._map.getZoom(),$=l.length-1;$>=0;$--)_=l[$],S=this._getLayer(_.layerId).layer,_.disabled=S.options.minZoom!==void 0&&B<S.options.minZoom||S.options.maxZoom!==void 0&&B>S.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var l=this._section;this._preventClick=!0,Qt(l,"click",Ti),this.expand();var _=this;setTimeout(function(){jt(l,"click",Ti),_._preventClick=!1})}}),Jo=function(l,_,S){return new pi(l,_,S)},Di=mr.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(l){var _="leaflet-control-zoom",S=Bi("div",_+" leaflet-bar"),B=this.options;return this._zoomInButton=this._createButton(B.zoomInText,B.zoomInTitle,_+"-in",S,this._zoomIn),this._zoomOutButton=this._createButton(B.zoomOutText,B.zoomOutTitle,_+"-out",S,this._zoomOut),this._updateDisabled(),l.on("zoomend zoomlevelschange",this._updateDisabled,this),S},onRemove:function(l){l.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(l){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(l.shiftKey?3:1))},_zoomOut:function(l){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(l.shiftKey?3:1))},_createButton:function(l,_,S,B,$){var oe=Bi("a",S,B);return oe.innerHTML=l,oe.href="#",oe.title=_,oe.setAttribute("role","button"),oe.setAttribute("aria-label",_),sa(oe),Qt(oe,"click",oa),Qt(oe,"click",$,this),Qt(oe,"click",this._refocusOnMap,this),oe},_updateDisabled:function(){var l=this._map,_="leaflet-disabled";On(this._zoomInButton,_),On(this._zoomOutButton,_),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||l._zoom===l.getMinZoom())&&(xi(this._zoomOutButton,_),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||l._zoom===l.getMaxZoom())&&(xi(this._zoomInButton,_),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ci.mergeOptions({zoomControl:!0}),Ci.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Di,this.addControl(this.zoomControl))});var tu=function(l){return new Di(l)},Ea=mr.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(l){var _="leaflet-control-scale",S=Bi("div",_),B=this.options;return this._addScales(B,_+"-line",S),l.on(B.updateWhenIdle?"moveend":"move",this._update,this),l.whenReady(this._update,this),S},onRemove:function(l){l.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(l,_,S){l.metric&&(this._mScale=Bi("div",_,S)),l.imperial&&(this._iScale=Bi("div",_,S))},_update:function(){var l=this._map,_=l.getSize().y/2,S=l.distance(l.containerPointToLatLng([0,_]),l.containerPointToLatLng([this.options.maxWidth,_]));this._updateScales(S)},_updateScales:function(l){this.options.metric&&l&&this._updateMetric(l),this.options.imperial&&l&&this._updateImperial(l)},_updateMetric:function(l){var _=this._getRoundNum(l),S=_<1e3?_+" m":_/1e3+" km";this._updateScale(this._mScale,S,_/l)},_updateImperial:function(l){var _=l*3.2808399,S,B,$;_>5280?(S=_/5280,B=this._getRoundNum(S),this._updateScale(this._iScale,B+" mi",B/S)):($=this._getRoundNum(_),this._updateScale(this._iScale,$+" ft",$/_))},_updateScale:function(l,_,S){l.style.width=Math.round(this.options.maxWidth*S)+"px",l.innerHTML=_},_getRoundNum:function(l){var _=Math.pow(10,(Math.floor(l)+"").length-1),S=l/_;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:1,_*S}}),wo=function(l){return new Ea(l)},To='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Vu=mr.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ve.inlineSvg?To+" ":"")+"Leaflet</a>"},initialize:function(l){Te(this,l),this._attributions={}}
10,onAdd:function(l){l.attributionControl=this,this._container=Bi("div","leaflet-control-attribution"),sa(this._container);for(var _ in l._layers)l._layers[_].getAttribution&&this.addAttribution(l._layers[_].getAttribution());return this._update(),l.on("layeradd",this._addAttribution,this),this._container},onRemove:function(l){l.off("layeradd",this._addAttribution,this)},_addAttribution:function(l){l.layer.getAttribution&&(this.addAttribution(l.layer.getAttribution()),l.layer.once("remove",function(){this.removeAttribution(l.layer.getAttribution())},this))},setPrefix:function(l){return this.options.prefix=l,this._update(),this},addAttribution:function(l){return l?(this._attributions[l]||(this._attributions[l]=0),this._attributions[l]++,this._update(),this):this},removeAttribution:function(l){return l?(this._attributions[l]&&(this._attributions[l]--,this._update()),this):this},_update:function(){if(this._map){var l=[];for(var _ in this._attributions)this._attributions[_]&&l.push(_);var S=[];this.options.prefix&&S.push(this.options.prefix),l.length&&S.push(l.join(", ")),this._container.innerHTML=S.join(' <span aria-hidden="true">|</span> ')}}});Ci.mergeOptions({attributionControl:!0}),Ci.addInitHook(function(){this.options.attributionControl&&new Vu().addTo(this)});var iu=function(l){return new Vu(l)};mr.Layers=pi,mr.Zoom=Di,mr.Scale=Ea,mr.Attribution=Vu,bi.layers=Jo,bi.zoom=tu,bi.scale=wo,bi.attribution=iu;var Da=ii.extend({initialize:function(l){this._map=l},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Da.addTo=function(l,_){return l.addHandler(_,this),this};var Hh={Events:Ke},Zu=Ve.touch?"touchstart mousedown":"mousedown",Zn=mt.extend({options:{clickTolerance:3},initialize:function(l,_,S,B){Te(this,B),this._element=l,this._dragStartTarget=_||l,this._preventOutline=S},enable:function(){this._enabled||(Qt(this._dragStartTarget,Zu,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Zn._dragging===this&&this.finishDrag(!0),jt(this._dragStartTarget,Zu,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(l){if(this._enabled&&(this._moved=!1,!Fu(this._element,"leaflet-zoom-anim"))){if(l.touches&&l.touches.length!==1){Zn._dragging===this&&this.finishDrag();return}if(!(Zn._dragging||l.shiftKey||l.which!==1&&l.button!==1&&!l.touches)&&(Zn._dragging=this,this._preventOutline&&mi(this._element),zl(),vs(),!this._moving)){this.fire("down");var _=l.touches?l.touches[0]:l,S=Uu(this._element);this._startPoint=new gt(_.clientX,_.clientY),this._startPos=yo(this._element),this._parentScale=Qo(S);var B=l.type==="mousedown";Qt(document,B?"mousemove":"touchmove",this._onMove,this),Qt(document,B?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(l){if(this._enabled){if(l.touches&&l.touches.length>1){this._moved=!0;return}var _=l.touches&&l.touches.length===1?l.touches[0]:l,S=new gt(_.clientX,_.clientY)._subtract(this._startPoint);!S.x&&!S.y||Math.abs(S.x)+Math.abs(S.y)<this.options.clickTolerance||(S.x/=this._parentScale.x,S.y/=this._parentScale.y,Ti(l),this._moved||(this.fire("dragstart"),this._moved=!0,xi(document.body,"leaflet-dragging"),this._lastTarget=l.target||l.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),xi(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(S),this._moving=!0,this._lastEvent=l,this._updatePosition())}},_updatePosition:function(){var l={originalEvent:this._lastEvent};this.fire("predrag",l),fn(this._element,this._newPos),this.fire("drag",l)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(l){On(document.body,"leaflet-dragging"),this._lastTarget&&(On(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),jt(document,"mousemove touchmove",this._onMove,this),jt(document,"mouseup touchend touchcancel",this._onUp,this),Zs(),Ma();var _=this._moved&&this._moving;this._moving=!1,Zn._dragging=!1,_&&this.fire("dragend",{noInertia:l,distance:this._newPos.distanceTo(this._startPos)})}});function Qa(l,_,S){var B,$=[1,4,2,8],oe,Ee,je,tt,vt,Rt,ni,Mi;for(oe=0,Rt=l.length;oe<Rt;
10oe++)l[oe]._code=Hs(l[oe],_);for(je=0;je<4;je++){for(ni=$[je],B=[],oe=0,Rt=l.length,Ee=Rt-1;oe<Rt;Ee=oe++)tt=l[oe],vt=l[Ee],tt._code&ni?vt._code&ni||(Mi=qs(vt,tt,ni,_,S),Mi._code=Hs(Mi,_),B.push(Mi)):(vt._code&ni&&(Mi=qs(vt,tt,ni,_,S),Mi._code=Hs(Mi,_),B.push(Mi)),B.push(tt));l=B}return l}function xn(l,_){var S,B,$,oe,Ee,je,tt,vt,Rt;if(!l||l.length===0)throw new Error("latlngs not passed");Tr(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var ni=Ct([0,0]),Mi=Pt(l),Xn=Mi.getNorthWest().distanceTo(Mi.getSouthWest())*Mi.getNorthEast().distanceTo(Mi.getNorthWest());Xn<1700&&(ni=Gs(l));var Nn=l.length,ma=[];for(S=0;S<Nn;S++){var Ki=Ct(l[S]);ma.push(_.project(Ct([Ki.lat-ni.lat,Ki.lng-ni.lng])))}for(je=tt=vt=0,S=0,B=Nn-1;S<Nn;B=S++)$=ma[S],oe=ma[B],Ee=$.y*oe.x-oe.y*$.x,tt+=($.x+oe.x)*Ee,vt+=($.y+oe.y)*Ee,je+=Ee*3;je===0?Rt=ma[0]:Rt=[tt/je,vt/je];var ji=_.unproject(It(Rt));return Ct([ji.lat+ni.lat,ji.lng+ni.lng])}function Gs(l){for(var _=0,S=0,B=0,$=0;$<l.length;$++){var oe=Ct(l[$]);_+=oe.lat,S+=oe.lng,B++}return Ct([_/B,S/B])}var nu={__proto__:null,clipPolygon:Qa,polygonCenter:xn,centroid:Gs};function Ll(l,_){if(!_||!l.length)return l.slice();var S=_*_;return l=$h(l,S),l=Gu(l,S),l}function Pn(l,_,S){return Math.sqrt(xs(l,_,S,!0))}function nh(l,_,S){return xs(l,_,S)}function Gu(l,_){var S=l.length,B=typeof Uint8Array<"u"?Uint8Array:Array,$=new B(S);$[0]=$[S-1]=1,qu(l,$,_,0,S-1);var oe,Ee=[];for(oe=0;oe<S;oe++)$[oe]&&Ee.push(l[oe]);return Ee}function qu(l,_,S,B,$){var oe=0,Ee,je,tt;for(je=B+1;je<=$-1;je++)tt=xs(l[je],l[B],l[$],!0),tt>oe&&(Ee=je,oe=tt);oe>S&&(_[Ee]=1,qu(l,_,S,B,Ee),qu(l,_,S,Ee,$))}function $h(l,_){for(var S=[l[0]],B=1,$=0,oe=l.length;B<oe;B++)au(l[B],l[$])>_&&(S.push(l[B]),$=B);return $<oe-1&&S.push(l[oe-1]),S}var el;function ru(l,_,S,B,$){var oe=B?el:Hs(l,S),Ee=Hs(_,S),je,tt,vt;for(el=Ee;;){if(!(oe|Ee))return[l,_];if(oe&Ee)return!1;je=oe||Ee,tt=qs(l,_,je,S,$),vt=Hs(tt,S),je===oe?(l=tt,oe=vt):(_=tt,Ee=vt)}}function qs(l,_,S,B,$){var oe=_.x-l.x,Ee=_.y-l.y,je=B.min,tt=B.max,vt,Rt;return S&8?(vt=l.x+oe*(tt.y-l.y)/Ee,Rt=tt.y):S&4?(vt=l.x+oe*(je.y-l.y)/Ee,Rt=je.y):S&2?(vt=tt.x,Rt=l.y+Ee*(tt.x-l.x)/oe):S&1&&(vt=je.x,Rt=l.y+Ee*(je.x-l.x)/oe),new gt(vt,Rt,$)}function Hs(l,_){var S=0;return l.x<_.min.x?S|=1:l.x>_.max.x&&(S|=2),l.y<_.min.y?S|=4:l.y>_.max.y&&(S|=8),S}function au(l,_){var S=_.x-l.x,B=_.y-l.y;return S*S+B*B}function xs(l,_,S,B){var $=_.x,oe=_.y,Ee=S.x-$,je=S.y-oe,tt=Ee*Ee+je*je,vt;return tt>0&&(vt=((l.x-$)*Ee+(l.y-oe)*je)/tt,vt>1?($=S.x,oe=S.y):vt>0&&($+=Ee*vt,oe+=je*vt)),Ee=l.x-$,je=l.y-oe,B?Ee*Ee+je*je:new gt($,oe)}function Tr(l){return!dt(l[0])||typeof l[0][0]!="object"&&typeof l[0][0]<"u"}function Bn(l){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Tr(l)}function tl(l,_){var S,B,$,oe,Ee,je,tt,vt;if(!l||l.length===0)throw new Error("latlngs not passed");Tr(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var Rt=Ct([0,0]),ni=Pt(l),Mi=ni.getNorthWest().distanceTo(ni.getSouthWest
10())*ni.getNorthEast().distanceTo(ni.getNorthWest());Mi<1700&&(Rt=Gs(l));var Xn=l.length,Nn=[];for(S=0;S<Xn;S++){var ma=Ct(l[S]);Nn.push(_.project(Ct([ma.lat-Rt.lat,ma.lng-Rt.lng])))}for(S=0,B=0;S<Xn-1;S++)B+=Nn[S].distanceTo(Nn[S+1])/2;if(B===0)vt=Nn[0];else for(S=0,oe=0;S<Xn-1;S++)if(Ee=Nn[S],je=Nn[S+1],$=Ee.distanceTo(je),oe+=$,oe>B){tt=(oe-B)/$,vt=[je.x-tt*(je.x-Ee.x),je.y-tt*(je.y-Ee.y)];break}var Ki=_.unproject(It(vt));return Ct([Ki.lat+Rt.lat,Ki.lng+Rt.lng])}var Dl={__proto__:null,simplify:Ll,pointToSegmentDistance:Pn,closestPointOnSegment:nh,clipSegment:ru,_getEdgeIntersection:qs,_getBitCode:Hs,_sqClosestPointOnSegment:xs,isFlat:Tr,_flat:Bn,polylineCenter:tl},So={project:function(l){return new gt(l.lng,l.lat)},unproject:function(l){return new St(l.y,l.x)},bounds:new ze([-180,-90],[180,90])},bs={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ze([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(l){var _=Math.PI/180,S=this.R,B=l.lat*_,$=this.R_MINOR/S,oe=Math.sqrt(1-$*$),Ee=oe*Math.sin(B),je=Math.tan(Math.PI/4-B/2)/Math.pow((1-Ee)/(1+Ee),oe/2);return B=-S*Math.log(Math.max(je,1e-10)),new gt(l.lng*_*S,B)},unproject:function(l){for(var _=180/Math.PI,S=this.R,B=this.R_MINOR/S,$=Math.sqrt(1-B*B),oe=Math.exp(-l.y/S),Ee=Math.PI/2-2*Math.atan(oe),je=0,tt=.1,vt;je<15&&Math.abs(tt)>1e-7;je++)vt=$*Math.sin(Ee),vt=Math.pow((1-vt)/(1+vt),$/2),tt=Math.PI/2-2*Math.atan(oe*vt)-Ee,Ee+=tt;return new St(Ee*_,l.x*_/S)}},rh={__proto__:null,LonLat:So,Mercator:bs,SphericalMercator:vr},su=N({},wi,{code:"EPSG:3395",projection:bs,transformation:(function(){var l=.5/(Math.PI*bs.R);return xr(l,.5,-l,.5)})()}),Tc=N({},wi,{code:"EPSG:4326",projection:So,transformation:xr(1/180,1,-1/180,.5)}),Ja=N({},ri,{projection:So,transformation:xr(1,0,-1,0),scale:function(l){return Math.pow(2,l)},zoom:function(l){return Math.log(l)/Math.LN2},distance:function(l,_){var S=_.lng-l.lng,B=_.lat-l.lat;return Math.sqrt(S*S+B*B)},infinite:!0});ri.Earth=wi,ri.EPSG3395=su,ri.EPSG3857=Ho,ri.EPSG900913=En,ri.EPSG4326=Tc,ri.Simple=Ja;var ua=mt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(l){return l.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(l){return l&&l.removeLayer(this),this},getPane:function(l){return this._map.getPane(l?this.options[l]||l:this.options.pane)},addInteractiveTarget:function(l){return this._map._targets[V(l)]=this,this},removeInteractiveTarget:function(l){return delete this._map._targets[V(l)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(l){var _=l.target;if(_.hasLayer(this)){if(this._map=_,this._zoomAnimated=_._zoomAnimated,this.getEvents){var S=this.getEvents();_.on(S,this),this.once("remove",function(){_.off(S,this)},this)}this.onAdd(_),this.fire("add"),_.fire("layeradd",{layer:this})}}});Ci.include({addLayer:function(l){if(!l._layerAdd)throw new Error("The provided object is not a Layer.");var _=V(l);return this._layers[_]?this:(this._layers[_]=l,l._mapToAdd=this,l.beforeAdd&&l.beforeAdd(this),this.whenReady(l._layerAdd,l),this)},removeLayer:function(l){var _=V(l);return this._layers[_]?(this._loaded&&l.onRemove(this),delete this._layers[_],this._loaded&&(this.fire("layerremove",{layer:l}),l.fire("remove")),l._map=l._mapToAdd=null,this):this},hasLayer:function(l){return V(l)in this._layers},eachLayer:function(l,_){for(var S in this._layers)l.call(_,this._layers[S]);return this},_addLayers:function(l){l=l?dt(l)?l:[l]:[];for(var _=0,S=l.length;_<S;_++)this.addLayer(l[_])},_addZoomLimit:function(l){(!isNaN(l.options.maxZoom)||!isNaN(l.options.minZoom))&&(this._zoomBoundLayers[V(l)]=l,this._updateZoomLevels())},_removeZoomLimit:function(l){var _=V(l);this._zoomBoundLayers[_]&&(delete this._zoomBoundLayers[_],this._updateZoomLevels())},_updateZoomLevels:function(){var l=1/0,_=-1/0,S=this._getZoomSpan();for(var B in this._zoomBoundLayers){var $=this._zoomBoundLayers[B].options;l=$.minZoom===void 0?l:Math.min(l,$.minZoom),_=$.maxZoom===void 0?_:Math.max(_,$.maxZoom)}
10this._layersMaxZoom=_===-1/0?void 0:_,this._layersMinZoom=l===1/0?void 0:l,S!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var il=ua.extend({initialize:function(l,_){Te(this,_),this._layers={};var S,B;if(l)for(S=0,B=l.length;S<B;S++)this.addLayer(l[S])},addLayer:function(l){var _=this.getLayerId(l);return this._layers[_]=l,this._map&&this._map.addLayer(l),this},removeLayer:function(l){var _=l in this._layers?l:this.getLayerId(l);return this._map&&this._layers[_]&&this._map.removeLayer(this._layers[_]),delete this._layers[_],this},hasLayer:function(l){var _=typeof l=="number"?l:this.getLayerId(l);return _ in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(l){var _=Array.prototype.slice.call(arguments,1),S,B;for(S in this._layers)B=this._layers[S],B[l]&&B[l].apply(B,_);return this},onAdd:function(l){this.eachLayer(l.addLayer,l)},onRemove:function(l){this.eachLayer(l.removeLayer,l)},eachLayer:function(l,_){for(var S in this._layers)l.call(_,this._layers[S]);return this},getLayer:function(l){return this._layers[l]},getLayers:function(){var l=[];return this.eachLayer(l.push,l),l},setZIndex:function(l){return this.invoke("setZIndex",l)},getLayerId:function(l){return V(l)}}),ah=function(l,_){return new il(l,_)},Ia=il.extend({addLayer:function(l){return this.hasLayer(l)?this:(l.addEventParent(this),il.prototype.addLayer.call(this,l),this.fire("layeradd",{layer:l}))},removeLayer:function(l){return this.hasLayer(l)?(l in this._layers&&(l=this._layers[l]),l.removeEventParent(this),il.prototype.removeLayer.call(this,l),this.fire("layerremove",{layer:l})):this},setStyle:function(l){return this.invoke("setStyle",l)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var l=new Et;for(var _ in this._layers){var S=this._layers[_];l.extend(S.getBounds?S.getBounds():S.getLatLng())}return l}}),Hu=function(l,_){return new Ia(l,_)},ka=ii.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(l){Te(this,l)},createIcon:function(l){return this._createIcon("icon",l)},createShadow:function(l){return this._createIcon("shadow",l)},_createIcon:function(l,_){var S=this._getIconUrl(l);if(!S){if(l==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var B=this._createImg(S,_&&_.tagName==="IMG"?_:null);return this._setIconStyles(B,l),(this.options.crossOrigin||this.options.crossOrigin==="")&&(B.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),B},_setIconStyles:function(l,_){var S=this.options,B=S[_+"Size"];typeof B=="number"&&(B=[B,B]);var $=It(B),oe=It(_==="shadow"&&S.shadowAnchor||S.iconAnchor||$&&$.divideBy(2,!0));l.className="leaflet-marker-"+_+" "+(S.className||""),oe&&(l.style.marginLeft=-oe.x+"px",l.style.marginTop=-oe.y+"px"),$&&(l.style.width=$.x+"px",l.style.height=$.y+"px")},_createImg:function(l,_){return _=_||document.createElement("img"),_.src=l,_},_getIconUrl:function(l){return Ve.retina&&this.options[l+"RetinaUrl"]||this.options[l+"Url"]}});function Il(l){return new ka(l)}var kl=ka.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(l){return typeof kl.imagePath!="string"&&(kl.imagePath=this._detectIconPath()),(this.options.imagePath||kl.imagePath)+ka.prototype._getIconUrl.call(this,l)},_stripUrl:function(l){var _=function(S,B,$){var oe=B.exec(S);return oe&&oe[$]};return l=_(l,/^url\((['"])?(.+)\1\)$/,2),l&&_(l,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var l=Bi("div","leaflet-default-icon-path",document.body),_=Gr(l,"background-image")||Gr(l,"backgroundImage");if(document.body.removeChild(l),_=this._stripUrl(_),_)return _;var S=document.querySelector('link[href$="leaflet.css"]');return S?S.href.substring(0,S.href.length-11-1):""}}),Rl=Da.extend({initialize:function(l){this._marker=l},addHooks:function(){var l=this._marker._icon;this._draggable||(this._draggable=new Zn(l,l,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),xi(l,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&On(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(l){var _=this._marker,S=_._map,B=this._marker.options.autoPanSpeed,$=this._marker.options.autoPanPadding,oe=yo(_._icon),Ee=S.getPixelBounds(),je=S.getPixelOrigin(),tt=rt(Ee.min._subtract(je).add($),Ee.max._subtract(je).subtract($));if(!tt.contains(oe)){var vt=It((Math.max(tt.max.x,oe.x)-tt.max.x)/(Ee.max.x-tt.max.x)-(Math.min(tt.min.x,oe.x)-tt.min.x)/(Ee.min.x-tt.min.x),(Math.max(tt.max.y,oe.y)-tt.max.y)/(Ee.max.y-tt.max.y)-(Math.min(tt.min.y,oe.y)-tt.min.y)/(Ee.min.y-tt.min.y)).multiplyBy(B);S.panBy(vt,{animate:!1}),this._draggable._newPos._add(vt),this._draggable._startPos._add(vt),fn(_._icon,this._draggable._newPos),this._onDrag(l),this._panRequest=Ht(this._adjustPan.bind(this,l))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(l){this._marker.options.autoPan&&(Xt(this._panRequest),this._panRequest=Ht(this._adjustPan.bind(this,l)))},_onDrag:function(l){var _=this._marker,S=_._shadow,B=yo(_._icon),$=_._map.layerPointToLatLng(B);S&&fn(S,B),_._latlng=$,l.latlng=$,l.oldLatLng=this._oldLatLng,_.fire("move",l).fire("drag",l)}
vendor: 8,149 bytes, line 10
10,_onDragEnd:function(l){Xt(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",l)}}),es=ua.extend({options:{icon:new kl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(l,_){Te(this,_),this._latlng=Ct(l)},onAdd:function(l){this._zoomAnimated=this._zoomAnimated&&l.options.markerZoomAnimation,this._zoomAnimated&&l.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(l){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&l.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(l){var _=this._latlng;return this._latlng=Ct(l),this.update(),this.fire("move",{oldLatLng:_,latlng:this._latlng})},setZIndexOffset:function(l){return this.options.zIndexOffset=l,this.update()},getIcon:function(){return this.options.icon},setIcon:function(l){return this.options.icon=l,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var l=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(l)}return this},_initIcon:function(){var l=this.options,_="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),S=l.icon.createIcon(this._icon),B=!1;S!==this._icon&&(this._icon&&this._removeIcon(),B=!0,l.title&&(S.title=l.title),S.tagName==="IMG"&&(S.alt=l.alt||"")),xi(S,_),l.keyboard&&(S.tabIndex="0",S.setAttribute("role","button")),this._icon=S,l.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Qt(S,"focus",this._panOnFocus,this);var $=l.icon.createShadow(this._shadow),oe=!1;$!==this._shadow&&(this._removeShadow(),oe=!0),$&&(xi($,_),$.alt=""),this._shadow=$,l.opacity<1&&this._updateOpacity(),B&&this.getPane().appendChild(this._icon),this._initInteraction(),$&&oe&&this.getPane(l.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&jt(this._icon,"focus",this._panOnFocus,this),$i(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&$i(this._shadow),this._shadow=null},_setPos:function(l){this._icon&&fn(this._icon,l),this._shadow&&fn(this._shadow,l),this._zIndex=l.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(l){this._icon&&(this._icon.style.zIndex=this._zIndex+l)},_animateZoom:function(l){var _=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center).round();this._setPos(_)},_initInteraction:function(){if(this.options.interactive&&(xi(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Rl)){var l=this.options.draggable;this.dragging&&(l=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Rl(this),l&&this.dragging.enable()}},setOpacity:function(l){return this.options.opacity=l,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var l=this.options.opacity;this._icon&&vn(this._icon,l),this._shadow&&vn(this._shadow,l)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var l=this._map;if(l){var _=this.options.icon.options,S=_.iconSize?It(_.iconSize):It(0,0),B=_.iconAnchor?It(_.iconAnchor):It(0,0);l.panInside(this._latlng,{paddingTopLeft:B,paddingBottomRight:S.subtract(B)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Sc(l,_){return new es(l,_)}var Ra=ua.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(l){this._renderer=l.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(l){return Te(this,l),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&l&&Object.prototype.hasOwnProperty.call(l,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ts=Ra.extend({options:{fill:!0,radius:10},initialize:function(l,_){Te(this,_),this._latlng=Ct(l),this._radius=this.options.radius},setLatLng:function(l){var _=this._latlng;return this._latlng=Ct(l),this.redraw(),this.fire("move",{oldLatLng:_,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(l){return this.options.radius=this._radius=l,this.redraw()},getRadius:function(){return this._radius},setStyle:function(l){var _=l&&l.radius||this._radius;return Ra.prototype.setStyle.call(this,l),this.setRadius(_),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var l=this._radius,_=this._radiusY||l,S=this._clickTolerance(),B=[l+S,_+S];this._pxBounds=new ze(this._point.subtract(B),this._point.add(B))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(l){return l.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Cc(l,_){return new ts(l,_)}var nl=ts.extend({initialize:function(l,_,S){if(typeof _=="number"&&(_=N({},S,{radius:_})),Te(this,_),this._latlng=Ct(l),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(l){return this._mRadius=l,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var l=[this._radius,this._radiusY||this._radius];return new Et(this._map.layerPointToLatLng(this._point.subtract(l)),this._map.layerPointToLatLng(this._point.add(l)))},setStyle:Ra.prototype.setStyle,_project:function(){var l=this._latlng.lng,_=this._latlng.lat,S=this._map,B=S.options.crs;if(B.distance===wi.distance){var $=Math.PI/180,oe=this._mRadius/wi.R/$,Ee=S.project([_+oe,l]),je=S.project([_-oe,l]),tt=Ee.add(je).divideBy(2),vt=S.unproject(tt).lat,Rt=Math.acos((Math.cos(oe*$)-Math.sin(_*$)*Math.sin(vt*$))/(Math.cos(_*$)*Math.cos(vt*$)))/$;(isNaN(Rt)||Rt===0)&&(Rt=oe/Math.cos(Math.PI/180*_)),this._point=tt.subtract(S.getPixelOrigin()),this._radius=isNaN(Rt)?0:tt.x-S.project([vt,l-Rt]).x,this._radiusY=tt.y-Ee.y}else{var ni=B.unproject(B.project(this._latlng).subtract([this._mRadius,0]));this._point=S.latLngToLayerPoint(this._latlng),this._radius=this._point.x-S.latLngToLayerPoint(ni).x}this._updateBounds()}});function sh(l,_,S){return new nl(l,_,S)}var $s=Ra.extend({options:{smoothFactor:1,noClip:!1},initialize:function(l,_){Te(this,_),this._setLatLngs(l)},getLatLngs:function(){return this._latlngs},setLatLngs:function(l){return this._setLatLngs(l),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(l){for(var _=1/0,S=null,B=xs,$,oe,Ee=0,je=this._parts.length;Ee<je;Ee++)for(var tt=this._parts[Ee],vt=1,Rt=tt.length;vt<Rt;vt++){$=tt[vt-1],oe=tt[vt];var ni=B(l,$,oe,!0);ni<_&&(_=ni,S=B(l,$,oe))}return S&&(S.distance=Math.sqrt(_)),S}
10,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return tl(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(l,_){return _=_||this._defaultShape(),l=Ct(l),_.push(l),this._bounds.extend(l),this.redraw()},_setLatLngs:function(l){this._bounds=new Et,this._latlngs=this._convertLatLngs(l)},_defaultShape:function(){return Tr(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(l){for(var _=[],S=Tr(l),B=0,$=l.length;B<$;B++)S?(_[B]=Ct(l[B]),this._bounds.extend(_[B])):_[B]=this._convertLatLngs(l[B]);return _},_project:function(){var l=new ze;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,l),this._bounds.isValid()&&l.isValid()&&(this._rawPxBounds=l,this._updateBounds())},_updateBounds:function(){var l=this._clickTolerance(),_=new gt(l,l);this._rawPxBounds&&(this._pxBounds=new ze([this._rawPxBounds.min.subtract(_),this._rawPxBounds.max.add(_)]))},_projectLatlngs:function(l,_,S){var B=l[0]instanceof St,$=l.length,oe,Ee;if(B){for(Ee=[],oe=0;oe<$;oe++)Ee[oe]=this._map.latLngToLayerPoint(l[oe]),S.extend(Ee[oe]);_.push(Ee)}else for(oe=0;oe<$;oe++)this._projectLatlngs(l[oe],_,S)},_clipPoints:function(){var l=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}var _=this._parts,S,B,$,oe,Ee,je,tt;for(S=0,$=0,oe=this._rings.length;S<oe;S++)for(tt=this._rings[S],B=0,Ee=tt.length;B<Ee-1;B++)je=ru(tt[B],tt[B+1],l,B,!0),je&&(_[$]=_[$]||[],_[$].push(je[0]),(je[1]!==tt[B+1]||B===Ee-2)&&(_[$].push(je[1]),$++))}},_simplifyPoints:function(){for(var l=this._parts,_=this.options.smoothFactor,S=0,B=l.length;S<B;S++)l[S]=Ll(l[S],_)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(l,_){var S,B,$,oe,Ee,je,tt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(S=0,oe=this._parts.length;S<oe;S++)for(je=this._parts[S],B=0,Ee=je.length,$=Ee-1;B<Ee;$=B++)if(!(!_&&B===0)&&Pn(l,je[$],je[B])<=tt)return!0;return!1}});function oh(l,_){return new $s(l,_)}$s._flat=Bn;var ws=$s.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
10,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return xn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(l){var _=$s.prototype._convertLatLngs.call(this,l),S=_.length;return S>=2&&_[0]instanceof St&&_[0].equals(_[S-1])&&_.pop(),_},_setLatLngs:function(l){$s.prototype._setLatLngs.call(this,l),Tr(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Tr(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var l=this._renderer._bounds,_=this.options.weight,S=new gt(_,_);if(l=new ze(l.min.subtract(S),l.max.add(S)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}for(var B=0,$=this._rings.length,oe;B<$;B++)oe=Qa(this._rings[B],l,!0),oe.length&&this._parts.push(oe)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(l){var _=!1,S,B,$,oe,Ee,je,tt,vt;if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(oe=0,tt=this._parts.length;oe<tt;oe++)for(S=this._parts[oe],Ee=0,vt=S.length,je=vt-1;Ee<vt;je=Ee++)B=S[Ee],$=S[je],B.y>l.y!=$.y>l.y&&l.x<($.x-B.x)*(l.y-B.y)/($.y-B.y)+B.x&&(_=!_);return _||$s.prototype._containsPoint.call(this,l,!0)}});function lh(l,_){return new ws(l,_)}var is=Ia.extend({initialize:function(l,_){Te(this,_),this._layers={},l&&this.addData(l)},addData:function(l){var _=dt(l)?l:l.features,S,B,$;if(_){for(S=0,B=_.length;S<B;S++)$=_[S],($.geometries||$.geometry||$.features||$.coordinates)&&this.addData($);return this}var oe=this.options;if(oe.filter&&!oe.filter(l))return this;var Ee=Sr(l,oe);return Ee?(Ee.feature=al(l),Ee.defaultOptions=Ee.options,this.resetStyle(Ee),oe.onEachFeature&&oe.onEachFeature(l,Ee),this.addLayer(Ee)):this},resetStyle:function(l){return l===void 0?this.eachLayer(this.resetStyle,this):(l.options=N({},l.defaultOptions),this._setLayerStyle(l,this.options.style),this)},setStyle:function(l){return this.eachLayer(function(_){this._setLayerStyle(_,l)},this)},_setLayerStyle:function(l,_){l.setStyle&&(typeof _=="function"&&(_=_(l.feature)),l.setStyle(_))}});function Sr(l,_){var S=l.type==="Feature"?l.geometry:l,B=S?S.coordinates:null,$=[],oe=_&&_.pointToLayer,Ee=_&&_.coordsToLatLng||ca,je,tt,vt,Rt;if(!B&&!S)return null;switch(S.type){case"Point":return je=Ee(B),Xs(oe,l,je,_);case"MultiPoint":for(vt=0,Rt=B.length;vt<Rt;vt++)je=Ee(B[vt]),$.push(Xs(oe,l,je,_));return new Ia($);case"LineString":case"MultiLineString":return tt=Co(B,S.type==="LineString"?0:1,Ee),new $s(tt,_);case"Polygon":case"MultiPolygon":return tt=Co(B,S.type==="Polygon"?1:2,Ee),new ws(tt,_);case"GeometryCollection":for(vt=0,Rt=S.geometries.length;vt<Rt;vt++){var ni=Sr({geometry:S.geometries[vt],type:"Feature",properties:l.properties},_);ni&&$.push(ni)}return new Ia($);case"FeatureCollection":for(vt=0,Rt=S.features.length;vt<Rt;vt++){var Mi=Sr(S.features[vt],_);Mi&&$.push(Mi)}return new Ia($);default:throw new Error("Invalid GeoJSON object.")}}function Xs(l,_,S,B){return l?l(_,S):new es(S,B&&B.markersInheritOptions&&B)}function ca(l){return new St(l[1],l[0],l[2])}function Co(l,_,S){for(var B=[],$=0,oe=l.length,Ee;$<oe;$++)Ee=_?Co(l[$],_-1,S):(S||ca)(l[$]),B.push(Ee);return B}function Ol(l,_){return l=Ct(l),l.alt!==void 0?[ye(l.lng,_),ye(l.lat,_),ye(l.alt,_)]:[ye(l.lng,_),ye(l.lat,_)]}function rl(l,_,S,B){for(var $=[],oe=0,Ee=l.length;oe<Ee;oe++)$.push(_?rl(l[oe],Tr(l[oe])?0:_-1,S,B):Ol(l[oe],B));return!_&&S&&$.length>0&&$.push($[0].slice()),$}function Ts(l,_){return l.feature?N({},l.feature,{geometry:_}):al(_)}function al(l){return l.type==="Feature"||l.type==="FeatureCollection"?l:{type:"Feature",properties:{},geometry:l}}var ha={toGeoJSON:function(l){return Ts(this,{type:"Point",coordinates:Ol(this.getLatLng(),l)})}};es.include(ha),nl.include(ha),ts.include(ha),$s.include({toGeoJSON:function(l){var _=!Tr(this._latlngs),S=rl(this._latlngs,_?1:0,!1,l);return Ts(this,{type:(_?"Multi":"")+"LineString",coordinates:S})}}),ws.include({toGeoJSON:function(l){var _=!Tr(this._latlngs),S=_&&!Tr(this._latlngs[0]),B=rl(this._latlngs,S?2:_?1:0,!0,l);return _||(B=[B]),Ts(this,{type:(S?"Multi":"")+"Polygon",coordinates:B})}}),il.include({toMultiPoint:function(l){var _=[];return this.eachLayer(function(S){_.push(S.toGeoJSON(l).geometry.coordinates)}),Ts(this,{type:"MultiPoint",coordinates:_})},toGeoJSON:function(l){var _=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(_==="MultiPoint")return this.toMultiPoint(l);var S=_==="GeometryCollection",B=[];return this.eachLayer(function($){if($.toGeoJSON){var oe=$.toGeoJSON(l);if(S)B.push(oe.geometry);else{var Ee=al(oe);Ee.type==="FeatureCollection"?B.push.apply(B,Ee.features):B.push(Ee)}}}),S?Ts(this,{geometries:B,type:"GeometryCollection"}):{type:"FeatureCollection",features:B}}});function Bl(l,_){return new is(l,_)}var ou=Bl,sl=ua.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(l,_,S){this._url=l,this._bounds=Pt(_),Te(this,S)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(xi(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){$i(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(l){return this.options.opacity=l,this._image&&this._updateOpacity(),this},setStyle:function(l){return l.opacity&&this.setOpacity(l.opacity),this},bringToFront:function(){return this._map&&zi(this._image),this},bringToBack:function(){return this._map&&_o(this._image),this},setUrl:function(l){return this._url=l,this._image&&(this._image.src=l),this},setBounds:function(l){return this._bounds=Pt(l),this._map&&this._reset(),this},getEvents:function(){var l={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var l=this._url.tagName==="IMG",_=this._image=l?this._url:Bi("img");if(xi(_,"leaflet-image-layer"),this._zoomAnimated&&xi(_,"leaflet-zoom-animated"),this.options.className&&xi(_,this.options.className),_.onselectstart=ne,_.onmousemove=ne,_.onload=T(this.fire,this,"load"),_.onerror=T(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),l){this._url=_.src;return}_.src=this._url,_.alt=this.options.alt},_animateZoom:function(l){var _=this._map.getZoomScale(l.zoom),S=this._map._latLngBoundsToNewLayerBounds(this._bounds,l.zoom,l.center).min;Ya(this._image,S,_)},_reset:function(){var l=this._image,_=new ze(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),S=_.getSize();fn(l,_.min),l.style.width=S.x+"px",l.style.height=S.y+"px"},_updateOpacity:function(){vn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var l=this.options.errorOverlayUrl;l&&this._url!==l&&(this._url=l,this._image.src=l)},getCenter:function(){return this._bounds.getCenter()}}),uh=function(l,_,S){return new sl(l,_,S)},Mo=sl.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
10ine:!0},_initImage:function(){var l=this._url.tagName==="VIDEO",_=this._image=l?this._url:Bi("video");if(xi(_,"leaflet-image-layer"),this._zoomAnimated&&xi(_,"leaflet-zoom-animated"),this.options.className&&xi(_,this.options.className),_.onselectstart=ne,_.onmousemove=ne,_.onloadeddata=T(this.fire,this,"load"),l){for(var S=_.getElementsByTagName("source"),B=[],$=0;$<S.length;$++)B.push(S[$].src);this._url=S.length>0?B:[_.src];return}dt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(_.style,"objectFit")&&(_.style.objectFit="fill"),_.autoplay=!!this.options.autoplay,_.loop=!!this.options.loop,_.muted=!!this.options.muted,_.playsInline=!!this.options.playsInline;for(var oe=0;oe<this._url.length;oe++){var Ee=Bi("source");Ee.src=this._url[oe],_.appendChild(Ee)}}});function ol(l,_,S){return new Mo(l,_,S)}var $u=sl.extend({_initImage:function(){var l=this._image=this._url;xi(l,"leaflet-image-layer"),this._zoomAnimated&&xi(l,"leaflet-zoom-animated"),this.options.className&&xi(l,this.options.className),l.onselectstart=ne,l.onmousemove=ne}});function Fi(l,_,S){return new $u(l,_,S)}var lr=ua.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(l,_){l&&(l instanceof St||dt(l))?(this._latlng=Ct(l),Te(this,_)):(Te(this,l),this._source=_),this.options.content&&(this._content=this.options.content)},openOn:function(l){return l=arguments.length?l:this._source._map,l.hasLayer(this)||l.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(l){return this._map?this.close():(arguments.length?this._source=l:l=this._source,this._prepareOpen(),this.openOn(l._map)),this},onAdd:function(l){this._zoomAnimated=l._zoomAnimated,this._container||this._initLayout(),l._fadeAnimated&&vn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),l._fadeAnimated&&vn(this._container,1),this.bringToFront(),this.options.interactive&&(xi(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(l){l._fadeAnimated?(vn(this._container,0),this._removeTimeout=setTimeout(T($i,void 0,this._container),200)):$i(this._container),this.options.interactive&&(On(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(l){return this._latlng=Ct(l),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(l){return this._content=l,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var l={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&zi(this._container),this},bringToBack:function(){return this._map&&_o(this._container),this},_prepareOpen:function(l){var _=this._source;if(!_._map)return!1;if(_ instanceof Ia){_=null;var S=this._source._layers;for(var B in S)if(S[B]._map){_=S[B];break}if(!_)return!1;this._source=_}if(!l)if(_.getCenter)l=_.getCenter();else if(_.getLatLng)l=_.getLatLng();else if(_.getBounds)l=_.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(l),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var l=this._contentNode,_=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof _=="string")l.innerHTML=_;else{for(;l.hasChildNodes();)l.removeChild(l.firstChild);l.appendChild(_)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var l=this._map.latLngToLayerPoint(this._latlng),_=It(this.options.offset),S=this._getAnchor();this._zoomAnimated?fn(this._container,l.add(S)):_=_.add(l).add(S);var B=this._containerBottom=-_.y,$=this._containerLeft=-Math.round(this._containerWidth/2)+_.x;this._container.style.bottom=B+"px",this._container.style.left=$+"px"}},_getAnchor:function(){return[0,0]}});Ci.include({_initOverlay:function(l,_,S,B){var $=_;return $ instanceof l||($=new l(B).setContent(_)),S&&$.setLatLng(S),$}}),ua.include({_initOverlay:function(l,_,S,B){var $=S;return $ instanceof l?(Te($,B),$._source=this):($=_&&!B?_:new l(B,this),$.setContent(S)),$}});var Eo=lr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(l){return l=arguments.length?l:this._source._map,!l.hasLayer(this)&&l._popup&&l._popup.options.autoClose&&l.removeLayer(l._popup),l._popup=this,lr.prototype.openOn.call(this,l)},onAdd:function(l){lr.prototype.onAdd.call(this,l),l.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ra||this._source.on("preclick",Tn))},onRemove:function(l){lr.prototype.onRemove.call(this,l),l.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ra||this._source.off("preclick",Tn))},getEvents:function(){var l=lr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(l.preclick=this.close),this.options.keepInView&&
10(l.moveend=this._adjustPan),l},_initLayout:function(){var l="leaflet-popup",_=this._container=Bi("div",l+" "+(this.options.className||"")+" leaflet-zoom-animated"),S=this._wrapper=Bi("div",l+"-content-wrapper",_);if(this._contentNode=Bi("div",l+"-content",S),sa(_),Hr(this._contentNode),Qt(_,"contextmenu",Tn),this._tipContainer=Bi("div",l+"-tip-container",_),this._tip=Bi("div",l+"-tip",this._tipContainer),this.options.closeButton){var B=this._closeButton=Bi("a",l+"-close-button",_);B.setAttribute("role","button"),B.setAttribute("aria-label","Close popup"),B.href="#close",B.innerHTML='<span aria-hidden="true">&#215;</span>',Qt(B,"click",function($){Ti($),this.close()},this)}},_updateLayout:function(){var l=this._contentNode,_=l.style;_.width="",_.whiteSpace="nowrap";var S=l.offsetWidth;S=Math.min(S,this.options.maxWidth),S=Math.max(S,this.options.minWidth),_.width=S+1+"px",_.whiteSpace="",_.height="";var B=l.offsetHeight,$=this.options.maxHeight,oe="leaflet-popup-scrolled";$&&B>$?(_.height=$+"px",xi(l,oe)):On(l,oe),this._containerWidth=this._container.offsetWidth},_animateZoom:function(l){var _=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center),S=this._getAnchor();fn(this._container,_.add(S))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var l=this._map,_=parseInt(Gr(this._container,"marginBottom"),10)||0,S=this._container.offsetHeight+_,B=this._containerWidth,$=new gt(this._containerLeft,-S-this._containerBottom);$._add(yo(this._container));var oe=l.layerPointToContainerPoint($),Ee=It(this.options.autoPanPadding),je=It(this.options.autoPanPaddingTopLeft||Ee),tt=It(this.options.autoPanPaddingBottomRight||Ee),vt=l.getSize(),Rt=0,ni=0;oe.x+B+tt.x>vt.x&&(Rt=oe.x+B-vt.x+tt.x),oe.x-Rt-je.x<0&&(Rt=oe.x-je.x),oe.y+S+tt.y>vt.y&&(ni=oe.y+S-vt.y+tt.y),oe.y-ni-je.y<0&&(ni=oe.y-je.y),(Rt||ni)&&(this.options.keepInView&&(this._autopanning=!0),l.fire("autopanstart").panBy([Rt,ni]))}},_getAnchor:function(){return It(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),lu=function(l,_){return new Eo(l,_)};Ci.mergeOptions({closePopupOnClick:!0}),Ci.include({openPopup:function(l,_,S){return this._initOverlay(Eo,l,_,S).openOn(this),this},closePopup:function(l){return l=arguments.length?l:this._popup,l&&l.close(),this}}),ua.include({bindPopup:function(l,_){return this._popup=this._initOverlay(Eo,this._popup,l,_),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(l){return this._popup&&(this instanceof Ia||(this._popup._source=this),this._popup._prepareOpen(l||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(l){return this._popup&&this._popup.setContent(l),this},getPopup:function(){return this._popup},_openPopup:function(l){if(!(!this._popup||!this._map)){oa(l);var _=l.layer||l.target;if(this._popup._source===_&&!(_ instanceof Ra)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(l.latlng);return}this._popup._source=_,this.openPopup(l.latlng)}},_movePopup:function(l){this._popup.setLatLng(l.latlng)},_onKeyPress:function(l){l.originalEvent.keyCode===13&&this._openPopup(l)}});var ll=lr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(l){lr.prototype.onAdd.call(this,l),this.setOpacity(this.options.opacity),l.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(l){lr.prototype.onRemove.call(this,l),l.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var l=lr.prototype.getEvents.call(this);return this.options.permanent||(l.preclick=this.close),l},_initLayout:function(){var l="leaflet-tooltip",_=l+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Bi("div",_),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+V(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(l){var _,S,B=this._map,$=this._container,oe=B.latLngToContainerPoint(B.getCenter()),Ee=B.layerPointToContainerPoint(l),je=this.options.direction,tt=$.offsetWidth,vt=$.offsetHeight,Rt=It(this.options.offset),ni=this._getAnchor();je==="top"?(_=tt/2,S=vt):je==="bottom"?(_=tt/2,S=0):je==="center"?(_=tt/2,S=vt/2):je==="right"?(_=0,S=vt/2):je==="left"?
10(_=tt,S=vt/2):Ee.x<oe.x?(je="right",_=0,S=vt/2):(je="left",_=tt+(Rt.x+ni.x)*2,S=vt/2),l=l.subtract(It(_,S,!0)).add(Rt).add(ni),On($,"leaflet-tooltip-right"),On($,"leaflet-tooltip-left"),On($,"leaflet-tooltip-top"),On($,"leaflet-tooltip-bottom"),xi($,"leaflet-tooltip-"+je),fn($,l)},_updatePosition:function(){var l=this._map.latLngToLayerPoint(this._latlng);this._setPosition(l)},setOpacity:function(l){this.options.opacity=l,this._container&&vn(this._container,l)},_animateZoom:function(l){var _=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center);this._setPosition(_)},_getAnchor:function(){return It(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),ul=function(l,_){return new ll(l,_)};Ci.include({openTooltip:function(l,_,S){return this._initOverlay(ll,l,_,S).openOn(this),this},closeTooltip:function(l){return l.close(),this}}),ua.include({bindTooltip:function(l,_){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(ll,this._tooltip,l,_),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(l){if(!(!l&&this._tooltipHandlersAdded)){var _=l?"off":"on",S={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?S.add=this._openTooltip:(S.mouseover=this._openTooltip,S.mouseout=this.closeTooltip,S.click=this._openTooltip,this._map?this._addFocusListeners():S.add=this._addFocusListeners),this._tooltip.options.sticky&&(S.mousemove=this._moveTooltip),this[_](S),this._tooltipHandlersAdded=!l}},openTooltip:function(l){return this._tooltip&&(this instanceof Ia||(this._tooltip._source=this),this._tooltip._prepareOpen(l)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(l){return this._tooltip&&this._tooltip.setContent(l),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(l){var _=typeof l.getElement=="function"&&l.getElement();_&&(Qt(_,"focus",function(){this._tooltip._source=l,this.openTooltip()},this),Qt(_,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(l){var _=typeof l.getElement=="function"&&l.getElement();_&&_.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(l){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var _=this;this._map.once("moveend",function(){_._openOnceFlag=!1,_._openTooltip(l)});return}this._tooltip._source=l.layer||l.target,this.openTooltip(this._tooltip.options.sticky?l.latlng:void 0)}},_moveTooltip:function(l){var _=l.latlng,S,B;this._tooltip.options.sticky&&l.originalEvent&&(S=this._map.mouseEventToContainerPoint(l.originalEvent),B=this._map.containerPointToLayerPoint(S),_=this._map.layerPointToLatLng(B)),this._tooltip.setLatLng(_)}});var Nl=ka.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(l){var _=l&&l.tagName==="DIV"?l:document.createElement("div"),S=this.options;if(S.html instanceof Element?(qr(_),_.appendChild(S.html)):_.innerHTML=S.html!==!1?S.html:"",S.bgPos){var B=It(S.bgPos);_.style.backgroundPosition=-B.x+"px "+-B.y+"px"}return this._setIconStyles(_,"icon"),_},createShadow:function(){return null}});function Fl(l){return new Nl(l)}ka.Default=kl;var Cr=ua.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ve.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(l){Te(this,l)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(l){l._addZoomLimit(this)},onRemove:function(l){this._removeAllTiles(),$i(this._container),l._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(zi(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(_o(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(l){return this.options.opacity=l,this._updateOpacity(),this},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var l=this._clampZoom(this._map.getZoom());l!==this._tileZoom&&(this._tileZoom=l,this._updateLevels()),this._update()}return this},getEvents:function(){var l={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=X(this._onMoveEnd,this.options.updateInterval,this)),l.move=this._onMove),this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},createTile:function(){return document.createElement("div")},getTileSize:function(){var l=this.options.tileSize;return l instanceof gt?l:new gt(l,l)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(l){for(var _=this.getPane().children,S=-l(-1/0,1/0),B=0,$=_.length,oe;B<$;
10B++)oe=_[B].style.zIndex,_[B]!==this._container&&oe&&(S=l(S,+oe));isFinite(S)&&(this.options.zIndex=S+l(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ve.ielt9){vn(this._container,this.options.opacity);var l=+new Date,_=!1,S=!1;for(var B in this._tiles){var $=this._tiles[B];if(!(!$.current||!$.loaded)){var oe=Math.min(1,(l-$.loaded)/200);vn($.el,oe),oe<1?_=!0:($.active?S=!0:this._onOpaqueTile($),$.active=!0)}}S&&!this._noPrune&&this._pruneTiles(),_&&(Xt(this._fadeFrame),this._fadeFrame=Ht(this._updateOpacity,this))}},_onOpaqueTile:ne,_initContainer:function(){this._container||(this._container=Bi("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var l=this._tileZoom,_=this.options.maxZoom;if(l!==void 0){for(var S in this._levels)S=Number(S),this._levels[S].el.children.length||S===l?(this._levels[S].el.style.zIndex=_-Math.abs(l-S),this._onUpdateLevel(S)):($i(this._levels[S].el),this._removeTilesAtZoom(S),this._onRemoveLevel(S),delete this._levels[S]);var B=this._levels[l],$=this._map;return B||(B=this._levels[l]={},B.el=Bi("div","leaflet-tile-container leaflet-zoom-animated",this._container),B.el.style.zIndex=_,B.origin=$.project($.unproject($.getPixelOrigin()),l).round(),B.zoom=l,this._setZoomTransform(B,$.getCenter(),$.getZoom()),ne(B.el.offsetWidth),this._onCreateLevel(B)),this._level=B,B}},_onUpdateLevel:ne,_onRemoveLevel:ne,_onCreateLevel:ne,_pruneTiles:function(){if(this._map){var l,_,S=this._map.getZoom();if(S>this.options.maxZoom||S<this.options.minZoom){this._removeAllTiles();return}for(l in this._tiles)_=this._tiles[l],_.retain=_.current;for(l in this._tiles)if(_=this._tiles[l],_.current&&!_.active){var B=_.coords;this._retainParent(B.x,B.y,B.z,B.z-5)||this._retainChildren(B.x,B.y,B.z,B.z+2)}for(l in this._tiles)this._tiles[l].retain||this._removeTile(l)}},_removeTilesAtZoom:function(l){for(var _ in this._tiles)this._tiles[_].coords.z===l&&this._removeTile(_)},_removeAllTiles:function(){for(var l in this._tiles)this._removeTile(l)},_invalidateAll:function(){for(var l in this._levels)$i(this._levels[l].el),this._onRemoveLevel(Number(l)),delete this._levels[l];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(l,_,S,B){var $=Math.floor(l/2),oe=Math.floor(_/2),Ee=S-1,je=new gt(+$,+oe);je.z=+Ee;var tt=this._tileCoordsToKey(je),vt=this._tiles[tt];return vt&&vt.active?(vt.retain=!0,!0):(vt&&vt.loaded&&(vt.retain=!0),Ee>B?this._retainParent($,oe,Ee,B):!1)},_retainChildren:function(l,_,S,B){for(var $=2*l;$<2*l+2;$++)for(var oe=2*_;oe<2*_+2;oe++){var Ee=new gt($,oe);Ee.z=S+1;var je=this._tileCoordsToKey(Ee),tt=this._tiles[je];if(tt&&tt.active){tt.retain=!0;continue}else tt&&tt.loaded&&(tt.retain=!0);S+1<B&&this._retainChildren($,oe,S+1,B)}},_resetView:function(l){var _=l&&(l.pinch||l.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),_,_)},_animateZoom:function(l){this._setView(l.center,l.zoom,!0,l.noUpdate)},_clampZoom:function(l){var _=this.options;return _.minNativeZoom!==void 0&&l<_.minNativeZoom?_.minNativeZoom:_.maxNativeZoom!==void 0&&_.maxNativeZoom<l?_.maxNativeZoom:l},_setView:function(l,_,S,B){var $=Math.round(_);this.options.maxZoom!==void 0&&$>this.options.maxZoom||this.options.minZoom!==void 0&&$<this.options.minZoom?$=void 0:$=this._clampZoom($);var oe=this.options.updateWhenZooming&&$!==this._tileZoom;(!B||oe)&&(this._tileZoom=$,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),$!==void 0&&this._update(l),S||this._pruneTiles(),this._noPrune=!!S),this._setZoomTransforms(l,_)},_setZoomTransforms:function(l,_){for(var S in this._levels)this._setZoomTransform(this._levels[S],l,_)},_setZoomTransform:function(l,_,S){var B=this._map.getZoomScale(S,l.zoom),$=l.origin.multiplyBy(B).subtract(this._map._getNewPixelOrigin(_,S)).round();Ve.any3d?Ya(l.el,$,B):fn(l.el,$)},_resetGrid:function(){var l=this._map,_=l.options.crs,S=this._tileSize=this.getTileSize(),B=this._tileZoom,$=this._map.getPixelWorldBounds(this._tileZoom);$&&(this._globalTileRange=this._pxBoundsToTileRange($)),this._wrapX=_.wrapLng&&!this.options.noWrap&&[Math.floor(l.project([0,_.wrapLng[0]],B).x/S.x),Math.ceil(l.project([0,_.wrapLng[1]],B).x/S.y)],this._wrapY=_.wrapLat&&!this.options.noWrap&&[Math.floor(l.project([_.wrapLat[0],0],B).y/S.x),Math.ceil(l.project([_.wrapLat[1],0],B).y/S.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(l){var _=this._map,S=_._animatingZoom?Math.max(_._animateToZoom,_.getZoom()):_.getZoom(),B=_.getZoomScale(S,this._tileZoom),$=_.project(l,this._tileZoom).floor(),oe=_.getSize().divideBy(B*2);return new ze($.subtract(oe),$.add(oe))},_update:function(l){var _=this._map;if(_){var S=this._clampZoom(_.getZoom());if(l===void 0&&(l=_.getCenter()),this._tileZoom!==void 0){var B=this._getTiledPixelBounds(l),$=this._pxBoundsToTileRange(B),oe=$.getCenter(),Ee=[],je=this.options.keepBuffer,tt=new ze($.getBottomLeft().subtract([je,-je]),$.getTopRight().add([je,-je]));if(!(isFinite($.min.x)&&isFinite($.min.y)&&isFinite($.max.x)&&isFinite($.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var vt in this._tiles){var Rt=this._tiles[vt].coords;(Rt.z!==this._tileZoom||!tt.contains(new gt(Rt.x,Rt.y)))&&(this._tiles[vt].current=!1)}if(Math.abs(S-this._tileZoom)>
vendor: 8,118 bytes, line 10
101){this._setView(l,S);return}for(var ni=$.min.y;ni<=$.max.y;ni++)for(var Mi=$.min.x;Mi<=$.max.x;Mi++){var Xn=new gt(Mi,ni);if(Xn.z=this._tileZoom,!!this._isValidTile(Xn)){var Nn=this._tiles[this._tileCoordsToKey(Xn)];Nn?Nn.current=!0:Ee.push(Xn)}}if(Ee.sort(function(Ki,ji){return Ki.distanceTo(oe)-ji.distanceTo(oe)}),Ee.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ma=document.createDocumentFragment();for(Mi=0;Mi<Ee.length;Mi++)this._addTile(Ee[Mi],ma);this._level.el.appendChild(ma)}}}},_isValidTile:function(l){var _=this._map.options.crs;if(!_.infinite){var S=this._globalTileRange;if(!_.wrapLng&&(l.x<S.min.x||l.x>S.max.x)||!_.wrapLat&&(l.y<S.min.y||l.y>S.max.y))return!1}if(!this.options.bounds)return!0;var B=this._tileCoordsToBounds(l);return Pt(this.options.bounds).overlaps(B)},_keyToBounds:function(l){return this._tileCoordsToBounds(this._keyToTileCoords(l))},_tileCoordsToNwSe:function(l){var _=this._map,S=this.getTileSize(),B=l.scaleBy(S),$=B.add(S),oe=_.unproject(B,l.z),Ee=_.unproject($,l.z);return[oe,Ee]},_tileCoordsToBounds:function(l){var _=this._tileCoordsToNwSe(l),S=new Et(_[0],_[1]);return this.options.noWrap||(S=this._map.wrapLatLngBounds(S)),S},_tileCoordsToKey:function(l){return l.x+":"+l.y+":"+l.z},_keyToTileCoords:function(l){var _=l.split(":"),S=new gt(+_[0],+_[1]);return S.z=+_[2],S},_removeTile:function(l){var _=this._tiles[l];_&&($i(_.el),delete this._tiles[l],this.fire("tileunload",{tile:_.el,coords:this._keyToTileCoords(l)}))},_initTile:function(l){xi(l,"leaflet-tile");var _=this.getTileSize();l.style.width=_.x+"px",l.style.height=_.y+"px",l.onselectstart=ne,l.onmousemove=ne,Ve.ielt9&&this.options.opacity<1&&vn(l,this.options.opacity)},_addTile:function(l,_){var S=this._getTilePos(l),B=this._tileCoordsToKey(l),$=this.createTile(this._wrapCoords(l),T(this._tileReady,this,l));this._initTile($),this.createTile.length<2&&Ht(T(this._tileReady,this,l,null,$)),fn($,S),this._tiles[B]={el:$,coords:l,current:!0},_.appendChild($),this.fire("tileloadstart",{tile:$,coords:l})},_tileReady:function(l,_,S){_&&this.fire("tileerror",{error:_,tile:S,coords:l});var B=this._tileCoordsToKey(l);S=this._tiles[B],S&&(S.loaded=+new Date,this._map._fadeAnimated?(vn(S.el,0),Xt(this._fadeFrame),this._fadeFrame=Ht(this._updateOpacity,this)):(S.active=!0,this._pruneTiles()),_||(xi(S.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:S.el,coords:l})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ve.ielt9||!this._map._fadeAnimated?Ht(this._pruneTiles,this):setTimeout(T(this._pruneTiles,this),250)))},_getTilePos:function(l){return l.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(l){var _=new gt(this._wrapX?ce(l.x,this._wrapX):l.x,this._wrapY?ce(l.y,this._wrapY):l.y);return _.z=l.z,_},_pxBoundsToTileRange:function(l){var _=this.getTileSize();return new ze(l.min.unscaleBy(_).floor(),l.max.unscaleBy(_).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var l in this._tiles)if(!this._tiles[l].loaded)return!1;return!0}});function Mc(l){return new Cr(l)}var Ys=Cr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(l,_){this._url=l,_=Te(this,_),_.detectRetina&&Ve.retina&&_.maxZoom>0?(_.tileSize=Math.floor(_.tileSize/2),_.zoomReverse?(_.zoomOffset--,_.minZoom=Math.min(_.maxZoom,_.minZoom+1)):(_.zoomOffset++,_.maxZoom=Math.max(_.minZoom,_.maxZoom-1)),_.minZoom=Math.max(0,_.minZoom)):_.zoomReverse?_.minZoom=Math.min(_.maxZoom,_.minZoom):_.maxZoom=Math.max(_.minZoom,_.maxZoom),typeof _.subdomains=="string"&&(_.subdomains=_.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(l,_){return this._url===l&&_===void 0&&(_=!0),this._url=l,_||this.redraw(),this},createTile:function(l,_){var S=document.createElement("img");return Qt(S,"load",T(this._tileOnLoad,this,_,S)),Qt(S,"error",T(this._tileOnError,this,_,S)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(S.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(S.referrerPolicy=this.options.referrerPolicy),S.alt="",S.src=this.getTileUrl(l),S},getTileUrl:function(l){var _={r:Ve.retina?"@2x":"",s:this._getSubdomain(l),x:l.x,y:l.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var S=this._globalTileRange.max.y-l.y;this.options.tms&&(_.y=S),_["-y"]=S}return Tt(this._url,N(_,this.options))},_tileOnLoad:function(l,_){Ve.ielt9?setTimeout(T(l,this,null,_),0):l(null,_)},_tileOnError:function(l,_,S){var B=this.options.errorTileUrl;B&&_.getAttribute("src")!==B&&(_.src=B),l(S,_)},_onTileRemove:function(l){l.tile.onload=null},_getZoomForUrl:function(){var l=this._tileZoom,_=this.options.maxZoom,S=this.options.zoomReverse,B=this.options.zoomOffset;return S&&(l=_-l),l+B},_getSubdomain:function(l){var _=Math.abs(l.x+l.y)%this.options.subdomains.length;return this.options.subdomains[_]},_abortLoading:function(){var l,_;for(l in this._tiles)if(this._tiles[l].coords.z!==this._tileZoom&&(_=this._tiles[l].el,_.onload=ne,_.onerror=ne,!_.complete)){_.src=Vt;var S=this._tiles[l].coords;$i(_),delete this._tiles[l],this.fire("tileabort",{tile:_,coords:S})}},_removeTile:function(l){var _=this._tiles[l];if(_)return _.el.setAttribute("src",Vt),Cr.prototype._removeTile.call(this,l)},_tileReady:function(l,_,S){if(!(!this._map||S&&S.getAttribute("src")===Vt))return Cr.prototype._tileReady.call(this,l,_,S)}});function da(l,_){return new Ys(l,_)}var ns=Ys.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(l,_){this._url=l;var S=N({},this.defaultWmsParams);for(var B in _)B in this.options||(S[B]=_[B]);_=Te(this,_);var $=_.detectRetina&&Ve.retina?2:1,oe=this.getTileSize();S.width=oe.x*$,S.height=oe.y*$,this.wmsParams=S},onAdd:function(l){this._crs=this.options.crs||l.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var _=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[_]=this._crs.code,Ys.prototype.onAdd.call(this,l)},getTileUrl:function(l){var _=this._tileCoordsToNwSe(l),S=this._crs,B=rt(S.project(_[0]),S.project(_[1])),$=B.min,oe=B.max,Ee=(this._wmsVersion>=1.3&&this._crs===Tc?[$.y,$.x,oe.y,oe.x]:[$.x,$.y,oe.x,oe.y]).join(","),je=Ys.prototype.getTileUrl.call(this,l);return je+ve(this.wmsParams,je,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Ee},setParams:function(l,_){return N(this.wmsParams,l),_||this.redraw(),this}});function Xr(l,_){return new ns(l,_)}Ys.WMS=ns,da.wms=Xr;var Mr=ua.extend({options:{padding:.1},initialize:function(l){Te(this,l),V(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),xi(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var l={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(l.zoomanim=this._onAnimZoom),l},_onAnimZoom:function(l){this._updateTransform(l.center,l.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(l,_){var S=this._map.getZoomScale(_,this._zoom),B=this._map.getSize().multiplyBy(.5+this.options.padding),$=this._map.project(this._center,_),oe=B.multiplyBy(-S).add($).subtract(this._map._getNewPixelOrigin(l,_));Ve.any3d?Ya(this._container,oe,S):fn(this._container,oe)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var l in this._layers)this._layers[l]._reset()},_onZoomEnd:function(){for(var l in this._layers)this._layers[l]._project()},_updatePaths:function(){for(var l in this._layers)this._layers[l]._update()},_update:function(){var l=this.options.padding,_=this._map.getSize(),S=this._map.containerPointToLayerPoint(_.multiplyBy(-l)).round();
10this._bounds=new ze(S,S.add(_.multiplyBy(1+l*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ao=Mr.extend({options:{tolerance:0},getEvents:function(){var l=Mr.prototype.getEvents.call(this);return l.viewprereset=this._onViewPreReset,l},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Mr.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var l=this._container=document.createElement("canvas");Qt(l,"mousemove",this._onMouseMove,this),Qt(l,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Qt(l,"mouseout",this._handleMouseOut,this),l._leaflet_disable_events=!0,this._ctx=l.getContext("2d")},_destroyContainer:function(){Xt(this._redrawRequest),delete this._ctx,$i(this._container),jt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var l;this._redrawBounds=null;for(var _ in this._layers)l=this._layers[_],l._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var l=this._bounds,_=this._container,S=l.getSize(),B=Ve.retina?2:1;
10fn(_,l.min),_.width=B*S.x,_.height=B*S.y,_.style.width=S.x+"px",_.style.height=S.y+"px",Ve.retina&&this._ctx.scale(2,2),this._ctx.translate(-l.min.x,-l.min.y),this.fire("update")}},_reset:function(){Mr.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(l){this._updateDashArray(l),this._layers[V(l)]=l;var _=l._order={layer:l,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=_),this._drawLast=_,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(l){this._requestRedraw(l)},_removePath:function(l){var _=l._order,S=_.next,B=_.prev;S?S.prev=B:this._drawLast=B,B?B.next=S:this._drawFirst=S,delete l._order,delete this._layers[V(l)],this._requestRedraw(l)},_updatePath:function(l){this._extendRedrawBounds(l),l._project(),l._update(),this._requestRedraw(l)},_updateStyle:function(l){this._updateDashArray(l),this._requestRedraw(l)},_updateDashArray:function(l){if(typeof l.options.dashArray=="string"){var _=l.options.dashArray.split(/[, ]+/),S=[],B,$;for($=0;$<_.length;$++){if(B=Number(_[$]),isNaN(B))return;S.push(B)}l.options._dashArray=S}else l.options._dashArray=l.options.dashArray},_requestRedraw:function(l){this._map&&(this._extendRedrawBounds(l),this._redrawRequest=this._redrawRequest||Ht(this._redraw,this))},_extendRedrawBounds:function(l){if(l._pxBounds){var _=(l.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ze,this._redrawBounds.extend(l._pxBounds.min.subtract([_,_])),this._redrawBounds.extend(l._pxBounds.max.add([_,_]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var l=this._redrawBounds;if(l){var _=l.getSize();this._ctx.clearRect(l.min.x,l.min.y,_.x,_.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var l,_=this._redrawBounds;if(this._ctx.save(),_){var S=_.getSize();this._ctx.beginPath(),this._ctx.rect(_.min.x,_.min.y,S.x,S.y),this._ctx.clip()}this._drawing=!0;for(var B=this._drawFirst;B;B=B.next)l=B.layer,(!_||l._pxBounds&&l._pxBounds.intersects(_))&&l._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(l,_){if(this._drawing){var S,B,$,oe,Ee=l._parts,je=Ee.length,tt=this._ctx;if(je){for(tt.beginPath(),S=0;S<je;S++){for(B=0,$=Ee[S].length;B<$;B++)oe=Ee[S][B],tt[B?"lineTo":"moveTo"](oe.x,oe.y);_&&tt.closePath()}this._fillStroke(tt,l)}}},_updateCircle:function(l){if(!(!this._drawing||l._empty())){var _=l._point,S=this._ctx,B=Math.max(Math.round(l._radius),1),$=(Math.max(Math.round(l._radiusY),1)||B)/B;$!==1&&(S.save(),S.scale(1,$)),S.beginPath(),S.arc(_.x,_.y/$,B,0,Math.PI*2,!1),$!==1&&S.restore(),this._fillStroke(S,l)}},_fillStroke:function(l,_){var S=_.options;S.fill&&(l.globalAlpha=S.fillOpacity,l.fillStyle=S.fillColor||S.color,l.fill(S.fillRule||"evenodd")),S.stroke&&S.weight!==0&&(l.setLineDash&&l.setLineDash(_.options&&_.options._dashArray||[]),l.globalAlpha=S.opacity,l.lineWidth=S.weight,l.strokeStyle=S.color,l.lineCap=S.lineCap,l.lineJoin=S.lineJoin,l.stroke())},_onClick:function(l){for(var _=this._map.mouseEventToLayerPoint(l),S,B,$=this._drawFirst;$;$=$.next)S=$.layer,S.options.interactive&&S._containsPoint(_)&&(!(l.type==="click"||l.type==="preclick")||!this._map._draggableMoved(S))&&(B=S);this._fireEvent(B?[B]:!1,l)},_onMouseMove:function(l){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var _=this._map.mouseEventToLayerPoint(l);this._handleMouseHover(l,_)}},_handleMouseOut:function(l){var _=this._hoveredLayer;_&&(On(this._container,"leaflet-interactive"),this._fireEvent([_],l,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(l,_){if(!this._mouseHoverThrottled){for(var S,B,$=this._drawFirst;$;$=$.next)S=$.layer,S.options.interactive&&S._containsPoint(_)&&(B=S);B!==this._hoveredLayer&&(this._handleMouseOut(l),B&&(xi(this._container,"leaflet-interactive"),this._fireEvent([B],l,"mouseover"),this._hoveredLayer=B)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,l),this._mouseHoverThrottled=!0,setTimeout(T(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(l,_,S){this._map._fireDOMEvent(_,S||_.type,l)},_bringToFront:function(l){var _=l._order;if(_){var S=_.next,B=_.prev;if(S)S.prev=B;else return;B?B.next=S:S&&(this._drawFirst=S),_.prev=this._drawLast,this._drawLast.next=_,_.next=null,this._drawLast=_,this._requestRedraw(l)}},_bringToBack:function(l){var _=l._order;if(_){var S=_.next,B=_.prev;if(B)B.next=S;else return;S?S.prev=B:B&&(this._drawLast=B),_.prev=null,_.next=this._drawFirst,this._drawFirst.prev=_,this._drawFirst=_,this._requestRedraw(l)}}});function Po(l){return Ve.canvas?new Ao(l):null}var Ws=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(l){return document.createElement("<lvml:"+l+' class="lvml">')}}catch{}return function(l){return document.createElement("<"+l+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),zo={_initContainer:function(){this._container=Bi("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Mr.prototype._update.call(this),this.fire("update"))},_initPath:function(l){var _=l._container=Ws("shape");xi(_,"leaflet-vml-shape "+(this.options.className||"")),_.coordsize="1 1",l._path=Ws("path"),_.appendChild(l._path),this._updateStyle(l),this._layers[V(l)]=l},_addPath:function(l){var _=l._container;this._container.appendChild(_),l.options.interactive&&l.addInteractiveTarget(_)},_removePath:function(l){var _=l._container;$i(_),l.removeInteractiveTarget(_),delete this._layers[V(l)]},_updateStyle:function(l){var _=l._stroke,S=l._fill,B=l.options,$=l._container;$.stroked=!!B.stroke,$.filled=!!B.fill,B.stroke?(_||(_=l._stroke=Ws("stroke")),$.appendChild(_),_.weight=B.weight+"px",_.color=B.color,_.opacity=B.opacity,B.dashArray?_.dashStyle=dt(B.dashArray)?B.dashArray.join(" "):B.dashArray.replace(/( *, *)/g," "):_.dashStyle="",_.endcap=B.lineCap.replace("butt","flat"),_.joinstyle=B.lineJoin):_&&($.removeChild(_),l._stroke=null),B.fill?(S||(S=l._fill=Ws("fill")),$.appendChild(S),S.color=B.fillColor||B.color,S.opacity=B.fillOpacity):S&&($.removeChild(S),l._fill=null)},_updateCircle:function(l){var _=l._point.round(),S=Math.round(l._radius),B=Math.round(l._radiusY||S);this._setPath(l,l._empty()?"M0 0":"AL "+_.x+","+_.y+" "+S+","+B+" 0,"+65535*360)},_setPath:function(l,_){l._path.v=_},_bringToFront:function(l){zi(l._container)},_bringToBack:function(l){_o(l._container)}},Yr=Ve.vml?Ws:Vr,cl=Mr.extend({_initContainer:function(){this._container=Yr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){$i(this._container),jt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Mr.prototype._update.call(this);var l=this._bounds,_=l.getSize(),S=this._container;(!this._svgSize||!this._svgSize.equals(_))&&(this._svgSize=_,S.setAttribute("width",_.x),S.setAttribute("height",_.y)),fn(S,l.min),S.setAttribute("viewBox",[l.min.x,l.min.y,_.x,_.y].join(" ")),this.fire("update")}},_initPath:function(l){var _=l._path=Yr("path");l.options.className&&xi(_,l.options.className),l.options.interactive&&xi(_,"leaflet-interactive"),this._updateStyle(l),this._layers[V(l)]=l},_addPath:function(l){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(l._path),l.addInteractiveTarget(l._path)},_removePath:function(l){$i(l._path),l.removeInteractiveTarget(l._path),delete this._layers[V(l)]},_updatePath:function(l){l._project(),l._update()},_updateStyle:function(l){var _=l._path,S=l.options;_&&(S.stroke?(_.setAttribute("stroke",S.color),_.setAttribute("stroke-opacity",S.opacity),_.setAttribute("stroke-width",S.weight),_.setAttribute("stroke-linecap",S.lineCap),_.setAttribute("stroke-linejoin",S.lineJoin),S.dashArray?_.setAttribute("stroke-dasharray",S.dashArray):_.removeAttribute("stroke-dasharray"),S.dashOffset?_.setAttribute("stroke-dashoffset",S.dashOffset):_.removeAttribute("stroke-dashoffset")):_.setAttribute("stroke","none"),S.fill?(_.setAttribute("fill",S.fillColor||S.color),_.setAttribute("fill-opacity",S.fillOpacity),_.setAttribute("fill-rule",S.fillRule||"evenodd")):_.setAttribute("fill","none"))},_updatePoly:function(l,_){this._setPath(l,ta(l._parts,_))},_updateCircle:function(l){var _=l._point,S=Math.max(Math.round(l._radius),1),B=Math.max(Math.round(l._radiusY),1)||S,$="a"+S+","+B+" 0 1,0 ",oe=l._empty()?"M0 0":"M"+(_.x-S)+","+_.y+$+S*2+",0 "+$+-S*2+",0 ";this._setPath(l,oe)},_setPath:function(l,_){l._path.setAttribute("d",_)},_bringToFront:function(l){zi(l._path)},_bringToBack:function(l){_o(l._path)}});Ve.vml&&cl.include(zo);function hl(l){return Ve.svg||Ve.vml?new cl(l):null}Ci.include({getRenderer:function(l){var _=l.options.renderer||this._getPaneRenderer(l.options.pane)||this.options.renderer||this._renderer;return _||(_=this._renderer=this._createRenderer()),this.hasLayer(_)||this.addLayer(_),_},_getPaneRenderer:function(l){if(l==="overlayPane"||l===void 0)return!1;var _=this._paneRenderers[l];return _===void 0&&(_=this._createRenderer({pane:l}),this._paneRenderers[l]=_),_},_createRenderer:function(l){return this.options.preferCanvas&&Po(l)||hl(l)}});var gi=ws.extend({initialize:function(l,_){ws.prototype.initialize.call(this,this._boundsToLatLngs(l),_)},setBounds:function(l){return this.setLatLngs(this._boundsToLatLngs(l))}
10,_boundsToLatLngs:function(l){return l=Pt(l),[l.getSouthWest(),l.getNorthWest(),l.getNorthEast(),l.getSouthEast()]}});function Xu(l,_){return new gi(l,_)}cl.create=Yr,cl.pointsToPath=ta,is.geometryToLayer=Sr,is.coordsToLatLng=ca,is.coordsToLatLngs=Co,is.latLngToCoords=Ol,is.latLngsToCoords=rl,is.getFeature=Ts,is.asFeature=al,Ci.mergeOptions({boxZoom:!0});var fa=Da.extend({initialize:function(l){this._map=l,this._container=l._container,this._pane=l._panes.overlayPane,this._resetStateTimeout=0,l.on("unload",this._destroy,this)},addHooks:function(){Qt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){jt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){$i(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(l){if(!l.shiftKey||l.which!==1&&l.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),vs(),zl(),this._startPoint=this._map.mouseEventToContainerPoint(l),Qt(document,{contextmenu:oa,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(l){this._moved||(this._moved=!0,this._box=Bi("div","leaflet-zoom-box",this._container),xi(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(l);var _=new ze(this._point,this._startPoint),S=_.getSize();fn(this._box,_.min),this._box.style.width=S.x+"px",this._box.style.height=S.y+"px"},_finish:function(){this._moved&&($i(this._box),On(this._container,"leaflet-crosshair")),Ma(),Zs(),jt(document,{contextmenu:oa,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(l){if(!(l.which!==1&&l.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(T(this._resetState,this),0);var _=new Et(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(_).fire("boxzoomend",{boxZoomBounds:_})}},_onKeyDown:function(l){l.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ci.addInitHook("addHandler","boxZoom",fa),Ci.mergeOptions({doubleClickZoom:!0});var uu=Da.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(l){var _=this._map,S=_.getZoom(),B=_.options.zoomDelta,$=l.originalEvent.shiftKey?S-B:S+B;_.options.doubleClickZoom==="center"?_.setZoom($):_.setZoomAround(l.containerPoint,$)}});Ci.addInitHook("addHandler","doubleClickZoom",uu),Ci.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var pa=Da.extend({addHooks:function(){if(!this._draggable){var l=this._map;this._draggable=new Zn(l._mapPane,l._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),l.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),l.on("zoomend",this._onZoomEnd,this),l.whenReady(this._onZoomEnd,this))}xi(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){On(this._map._container,"leaflet-grab"),On(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var l=this._map;if(l._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var _=Pt(this._map.options.maxBounds);this._offsetLimit=rt(this._map.latLngToContainerPoint(_.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(_.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;l.fire("movestart").fire("dragstart"),l.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(l){if(this._map.options.inertia){var _=this._lastTime=+new Date,S=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(S),this._times.push(_),this._prunePositions(_)}this._map.fire("move",l).fire("drag",l)}
vendor: 2,536 bytes, line 10
10,_prunePositions:function(l){for(;this._positions.length>1&&l-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var l=this._map.getSize().divideBy(2),_=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=_.subtract(l).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(l,_){return l-(l-_)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var l=this._draggable._newPos.subtract(this._draggable._startPos),_=this._offsetLimit;l.x<_.min.x&&(l.x=this._viscousLimit(l.x,_.min.x)),l.y<_.min.y&&(l.y=this._viscousLimit(l.y,_.min.y)),l.x>_.max.x&&(l.x=this._viscousLimit(l.x,_.max.x)),l.y>_.max.y&&(l.y=this._viscousLimit(l.y,_.max.y)),this._draggable._newPos=this._draggable._startPos.add(l)}},_onPreDragWrap:function(){var l=this._worldWidth,_=Math.round(l/2),S=this._initialWorldOffset,B=this._draggable._newPos.x,$=(B-_+S)%l+_-S,oe=(B+_+S)%l-_-S,Ee=Math.abs($+S)<Math.abs(oe+S)?$:oe;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=Ee},_onDragEnd:function(l){var _=this._map,S=_.options,B=!S.inertia||l.noInertia||this._times.length<2;if(_.fire("dragend",l),B)_.fire("moveend");else{this._prunePositions(+new Date);var $=this._lastPos.subtract(this._positions[0]),oe=(this._lastTime-this._times[0])/1e3,Ee=S.easeLinearity,je=$.multiplyBy(Ee/oe),tt=je.distanceTo([0,0]),vt=Math.min(S.inertiaMaxSpeed,tt),Rt=je.multiplyBy(vt/tt),ni=vt/(S.inertiaDeceleration*Ee),Mi=Rt.multiplyBy(-ni/2).round();!Mi.x&&!Mi.y?_.fire("moveend"):(Mi=_._limitOffset(Mi,_.options.maxBounds),Ht(function(){_.panBy(Mi,{duration:ni,easeLinearity:Ee,noMoveStart:!0,animate:!0})}))}}});Ci.addInitHook("addHandler","dragging",pa),Ci.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ec=Da.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(l){this._map=l,this._setPanDelta(l.options.keyboardPanDelta),this._setZoomDelta(l.options.zoomDelta)},addHooks:function(){var l=this._map._container;l.tabIndex<=0&&(l.tabIndex="0"),Qt(l,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),jt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var l=document.body,_=d
10ocument.documentElement,S=l.scrollTop||_.scrollTop,B=l.scrollLeft||_.scrollLeft;this._map._container.focus(),window.scrollTo(B,S)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(l){var _=this._panKeys={},S=this.keyCodes,B,$;for(B=0,$=S.left.length;B<$;B++)_[S.left[B]]=[-1*l,0];for(B=0,$=S.right.length;B<$;B++)_[S.right[B]]=[l,0];for(B=0,$=S.down.length;B<$;B++)_[S.down[B]]=[0,l];for(B=0,$=S.up.length;B<$;B++)_[S.up[B]]=[0,-1*l]},_setZoomDelta:function(l){var _=this._zoomKeys={},S=this.keyCodes,B,$;for(B=0,$=S.zoomIn.length;B<$;B++)_[S.zoomIn[B]]=l;for(B=0,$=S.zoomOut.length;B<$;B++)_[S.zoomOut[B]]=-l},_addHooks:function(){Qt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){jt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(l){if(!(l.altKey||l.ctrlKey||l.metaKey)){var _=l.keyCode,S=this._map,B;if(_ in this._panKeys){if(!S._panAnim||!S._panAnim._inProgress)if(B=this._panKeys[_],l.shiftKey&&(B=It(B).multiplyBy(3)),S.options.maxBounds&&(B=S._limitOffset(It(B),S.options.maxBounds)),S.options.worldCopyJump){var $=S.wrapLatLng(S.unproject(S.project(S.getCenter()).add(B)));S.panTo($)}else S.panBy(B)}else if(_ in this._zoomKeys)S.setZoom(S.getZoom()+(l.shiftKey?3:1)*this._zoomKeys[_]);else if(_===27&&S._popup&&S._popup.options.closeOnEscapeKey)S.closePopup();else return;oa(l)}}});Ci.addInitHook("addHandler","keyboard",Ec),Ci.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var cu=Da.extend({addHooks:function(){Qt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){jt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(l){var _=$n(l),S=this._map.options.wheelDebounceTime;this._delta+=_,this._lastMousePos=this._map.mouseEventToContainerPoint(l),this._startTime||(this._startTime=+new Date);var B=Math.max(S-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(T(this._performZoom,this),B),oa(l)},_performZoom:function(){var l=this._map,_=l.getZoom(),S=this._map.options.zoomSnap||0;l._stop();var B=this._delta/(this._map.options.wheelPxPerZoomLevel*4),$=4*Math.log(2/(1+Math.exp(-Math.abs(B))))/Math.LN2,oe=S?Math.ceil($/S)*S:$,Ee=l._limitZoom(_+(this._delta>0?oe:-oe))-_;this._delta=0,this._startTime=null,Ee&&(l.options.scrollWheelZoom==="center"?l.setZoom(_+Ee):l.setZoomAround(this._lastMousePos,_+Ee))}});Ci.addInitHook("addHandler","scrollWheelZoom",cu);var Lo=600;Ci.mergeOptions({tapHold:Ve.touchNative&&Ve.safari&&Ve.mobile,tapTolerance:15});var Yu=Da.extend({addHooks:function(){Qt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){jt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(l){if(clearTimeout(this._holdTimeout),l.touches.length===1){var _=l.touches[0];this._startPos=this._newPos=new gt(_.clientX,_.clientY),this._holdTimeout=setTimeout(T(function(){this._cancel(),this._isTapValid()&&(Qt(document,"touchend",Ti),Qt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",_))},this),Lo),Qt(document,"touchend touchcancel contextmenu",this._cancel,this),Qt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function l(){jt(document,"touchend",Ti),jt(document,"touchend touchcancel",l)},_cancel:function(){clearTimeout(this._holdTimeout),jt(document,"touchend touchcancel contextmenu",this._cancel,this),jt(document,"touchmove",this._onMove,this)},_onMove:function(l){var _=l.touches[0];this._newPos=new gt(_.clientX,_.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(l,_){var S=new MouseEvent(l,{bubbles:!0,cancelable:!0,view:window,screenX:_.screenX,screenY:_.screenY,clientX:_.clientX,clientY:_.clientY});S._simulated=!0,_.target.dispatchEvent(S)}});Ci.addInitHook("addHandler","tapHold",Yu),Ci.mergeOptions({touchZoom:Ve.touch,bounceAtZoomLimits:!0});var hu=Da.extend({addHooks:function(){xi(this._map._container,"leaflet-touch-zoom"),Qt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){On(this._map._container,"leaflet-touch-zoom"),jt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(l){var _=this._map;if(!(!l.touches||l.touches.length!==2||_._animatingZoom||this._zooming)){var S=_.mouseEventToContainerPoint(l.touches[0]),B=_.mouseEventToContainerPoint(l.touches[1]);this._centerPoint=_.getSize()._divideBy(2),this._startLatLng=_.containerPointToLatLng(this._centerPoint),_.options.touchZoom!=="center"&&(this._pinchStartLatLng=_.containerPointToLatLng(S.add(B)._divideBy(2))),this._startDist=S.distanceTo(B),this._startZoom=_.getZoom(),this._moved=!1,this._zooming=!0,_._stop(),Qt(document,"touchmove",this._onTouchMove,this),Qt(document,"touchend touchcancel",this._onTouchEnd,this),Ti(l)}},_onTouchMove:function(l){if(!(!l.touches||l.touches.length!==2||!this._zooming)){var _=this._map,S=_.mouseEventToContainerPoint(l.touches[0]),B=_.mouseEventToContainerPoint(l.touches[1]),$=S.distanceTo(B)/this._startDist;if(this._zoom=_.getScaleZoom($,this._startZoom),!_.options.bounceAtZoomLimits&&(this._zoom<_.getMin
10Zoom()&&$<1||this._zoom>_.getMaxZoom()&&$>1)&&(this._zoom=_._limitZoom(this._zoom)),_.options.touchZoom==="center"){if(this._center=this._startLatLng,$===1)return}else{var oe=S._add(B)._divideBy(2)._subtract(this._centerPoint);if($===1&&oe.x===0&&oe.y===0)return;this._center=_.unproject(_.project(this._pinchStartLatLng,this._zoom).subtract(oe),this._zoom)}this._moved||(_._moveStart(!0,!1),this._moved=!0),Xt(this._animRequest);var Ee=T(_._move,_,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Ht(Ee,this,!0),Ti(l)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Xt(this._animRequest),jt(document,"touchmove",this._onTouchMove,this),jt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ci.addInitHook("addHandler","touchZoom",hu),Ci.BoxZoom=fa,Ci.DoubleClickZoom=uu,Ci.Drag=pa,Ci.Keyboard=Ec,Ci.ScrollWheelZoom=cu,Ci.TapHold=Yu,Ci.TouchZoom=hu,D.Bounds=ze,D.Browser=Ve,D.CRS=ri,D.Canvas=Ao,D.Circle=nl,D.CircleMarker=ts,D.Class=ii,D.Control=mr,D.DivIcon=Nl,D.DivOverlay=lr,D.DomEvent=eu,D.DomUtil=or,D.Draggable=Zn,D.Evented=mt,D.FeatureGroup=Ia,D.GeoJSON=is,D.GridLayer=Cr,D.Handler=Da,D.Icon=ka,D.ImageOverlay=sl,D.LatLng=St,D.LatLngBounds=Et,D.Layer=ua,D.LayerGroup=il,D.LineUtil=Dl,D.Map=Ci,D.Marker=es,D.Mixin=Hh,D.Path=Ra,D.Point=gt,D.PolyUtil=nu,D.Polygon=ws,D.Polyline=$s,D.Popup=Eo,D.PosAnimation=bo,D.Projection=rh,D.Rectangle=gi,D.Renderer=Mr,D.SVG=cl,D.SVGOverlay=$u,D.TileLayer=Ys,D.Tooltip=ll,D.Transformation=Ur,D.Util=si,D.VideoOverlay=Mo,D.bind=T,D.bounds=rt,D.canvas=Po,D.circle=sh,D.circleMarker=Cc,D.control=bi,D.divIcon=Fl,D.extend=N,D.featureGroup=Hu,D.geoJSON=Bl,D.geoJson=ou,D.gridLayer=Mc,D.icon=Il,D.imageOverlay=uh,D.latLng=Ct,D.latLngBounds=Pt,D.layerGroup=ah,D.map=en,D.marker=Sc,D.point=It,D.polygon=lh,D.polyline=oh,D.popup=lu,D.rectangle=Xu,D.setOptions=Te,D.stamp=V,D.svg=hl,D.svgOverlay=Fi,D.tileLayer=da,D.tooltip=ul,D.transformation=xr,D.version=R,D.videoOverlay=ol;var Do=window.L;D.noConflict=function(){return window.L=Do,this},window.L=D}))})(sm,sm.exports)),sm.exports}var wc=Oy();const ih=xy(wc);function qh(j,P,D){return Object.freeze({instance:j,context:P,container:D})}function pm(j,P){return P==null?function(R,N){const E=Qe.useRef(void 0);return E.current||(E.current=j(R,N)),E}:function(R,N){const E=Qe.useRef(void 0);E.current||(E.current=j(R,N));const T=Qe.useRef(R),{instance:u}=E.current;return Qe.useEffect(function(){T.current!==R&&(P(u,R,T.current),T.current=R)},[u,R,P]),E}}function By(j,P){Qe.useEffect(function(){return(P.layerContainer??P.map).addLayer(j.instance),function(){P.layerContainer?.removeLayer(j.instance),P.map.removeLayer(j.instance)}},[P,j])}function Ny(j){return function(D){const R=fm(),N=j(Ag(D,R),R);return Iy(R.map,D.attribution),g_(N.current,D.eventHandlers),By(N.current,R),N}}function gx(j,P){const D=Qe.useRef(void 0);Qe.useEffect(function(){if(P.pathOptions!==D.current){const N=P.pathOptions??{};j.instance.setStyle(N),D.current=N}},[j,P])}function _x(j){return function(D){const R=fm(),N=j(Ag(D,R),R);return g_(N.current,D.eventHandlers),By(N.current,R),gx(N.current,D),N}}function yx(j){function P(N,E){return qh(j(N),E)}const D=pm(P),R=fx(D);return Ry(R)}function vx(j,P){const D=pm(j,P),R=Ny(D);return ky(R)}function Fy(j,P){const D=pm(j),R=px(D,P);return dx(R)}function __(j,P){const D=pm(j,P),R=_x(D);return ky(R)}function xx(j,P){const D=pm(j,P),R=Ny(D);return Ry(R)}function bx(j,P,D){const{opacity:R,zIndex:N}=P;R!=null&&R!==D.opacity&&j.setOpacity(R),N!=null&&N!==D.zIndex&&j.setZIndex(N)}function Pg(){return fm().map}const ly=__(function({center:P,children:D,...R},N){const E=new wc.CircleMarker(P,R);return qh(E,Eg(N,{overlayContainer:E}))},ux),wx=__(function({data:P,...D},R){const N=new wc.GeoJSON(P,D);return qh(N,Eg(R,{overlayContainer:N}))},function(P,D,R){D.style!==R.style&&(D.style==null?P.resetStyle():P.setStyle(D.style))});function Tx({bounds:j,boundsOptions:P,center:D,children:R,className:N,id:E,placeholder:T,style:u,whenReady:V,zoom:X,...ce},ne){const[ye]=Qe.useState({className:N,id:E,style:u}),[Se,Ie]=Qe.useState(null),Te=Qe.useRef(void 0);Qe.useImperativeHandle(ne,()=>Se?.map??null,[Se]);const ve=Qe.useCallback(Tt=>{if(Tt!==null&&!Te.current){const dt=new wc.Map(Tt,ce);Te.current=dt,D!=null&&X!=null?dt.setView(D,X):j!=null&&dt.fitBounds(j,P),V!=null&&dt.whenReady(V),Ie(hx(dt))}},[]);Qe.useEffect(()=>()=>{Se?.map.remove()},[Se]);const lt=Se?o_.createElement(m_,{value:Se},R):T??null;return o_.createElement("div",{...ye,ref:ve},lt)}const Sx=Qe.forwardRef(Tx),uy=vx(function({position:P,...D},R){const N=new wc.Marker(P,D);return qh(N,Eg(R,{overlayContainer:N}))},function(P,D,R){D.position!==R.position&&P.setLatLng(D.position),D.icon!=null&&D.icon!==R.icon&&P.setIcon(D.icon),D.zIndexOffset!=null&&D.zIndexOffset!==R.zIndexOffset&&P.setZIndexOffset(D.zIndexOffset),D.opacity!=null&&D.op
10acity!==R.opacity&&P.setOpacity(D.opacity),P.dragging!=null&&D.draggable!==R.draggable&&(D.draggable===!0?P.dragging.enable():P.dragging.disable())}),Cx=__(function({positions:P,...D},R){const N=new wc.Polyline(P,D);return qh(N,Eg(R,{overlayContainer:N}))},function(P,D,R){D.positions!==R.positions&&P.setLatLngs(D.positions)}),Mx=Fy(function(P,D){const R=new wc.Popup(P,D.overlayContainer);return qh(R,D)},function(P,D,{position:R},N){Qe.useEffect(function(){const{instance:T}=P;function u(X){X.popup===T&&(T.update(),N(!0))}function V(X){X.popup===T&&N(!1)}return D.map.on({popupopen:u,popupclose:V}),D.overlayContainer==null?(R!=null&&T.setLatLng(R),T.openOn(D.map)):D.overlayContainer.bindPopup(T),function(){D.map.off({popupopen:u,popupclose:V}),D.overlayContainer?.unbindPopup(),D.map.removeLayer(T)}},[P,D,N,R])}),Ex=xx(function({url:P,...D},R){const N=new wc.TileLayer(P,Ag(D,R));return qh(N,R)},function(P,D,R){bx(P,D,R);const{url:N}=D;N!=null&&N!==R.url&&P.setUrl(N)}),Ax=Fy(function(P,D){const R=new wc.Tooltip(P,D.overlayContainer);return qh(R,D)},function(P,D,{position:R},N){Qe.useEffect(function(){const T=D.overlayContainer;if(T==null)return;const{instance:u}=P,V=ce=>{ce.tooltip===u&&(R!=null&&u.setLatLng(R),u.update(),N(!0))},X=ce=>{ce.tooltip===u&&N(!1)};return T.on({tooltipopen:V,tooltipclose:X}),T.bindTooltip(u),function(){T.off({tooltipopen:V,tooltipclose:X}),T._map!=null&&T.unbindTooltip()}},[P,D,N,R])}),Px=yx(function(P){return new wc.Control.Zoom(P)});var om={exports:{}},zx=om.exports,cy;function Lx(){return cy||(cy=1,(function(j,P){(function(D,R){R(P)})(zx,function(D){var R=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(E){L.Util.setOptions(this,E),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var T=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,T?this._withAnimation:this._noAnimation),this._markerCluster=T?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(E){if(E instanceof L.LayerGroup)return this.addLayers([E]);if(!E.getLatLng)return this._nonPointGroup.addLayer(E),this.fire("layeradd",{layer:E}),this;if(!this._map)return this._needsClustering.push(E),this.fire("layeradd",{layer:E}),this;if(this.hasLayer(E))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(E,this._maxZoom),this.fire("layeradd",{layer:E}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var T=E,u=this._zoom;if(E.__parent)for(;T.__parent._zoom>=u;)T=T.__parent;return this._currentShownBounds.contains(T.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(E,T):this._animationAddLayerNonAnimated(E,T)),this},removeLayer:function(E){return E instanceof L.LayerGroup?this.removeLayers([E]):E.getLatLng?this._map?E.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(E)),this._removeLayer(E,!0),this.fire("layerremove",{layer:E}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),E.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(E)&&(this._featureGroup.removeLayer(E),E.clusterShow&&E.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,E)&&this.hasLayer(E)&&this._needsRemoving.push({layer:E,latlng:E._latlng}),this.fire("layerremove",{layer:E}),this):(this._nonPointGroup.removeLayer(E),this.fire("layerremove",{layer:E}),this)},addLayers:function(E,T){if(!L.Util.isArray(E))return this.addLayer(E);var u=this._featureGroup,V=this._nonPointGroup,X=this.options.chunkedLoading,ce=this.options.chunkInterval,ne=this.options.chunkProgress,ye=E.length,Se=0,Ie=!0,Te;if(this._map){var ve=new Date().getTime(),lt=L.bind(function(){var dt=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();Se<ye;Se++){if(X&&Se%200===0){var Bt=new Date().getTime()-dt;if(Bt>ce)break}if(Te=E[Se],Te instanceof L.LayerGroup){Ie&&(E=E.slice(),Ie=!1),this._extractNonGroupLayers(Te,E),ye=E.length;continue}if(!Te.getLatLng){V.addLayer(Te),T||this.fire("layeradd",{layer:Te});continue}if(!this.hasLayer(Te)&&(this._addLayer(Te,this._maxZoom),T||this.fire("layeradd",{layer:Te}),Te.__parent&&Te.__parent.getChildCount()===2)){var Vt=Te.__parent.getAllChildMarkers(),ui=Vt[0]===Te?Vt[1]:Vt[0];u.removeLayer(ui)}}ne&&ne(Se,ye,new Date().getTime()-ve),Se===ye?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(lt,this.options.chunkDelay)},this);lt()}else for(var Tt=this._needsClustering;Se<ye;Se++){if(Te=E[Se],Te instanceof L.LayerGroup){Ie&&(E=E.slice(),Ie=!1),this._extractNonGroupLayers(Te,E),ye=E.length;continue}if(!Te.getLatLng){V.addLayer(Te);continue}this.hasLayer(Te)||Tt.push(Te)}return this},removeLayers:function(E){var T,u,V=E.length,X=this._featureGroup,ce=this._nonPointGroup,ne=!0;if(!this._map){for(T=0;T<V;T++){if(u=E[T],u instanceof L.LayerGroup){ne&&(E=E.slice(),ne=!1),this._extractNonGroupLayers(u,E),V=E.length;continue}this._arraySplice(this._needsClustering,u),ce.removeLayer(u),this.hasLayer(u)&&this._needsRemoving.push({layer:u,latlng:u._latlng}),this.fire("layerremove",{layer:u})}return this}if(this._unspiderfy){this._unspiderfy();var ye=E.slice(),Se=V;for(T=0;T<Se;T++){if(u=ye[T],u instanceof L.LayerGroup){this._extractNonGroupLayers(u,ye),Se=ye.length;continue}this._unspiderfyLayer(u)}}for(T=0;T<V;T++){if(u=E[T],u instanceof L.LayerGroup){ne&&(E=E.slice(),ne=!1),this._extractNonGroupLayers(u,E),V=E.length;continue}if(!u.__parent){ce.removeLayer(u),this.fire("layerremove",{layer:u});continue}this._removeLayer(u,!0,!0),this.fire("layerremove",{layer:u}),X.hasLayer(u)&&(X.removeLayer(u),u.clusterShow&&u.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(E){E.off(this._childMarkerEventHandlers,this),delete E.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var E=new L.LatLngBounds;this._topClusterLevel&&E.extend(this._topClusterLevel._bounds);for(var T=this._needsClustering.length-1;T>=0;T--)E.extend(this._needsClustering[T].getLatLng());return E.extend(this._nonPointGroup.getBounds()),E},eachLayer:function(E,T){var u=this._needsClustering.slice(),V=this._needsRemoving,X,ce,ne;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(u),ce=u.length-1;ce>=0;ce--){for(X=!0,ne=V.length-1;ne>=0;ne--)if(V[ne].layer===u[ce]){X=!1;break}X&&E.call(T,u[ce])}this._nonPointGroup.eachLayer(E,T)},getLayers:function(){var E=[];return this.eachLayer(function(T){E.push(T)}),E},getLayer:function(E){var T=null;return E=parseInt(E,10),this.eachLayer(function(u){L.stamp(u)===E&&(T=u)}),T},hasLayer:function(E){if(!E)return!1;var T,u=this._needsClustering;for(T=u.length-1;T>=0;T--)if(u[T]===E)return!0;for(u=this._needsRemoving,T=u.length-1;T>=0;T--)if(u[T].layer===E)return!1;return!!(E.__parent&&E.__parent._group===this)||this._nonPointGroup.hasLayer(E)},zoomToShowLayer:function(E,T){var u=this._map;typeof T!="function"&&(T=function(){});var V=function(){(u.hasLayer(E)||u.hasLayer(E.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",V,this),this.off("animationend",V,this),u.hasLayer(E)?T():E.__parent._icon&&(this.once("spiderfied",T,this),E.__parent.spiderfy()))};E._icon&&this._map.getBounds().contains(E.getLatLng())?T():E.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",V,this),this._map.panTo(E.getLatLng())):(this._map.on("moveend",V,this),this.on("animationend",V,this),E.__parent.zoomToBounds())},onAdd:function(E){this._map=E;var T,u,V;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";
10for(this._featureGroup.addTo(E),this._nonPointGroup.addTo(E),this._gridClusters||this._generateInitialClusters(),this._maxLat=E.options.crs.projection.MAX_LATITUDE,T=0,u=this._needsRemoving.length;T<u;T++)V=this._needsRemoving[T],V.newlatlng=V.layer._latlng,V.layer._latlng=V.latlng;for(T=0,u=this._needsRemoving.length;T<u;T++)V=this._needsRemoving[T],this._removeLayer(V.layer,!0),V.layer._latlng=V.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),u=this._needsClustering,this._needsClustering=[],this.addLayers(u,!0)},onRemove:function(E){E.off("zoomend",this._zoomEnd,this),E.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(E){for(var T=E;T&&!T._icon;)T=T.__parent;return T||null},_arraySplice:function(E,T){for(var u=E.length-1;u>=0;u--)if(E[u]===T)return E.splice(u,1),!0},_removeFromGridUnclustered:function(E,T){for(var u=this._map,V=this._gridUnclustered,X=Math.floor(this._map.getMinZoom());T>=X&&V[T].removeObject(E,u.project(E.getLatLng(),T));T--);},_childMarkerDragStart:function(E){E.target.__dragStart=E.target._latlng},_childMarkerMoved:function(E){if(!this._ignoreMove&&!E.target.__dragStart){var T=E.target._popup&&E.target._popup.isOpen();this._moveChild(E.target,E.oldLatLng,E.latlng),T&&E.target.openPopup()}},_moveChild:function(E,T,u){E._latlng=T,this.removeLayer(E),E._latlng=u,this.addLayer(E)},_childMarkerDragEnd:function(E){var T=E.target.__dragStart;delete E.target.__dragStart,T&&this._moveChild(E.target,T,E.target._latlng)},_removeLayer:function(E,T,u){var V=this._gridClusters,X=this._gridUnclustered,ce=this._featureGroup,ne=this._map,ye=Math.floor(this._map.getMinZoom());T&&this._removeFromGridUnclustered(E,this._maxZoom);var Se=E.__parent,Ie=Se._markers,Te;for(this._arraySplice(Ie,E);Se&&(Se._childCount--,Se._boundsNeedUpdate=!0,!(Se._zoom<ye));)T&&Se._childCount<=1?(Te=Se._markers[0]===E?Se._markers[1]:Se._markers[0],V[Se._zoom].removeObject(Se,ne.project(Se._cLatLng,Se._zoom)),X[Se._zoom].addObject(Te,ne.project(Te.getLatLng(),Se._zoom)),this._arraySplice(Se.__parent._childClusters,Se),Se.__parent._markers.push(Te),Te.__parent=Se.__parent,Se._icon&&(ce.removeLayer(Se),u||ce.addLayer(Te))):Se._iconNeedsUpdate=!0,Se=Se.__parent;delete E.__parent},_isOrIsParent:function(E,T){for(;T;){if(E===T)return!0;T=T.parentNode}return!1},fire:function(E,T,u){if(T&&T.layer instanceof L.MarkerCluster){if(T.originalEvent&&this._isOrIsParent(T.layer._icon,T.originalEvent.relatedTarget))return;E="cluster"+E}L.FeatureGroup.prototype.fire.call(this,E,T,u)},listens:function(E,T){return L.FeatureGroup.prototype.listens.call(this,E,T)||L.FeatureGroup.prototype.listens.call(this,"cluster"+E,T)},_defaultIconCreateFunction:function(E){var T=E.getChildCount(),u=" marker-cluster-";return T<10?u+="small":T<100?u+="medium":u+="large",new L.DivIcon({html:"<div><span>"+T+"</span></div>",className:"marker-cluster"+u,iconSize:new L.Point(40,40)})},_bindEvents:function(){var E=this._map,T=this.options.spiderfyOnMaxZoom,u=this.options.showCoverageOnHover,V=this.options.zoomToBoundsOnClick,X=this.options.spiderfyOnEveryZoom;(T||V||X)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),u&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),E.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(E){var T=E.layer,u=T;if(!(E.type==="clusterkeypress"&&E.originalEvent&&E.originalEvent.keyCode!==13)){for(;u._childClusters.length===1;)u=u._childClusters[0];u._zoom===this._maxZoom&&u._childCount===T._childCount&&this.options.spiderfyOnMaxZoom?T.spiderfy():this.options.zoomToBoundsOnClick&&T.zoomToBounds(),this.options.spiderfyOnEveryZoom&&T.spiderfy(),E.originalEvent&&E.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(E){var T=this._map;this._inZoomAnimation||(this._shownPolygon&&T.removeLayer(this._shownPolygon),E.layer.getChildCount()>2&&E.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(E.layer.getConvexHull(),this.options.polygonOptions),T.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var E=this.options.spiderfyOnMaxZoom,T=this.options.showCoverageOnHover,u=this.options.zoomToBoundsOnClick,V=this.options.spiderfyOnEveryZoom,X=this._map;(E||u||V)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),T&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),X.off("zoomend",this._hideCoverage,this))}
10,_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var E=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,E),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),E),this._currentShownBounds=E}},_generateInitialClusters:function(){var E=Math.ceil(this._map.getMaxZoom()),T=Math.floor(this._map.getMinZoom()),u=this.options.maxClusterRadius,V=u;typeof u!="function"&&(V=function(){return u}),this.options.disableClusteringAtZoom!==null&&(E=this.options.disableClusteringAtZoom-1),this._maxZoom=E,this._gridClusters={},this._gridUnclustered={};for(var X=E;X>=T;X--)this._gridClusters[X]=new L.DistanceGrid(V(X)),this._gridUnclustered[X]=new L.DistanceGrid(V(X));this._topClusterLevel=new this._markerCluster(this,T-1)},_addLayer:function(E,T){var u=this._gridClusters,V=this._gridUnclustered,X=Math.floor(this._map.getMinZoom()),ce,ne;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(E),E.on(this._childMarkerEventHandlers,this);T>=X;T--){ce=this._map.project(E.getLatLng(),T);var ye=u[T].getNearObject(ce);if(ye){ye._addChild(E),E.__parent=ye;return}if(ye=V[T].getNearObject(ce),ye){var Se=ye.__parent;Se&&this._removeLayer(ye,!1);var Ie=new this._markerCluster(this,T,ye,E);u[T].addObject(Ie,this._map.project(Ie._cLatLng,T)),ye.__parent=Ie,E.__parent=Ie;var Te=Ie;for(ne=T-1;ne>Se._zoom;ne--)Te=new this._markerCluster(this,ne,Te),u[ne].addObject(Te,this._map.project(ye.getLatLng(),ne));Se._addChild(Te),this._removeFromGridUnclustered(ye,T);return}V[T].addObject(E,ce)}this._topClusterLevel._addChild(E),E.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(E){E instanceof L.MarkerCluster&&E._iconNeedsUpdate&&E._updateIcon()})},_enqueue:function(E){this._queue.push(E),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var E=0;E<this._queue.length;E++)this._queue[E].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var E=Math.round(this._map._zoom);this._processQueue(),this._zoom<E&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,E)):this._zoom>E?(this._animationStart(),this._animationZoomOut(this._zoom,E)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(E){var T=this._maxLat;return T!==void 0&&(E.getNorth()>=T&&(E._northEast.lat=1/0),E.getSouth()<=-T&&(E._southWest.lat=-1/0)),E},_animationAddLayerNonAnimated:function(E,T){if(T===E)this._featureGroup.addLayer(E);else if(T._childCount===2){T._addToMap();var u=T.getAllChildMarkers();this._featureGroup.removeLayer(u[0]),this._featureGroup.removeLayer(u[1])}else T._updateIcon()},_extractNonGroupLayers:function(E,T){var u=E.getLayers(),V=0,X;for(T=T||[];V<u.length;V++){if(X=u[V],X instanceof L.LayerGroup){this._extractNonGroupLayers(X,T);continue}T.push(X)}return T},_overrideMarkerIcon:function(E){var T=E.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[E]}});return T}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(E,T){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),E),this._topClusterLevel._recursivelyAddChildrenToMap(null,T,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(E,T){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),E),this._topClusterLevel._recursivelyAddChildrenToMap(null,T,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(E,T){this._animationAddLayerNonAnimated(E,T)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(E,T){var u=this._getExpandedVisibleBounds(),V=this._featureGroup,X=Math.floor(this._map.getMinZoom()),ce;this._ignoreMove=!0,this._topClusterLevel._recursively(u,E,X,function(ne){var ye=ne._latlng,Se=ne._markers,Ie;for(u.contains(ye)||(ye=null),ne._isSingleParent()&&E+1===T?(V.removeLayer(ne),ne._recursivelyAddChildrenToMap(null,T,u)):(ne.clusterHide(),ne._recursivelyAddChildrenToMap(ye,T,u)),ce=Se.length-1;ce>=0;ce--)Ie=Se[ce],u.contains(Ie._latlng)||V.removeLayer(Ie)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(u,T),V.eachLayer(function(ne){!(ne instanceof L.MarkerCluster)&&ne._icon&&ne.clusterShow()}),this._topClusterLevel._recursively(u,E,T,function(ne){ne._recursivelyRestoreChildPositions(T)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(u,E,X,function(ne){V.removeLayer(ne),ne.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(E,T){this._animationZoomOutSingle(this._topClusterLevel,E-1,T),this._topClusterLevel._recursivelyAddChildrenToMap(null,T,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),E,this._getExpandedVisibleBounds())},_animationAddLayer:function(E,T){var u=this,V=this._featureGroup;V.addLayer(E),T!==E&&(T._childCount>2?(T._updateIcon(),this._forceLayout(),this._animationStart(),E._setPos(this._map.latLngToLayerPoint(T.getLatLng())),E.clusterHide(),this._enqueue(function(){V.removeLayer(E),E.clusterShow(),u._animationEnd()})):(this._forceLayout(),u._animationStart(),u._animationZoomOutSingle(T,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(E,T,u){var V=this._getExpandedVisibleBounds(),X=Math.floor(this._map.getMinZoom());E._recursivelyAnimateChildrenInAndAddSelfToMap(V,X,T+1,u);var ce=this;this._forceLayout(),E._recursivelyBecomeVisible(V,u),this._enqueue(function(){if(E._childCount===1){var ne=E._markers[0];this._ignoreMove=!0,ne.setLatLng(ne.getLatLng()),this._ignoreMove=!1,ne.clusterShow&&ne.clusterShow()}else E._recursively(V,u,X,function(ye){ye._recursivelyRemoveChildrenFromMap(V,X,T+1)});ce._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(E){return new L.MarkerClusterGroup(E)};
10var N=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(E,T,u,V){L.Marker.prototype.initialize.call(this,u?u._cLatLng||u.getLatLng():new L.LatLng(0,0),{icon:this,pane:E.options.clusterPane}),this._group=E,this._zoom=T,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,u&&this._addChild(u),V&&this._addChild(V)},getAllChildMarkers:function(E,T){E=E||[];for(var u=this._childClusters.length-1;u>=0;u--)this._childClusters[u].getAllChildMarkers(E,T);for(var V=this._markers.length-1;V>=0;V--)T&&this._markers[V].__dragStart||E.push(this._markers[V]);return E},getChildCount:function(){return this._childCount},zoomToBounds:function(E){for(var T=this._childClusters.slice(),u=this._group._map,V=u.getBoundsZoom(this._bounds),X=this._zoom+1,ce=u.getZoom(),ne;T.length>0&&V>X;){X++;var ye=[];for(ne=0;ne<T.length;ne++)ye=ye.concat(T[ne]._childClusters);T=ye}V>X?this._group._map.setView(this._latlng,X):V<=ce?this._group._map.setVie
vendor: 1,082 bytes, line 10
10w(this._latlng,ce+1):this._group._map.fitBounds(this._bounds,E)},getBounds:function(){var E=new L.LatLngBounds;return E.extend(this._bounds),E},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(E,T){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(E),E instanceof L.MarkerCluster?(T||(this._childClusters.push(E),E.__parent=this),this._childCount+=E._childCount):(T||this._markers.push(E),this._childCount++),this.__parent&&this.__parent._addChild(E,!0)},_setClusterCenter:function(E){this._cLatLng||(this._cLatLng=E._cLatLng||E._latlng)},_resetBounds:function(){var E=this._bounds;E._southWest&&(E._southWest.lat=1/0,E._southWest.lng=1/0),E._northEast&&(E._northEast.lat=-1/0,E._northEast.lng=-1/0)},_recalculateBounds:function(){var E=this._markers,T=this._childClusters,u=0,V=0,
10X=this._childCount,ce,ne,ye,Se;if(X!==0){for(this._resetBounds(),ce=0;ce<E.length;ce++)ye=E[ce]._latlng,this._bounds.extend(ye),u+=ye.lat,V+=ye.lng;for(ce=0;ce<T.length;ce++)ne=T[ce],ne._boundsNeedUpdate&&ne._recalculateBounds(),this._bounds.extend(ne._bounds),ye=ne._wLatLng,Se=ne._childCount,u+=ye.lat*Se,V+=ye.lng*Se;this._latlng=this._wLatLng=new L.LatLng(u/X,V/X),this._boundsNeedUpdate=!1}},_addToMap:function(E){E&&(this._backupLatlng=this._latlng,this.setLatLng(E)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(E,T,u){this._recursively(E,this._group._map.getMinZoom(),u-1,function(V){var X=V._markers,ce,ne;for(ce=X.length-1;ce>=0;ce--)ne=X[ce],ne._icon&&(ne._setPos(T),ne.clusterHide())},function(V){var X=V._childClusters,ce,ne;for(ce=X.length-1;ce>=0;ce--)ne=X[ce],ne._icon&&(ne._setPos(T),ne.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(E,T,u,V){this._recursively(E,V,T,function(X){X._recursivelyAnimateChildrenIn(E,X._group._map.latLngToLayerPoint(X.getLatLng()).round(),u),X._isSingleParent()&&u-1===V?(X.clusterShow(),X._recursivelyRemoveChildrenFromMap(E,T,u)):X.clusterHide(),X._addToMap()})},_recursivelyBecomeVisible:function(E,T){this._recursively(E,this._group._map.getMinZoom(),T,null,function(u){u.clusterShow()})},_recursivelyAddChildrenToMap:function(E,T,u){this._recursively(u,this._group._map.getMinZoom()-1,T,function(V){if(T!==V._zoom)for(var X=V._markers.length-1;X>=0;X--){var ce=V._markers[X];u.contains(ce._latlng)&&(E&&(ce._backupLatlng=ce.getLatLng(),ce.setLatLng(E),ce.clusterHide&&ce.clusterHide()),V._group._featureGroup.addLayer(ce))}},function(V){V._addToMap(E)})},_recursivelyRestoreChildPositions:function(E){for(var T=this._markers.length-1;T>=0;T--){var u=this._markers[T];u._backupLatlng&&(u.setLatLng(u._backupLatlng),delete u._backupLatlng)}if(E-1===this._zoom)for(var V=this._childClusters.length-1;V>=0;V--)this._childClusters[V]._restorePosition();else for(var X=this._childClusters.length-1;X>=0;X--)this._childClusters[X]._recursivelyRestoreChildPositions(E)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(E,T,u,V){var X,ce;this._recursively(E,T-1,u-1,function(ne){for(ce=ne._markers.length-1;ce>=0;ce--)X=ne._markers[ce],(!V||!V.contains(X._latlng))&&(ne._group._featureGroup.removeLayer(X),X.clusterShow&&X.clusterShow())},function(ne){for(ce=ne._childClusters.length-1;ce>=0;ce--)X=ne._childClusters[ce],(!V||!V.contains(X._latlng))&&(ne._group._featureGroup.removeLayer(X),X.clusterShow&&X.clusterShow())})},_recursively:function(E,T,u,V,X){var ce=this._childClusters,ne=this._zoom,ye,Se;if(T<=ne&&(V&&V(this),X&&ne===u&&X(this)),ne<T||ne<u)for(ye=ce.length-1;ye>=0;ye--)Se=ce[ye],Se._boundsNeedUpdate&&Se._recalculateBounds(),E.intersects(Se._bounds)&&Se._recursively(E,T,u,V,X)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var E=this.options.opacity;return this.setOpacity(0),this.options.opacity=E,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(E){this._cellSize=E,this._sqCellSize=E*E,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(E,T){var u=this._getCoord(T.x),V=this._getCoord(T.y),X=this._grid,ce=X[V]=X[V]||{},ne=ce[u]=ce[u]||[],ye=L.Util.stamp(E);this._objectPoint[ye]=T,ne.push(E)},updateObject:function(E,T){this.removeObject(E),this.addObject(E,T)},removeObject:function(E,T){var u=this._getCoord(T.x),V=this._getCoord(T.y),X=this._grid,ce=X[V]=X[V]||{},ne=ce[u]=ce[u]||[],ye,Se;for(delete this._objectPoint[L.Util.stamp(E)],ye=0,Se=ne.length;ye<Se;ye++)if(ne[ye]===E)return ne.splice(ye,1),Se===1&&delete ce[u],!0},eachObject:function(E,T){var u,V,X,ce,ne,ye,Se,Ie=this._grid;for(u in Ie){ne=Ie[u];for(V in ne)for(ye=ne[V],X=0,ce=ye.length;X<ce;X++)Se=E.call(T,ye[X]),Se&&(X--,ce--)}},getNearObject:function(E){var T=this._getCoord(E.x),u=this._getCoord(E.y),V,X,ce,ne,ye,Se,Ie,Te,ve=this._objectPoint,lt=this._sqCellSize,Tt=null;for(V=u-1;V<=u+1;V++)if(ne=this._grid[V],ne){for(X=T-1;X<=T+1;X++)if(ye=ne[X],ye)for(ce=0,Se=ye.length;ce<Se;
vendor: 5,900 bytes, line 10
10ce++)Ie=ye[ce],Te=this._sqDist(ve[L.Util.stamp(Ie)],E),(Te<lt||Te<=lt&&Tt===null)&&(lt=Te,Tt=Ie)}return Tt},_getCoord:function(E){var T=Math.floor(E/this._cellSize);return isFinite(T)?T:E},_sqDist:function(E,T){var u=T.x-E.x,V=T.y-E.y;return u*u+V*V}},(function(){L.QuickHull={getDistant:function(E,T){var u=T[1].lat-T[0].lat,V=T[0].lng-T[1].lng;return V*(E.lat-T[0].lat)+u*(E.lng-T[0].lng)},findMostDistantPointFromBaseLine:function(E,T){var u=0,V=null,X=[],ce,ne,ye;for(ce=T.length-1;ce>=0;ce--){if(ne=T[ce],ye=this.getDistant(ne,E),ye>0)X.push(ne);else continue;ye>u&&(u=ye,V=ne)}return{maxPoint:V,newPoints:X}},buildConvexHull:function(E,T){var u=[],V=this.findMostDistantPointFromBaseLine(E,T);return V.maxPoint?(u=u.concat(this.buildConvexHull([E[0],V.maxPoint],V.newPoints)),u=u.concat(this.buildConvexHull([V.maxPoint,E[1]],V.newPoints)),u):[E[0]]},getConvexHull:function(E){var T=!1,u=!1,V=!1,X=!1,ce=null,ne=null,ye=null,Se=null,Ie=null,Te=null,ve;for(ve=E.length-1;ve>=0;ve--){var lt=E[ve];(T===!1||lt.lat>T)&&(ce=lt,T=lt.lat),(u===!1||lt.lat<u)&&(ne=lt,u=lt.lat),(V===!1||lt.lng>V)&&(ye=lt,V=lt.lng),(X===!1||lt.lng<X)&&(Se=lt,X=lt.lng)}u!==T?(Te=ne,Ie=ce):(Te=Se,Ie=ye);var Tt=[].concat(this.buildConvexHull([Te,Ie],E),this.buildConvexHull([Ie,Te],E));return Tt}}})(),L.MarkerCluster.include({getConvexHull:function(){var E=this.getAllChildMarkers(),T=[],u,V;for(V=E.length-1;V>=0;V--)u=E[V].getLatLng(),T.push(u);return L.QuickHull.getConvexHull(T)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var E=this.getAllChildMarkers(null,!0),T=this._group,u=T._map,V=u.latLngToLayerPoint(this._latlng),X;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?X=this._group.options.spiderfyShapePositions(E.length,V):E.length>=this._circleSpiralSwitchover?X=this._generatePointsSpiral(E.length,V):(V.y+=10,X=this._generatePointsCircle(E.length,V)),this._animationSpiderfy(E,X)}},unspiderfy:function(E){this._group._inZoomAnimation||(this._animationUnspiderfy(E),this._group._spiderfied=null)},_generatePointsCircle:function(E,T){var u=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+E),V=u/this._2PI,X=this._2PI/E,ce=[],ne,ye;for(V=Math.max(V,35),ce.length=E,ne=0;ne<E;ne++)ye=this._circleStartAngle+ne*X,ce[ne]=new L.Point(T.x+V*Math.cos(ye),T.y+V*Math.sin(ye))._round();return ce},_generatePointsSpiral:function(E,T){var u=this._group.options.spiderfyDistanceMultiplier,V=u*this._spiralLengthStart,X=u*this._spiralFootSeparation,ce=u*this._spiralLengthFactor*this._2PI,ne=0,ye=[],Se;for(ye.length=E,Se=E;Se>=0;Se--)Se<E&&(ye[Se]=new L.Point(T.x+V*Math.cos(ne),T.y+V*Math.sin(ne))._round()),ne+=X/V+Se*5e-4,V+=ce/ne;return ye},_noanimationUnspiderfy:function(){var E=this._group,T=E._map,u=E._featureGroup,V=this.getAllChildMarkers(null,!0),X,ce;for(E._ignoreMove=!0,this.setOpacity(1),ce=V.length-1;ce>=0;ce--)X=V[ce],u.removeLayer(X),X._preSpiderfyLatlng&&(X.setLatLng(X._preSpiderfyLatlng),delete X._preSpiderfyLatlng),X.setZIndexOffset&&X.setZIndexOffset(0),X._spiderLeg&&(T.removeLayer(X._spiderLeg),delete X._spiderLeg);E.fire("unspiderfied",{cluster:this,markers:V}),E._ignoreMove=!1,E._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(E,T){var u=this._group,V=u._map,X=u._featureGroup,ce=this._group.options.spiderLegPolylineOptions,ne,ye,Se,Ie;for(u._ignoreMove=!0,ne=0;ne<E.length;ne++)Ie=V.layerPointToLatLng(T[ne]),ye=E[ne],Se=new L.Polyline([this._latlng,Ie],ce),V.addLayer(Se),ye._spiderLeg=Se,ye._preSpiderfyLatlng=ye._latlng,ye.setLatLng(Ie),ye.setZIndexOffset&&ye.setZIndexOffset(1e6),X.addLayer(ye);this.setOpacity(.3),u._ignoreMove=!1,u.fire("spiderfied",{cluster:this,markers:E})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(E,T){var u=this,V=this._group,X=V._map,ce=V._featureGroup,ne=this._latlng,ye=X.latLngToLayerPoint(ne),Se=L.Path.SVG,Ie=L.extend({},this._group.options.spiderLegPolylineOptions),Te=Ie.opacity,ve,lt,Tt,dt,Bt,Vt;for(Te===void 0&&(Te=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),Se?(Ie.opacity=0,Ie.className=(Ie.className||"")+" leaflet-cluster-spider-leg"):Ie.opacity=Te,V._ignoreMove=!0,ve=0;ve<E.length;ve++)lt=E[ve],Vt=X.layerPointToLatLng(T[ve]),Tt=new L.Polyline([ne,Vt],Ie),X.addLayer(Tt),lt._spiderLeg=Tt,Se&&(dt=Tt._path,Bt=dt.getTotalLength()+.1,dt.style.strokeDasharray=Bt,dt.style.strokeDashoffset=Bt),lt.setZIndexOffset&&lt.setZIndexOffset(1e6),lt.clusterHide&&lt.clusterHide(),ce.addLayer(lt),lt._setPos&&lt._setPos(ye);for(V._forceLayout(),V._animationStart(),ve=E.length-1;ve>=0;ve--)Vt=X.layerPointToLatLng(T[ve]),lt=E[ve],lt._preSpiderfyLatlng=lt._latlng,lt.setLatLng(Vt),lt.clusterShow&&lt.clusterShow(),Se&&(Tt=lt._spiderLeg,dt=Tt._path,dt.style.strokeDashoffset=0,Tt.setStyle({opacity:Te}));this.setOpacity(.3),V._ignoreMove=!1,setTimeout(function(){V._animationEnd(),V.fire("spiderfied",{cluster:u,markers:E})},200)},_animationUnspiderfy:function(E){var T=this,u=this._group,V=u._map,X=u._featureGroup,ce=E?V._latLngToNewLayerPoint(this._latlng,E.zoom,E.center):V.latLngToLayerPoint(this._latlng),ne=this.getAllChildMarkers(null,!0),ye=L.Path.SVG,Se,Ie,Te,ve,lt,Tt;for(u._ignoreMove=!0,u._animationStart(),this.setOpacity(1),Ie=ne.length-1;Ie>=0;Ie--)Se=ne[Ie],Se._preSpiderfyLatlng&&(Se.closePopup(),Se.setLatLng(Se._preSpiderfyLatlng),delete Se._preSpiderfyLatlng,Tt=!0,Se._setPos&&(Se._setPos(ce),Tt=!1),Se.clusterHide&&(Se.clusterHide(),Tt=!1),Tt&&X.removeLayer(Se),ye&&(Te=Se._spiderLeg,ve=Te._path,lt=ve.getTotalLength()+.1,ve.style.strokeDashoffset=lt,Te.setStyle({opacity:0}
10)));u._ignoreMove=!1,setTimeout(function(){var dt=0;for(Ie=ne.length-1;Ie>=0;Ie--)Se=ne[Ie],Se._spiderLeg&&dt++;for(Ie=ne.length-1;Ie>=0;Ie--)Se=ne[Ie],Se._spiderLeg&&(Se.clusterShow&&Se.clusterShow(),Se.setZIndexOffset&&Se.setZIndexOffset(0),dt>1&&X.removeLayer(Se),V.removeLayer(Se._spiderLeg),delete Se._spiderLeg);u._animationEnd(),u.fire("unspiderfied",{cluster:T,markers:ne})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(E){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(E))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(E){this._spiderfied&&this._spiderfied.unspiderfy(E)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(E){E._spiderLeg&&(this._featureGroup.removeLayer(E),E.clusterShow&&E.clusterShow(),E.setZIndexOffset&&E.setZIndexOffset(0),this._map.removeLayer(E._spiderLeg),delete E._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(E){return E?E instanceof L.MarkerClusterGroup?E=E._topClusterLevel.getAllChildMarkers():E instanceof L.LayerGroup?E=E._layers:E instanceof L.MarkerCluster?E=E.getAllChildMarkers():E instanceof L.Marker&&(E=[E]):E=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(E),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(E),this},_flagParentsIconsNeedUpdate:function(E){var T,u;for(T in E)for(u=E[T].__parent;u;)u._iconNeedsUpdate=!0,u=u.__parent},_refreshSingleMarkerModeMarkers:function(E){var T,u;for(T in E)u=E[T],this.hasLayer(u)&&u.setIcon(this._overrideMarkerIcon(u))}}),L.Marker.include({refreshIconOptions:function(E,T){var u=this.options.icon;return L.setOptions(u,E),this.setIcon(u),T&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),D.MarkerClusterGroup=R,D.MarkerCluster=N,Object.defineProperty(D,"__esModule",{value:!0})})})(om,om.exports)),om.exports}Lx();function jy({url:j,title:P}){const{t:D}=qa(),[R,N]=Qe.useState(!1),[E,T]=Qe.useState(!1),[u,V]=Qe.useState(null),X=Qe.useRef(null),ce=Qe.useCallback(()=>{if(!X.current)return;const Te=X.current.getBoundingClientRect();V({top:Te.top,right:window.innerWidth-Te.right})},[]);Qe.useEffect(()=>{if(!R)return;function Te(ve){if(X.current&&X.current.contains(ve.target))return;const lt=document.getElementById("share-popup-portal");lt&&lt.contains(ve.target)||N(!1)}return document.addEventListener("mousedown",Te),()=>document.removeEventListener("mousedown",Te)},[R]);function ne(){R||ce(),N(!R)}function ye(){const Te=document.createElement("textarea");Te.value=j,Te.style.position="fixed",Te.style.opacity="0",document.body.appendChild(Te),Te.select();try{document.execCommand("copy")}catch{}document.body.removeChild(Te),navigator.clipboard?.writeText(j).catch(()=>{}),T(!0),setTimeout(()=>{T(!1),N(!1)},1500)}function Se(){const Te=P?`${P} — ${j}`:j;window.open(`https://wa.me/?text=${encodeURIComponent(Te)}`,"_blank"),N(!1)}function Ie(){const Te=P||"Cherry Blossom Walk",ve=P?`${P}
11
12${j}`:j;window.open(`mailto:?subject=${encodeURIComponent(Te)}&body=${encodeURIComponent(ve)}`,"_blank"),N(!1)}return te.jsxs(te.Fragment,{children:[te.jsx("button",{ref:X,className:"share-icon-btn",onClick:ne,title:D("share.share"),children:te.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[te.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),te.jsx("polyline",{points:"16 6 12 2 8 6"}),te.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}),R&&u&&Sg.createPortal(te.jsxs("div",{id:"share-popup-portal",className:"share-popup",style:{position:"fixed",top:u.top,right:u.right,transform:"translateY(-100%) translateY(-8px)"},children:[te.jsxs("button",{className:"share-popup-item",onClick:ye,children:[te.jsx("span",{className:"share-popup-icon",children:E?"✓":"🔗"}),te.jsx("span",{children:D(E?"share.copied":"share.copyLink")})]}),te.jsxs("button",{className:"share-popup-item",onClick:Se,children:[te.jsx("span",{className:"share-popup-icon",children:"💬"}),te.jsx("span",{children:"WhatsApp"})]}),te.jsxs("button",{className:"share-popup-item",onClick:Ie,children:[te.jsx("span",{className:"share-popup-icon",children:"✉️"}),te.jsx("span",{children:"E-Mail"})]})]}),document.body)]})}const Dx="dqw6v4piu",Ix="cherryblossom_unsigned",kx="/api/photos.php",r_=new Map,Rx=300*1e3,gg=new Map;function Uy(j,P){const[D,R]=Qe.useState([]),[N,E]=Qe.useState(null),[T,u]=Qe.useState(!0),[V,X]=Qe.useState(!1),[ce,ne]=Qe.useState(0),[ye,Se]=Qe.useState(!1),[Ie,Te]=Qe.useState(null),ve=Qe.useRef(!0),lt=Qe.useRef(null);Qe.useEffect(()=>(ve.current=!0,()=>{ve.current=!1,lt.current&&lt.current.abort()}),[]),Qe.useEffect(()=>{if(!j)return;const dt=r_.get(j);
12if(dt&&Date.now()-dt.ts<Rx){R(dt.photos),E(dt.hero),u(!1);return}u(!0),Te(null),fetch(`${kx}?action=list&tree_id=${encodeURIComponent(j)}`).then(Bt=>{if(!Bt.ok)throw new Error(`HTTP ${Bt.status}`);return Bt.json()}).then(Bt=>{if(!ve.current)return;const Vt=Array.isArray(Bt)?Bt:[],ui=Vt.find(Ht=>Ht.hero)||null,Ft=gg.get(j)||[],vi=new Set(Vt.map(Ht=>Ht.public_id)),Kt=Ft.filter(Ht=>!vi.has(Ht.public_id));gg.set(j,Kt);const qt=[...Vt,...Kt];R(qt),E(ui),u(!1),r_.set(j,{photos:qt,hero:ui,ts:Date.now()})}).catch(()=>{ve.current&&(R([]),E(null),u(!1))})},[j]);const Tt=Qe.useCallback((dt,Bt)=>{if(!dt||!j)return;if(!dt.type.startsWith("image/")){Te("invalid_type");return}if(dt.size>10*1024*1024){Te("too_large");return}X(!0),ne(0),Te(null),Se(!1);const Vt=new FormData;Vt.append("file",dt),Vt.append("upload_preset",Ix),Vt.append("folder",`cherryblossom/${j}`);const ui=[`tree_${j}`,"status_pending"];P&&ui.push(`objectid_${P}`),Vt.append("tags",ui.join(",")),Bt&&Bt.trim()&&Vt.append("context",`credit=${Bt.trim()}`);const Ft=new XMLHttpRequest;lt.current=Ft,Ft.upload.onprogress=vi=>{vi.lengthComputable&&ve.current&&ne(Math.round(vi.loaded/vi.total*100))},Ft.onload=()=>{if(ve.current)if(lt.current=null,Ft.status===200)try{const vi=JSON.parse(Ft.responseText),Kt={url:vi.secure_url,public_id:vi.public_id,width:vi.width,height:vi.height,created_at:vi.created_at,credit:Bt?.trim()||"",pending:!0,hero:!1};R(Ht=>[...Ht,Kt]),X(!1),Se(!0);const qt=gg.get(j)||[];gg.set(j,[...qt,Kt]),r_.delete(j),setTimeout(()=>{ve.current&&Se(!1)},4e3)}catch{Te("upload_failed"),X(!1)}else Te("upload_failed"),X(!1)},Ft.onerror=()=>{ve.current&&(lt.current=null,Te("upload_failed"),X(!1))},Ft.open("POST",`https://api.cloudinary.com/v1_1/${Dx}/image/upload`),Ft.send(Vt)},[j]);return{photos:D,heroPhoto:N,loading:T,uploading:V,uploadProgress:ce,uploadSuccess:ye,uploadPhoto:Tt,error:Ie}}function Ox(j){return!j||!j.includes("/upload/")?j:j.replace("/upload/","/upload/l_text:Arial_14_bold:hanami-zh.ch,co_rgb:FFFFFF,o_40,g_south_east,x_10,y_10/")}function Bx({photos:j,initialIndex:P,onClose:D}){const[R,N]=Qe.useState(P||0),E=j.length,T=j[R],u=Qe.useCallback(()=>{N(ce=>ce>0?ce-1:E-1)},[E]),V=Qe.useCallback(()=>{N(ce=>ce<E-1?ce+1:0)},[E]);if(Qe.useEffect(()=>{function ce(ne){ne.key==="Escape"&&D(),ne.key==="ArrowLeft"&&u(),ne.key==="ArrowRight"&&V()}return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[D,u,V]),!T)return null;const X=Ox(T.url);return te.jsx("div",{className:"photo-lightbox",onClick:D,children:te.jsxs("div",{className:"photo-lightbox-content",onClick:ce=>ce.stopPropagation(),children:[te.jsx("button",{className:"photo-lightbox-close",onClick:D,children:"✕"}),te.jsx("img",{className:"photo-lightbox-image",src:X,alt:""}),(T.credit||T.created_at)&&te.jsxs("div",{className:"photo-lightbox-info",children:[T.credit&&te.jsxs("span",{className:"photo-lightbox-credit",children:["📷 ",T.credit]}),T.created_at&&te.jsx("span",{className:"photo-lightbox-date",children:new Date(T.created_at).toLocaleDateString("de-CH",{day:"numeric",month:"short",year:"numeric"})})]}),E>1&&te.jsxs(te.Fragment,{children:[te.jsx("button",{className:"photo-lightbox-nav photo-lightbox-prev",onClick:u,children:"‹"}),te.jsx("button",{className:"photo-lightbox-nav photo-lightbox-next",onClick:V,children:"›"}),te.jsxs("div",{className:"photo-lightbox-counter",children:[R+1," / ",E]})]})]})})}const Nx={title:"Nutzungsbedingungen für Bild-Uploads",intro:"Die folgenden Bedingungen gelten für das Hochladen von Bildern durch Nutzerinnen und Nutzer auf hanami-zh.ch.",sections:[{heading:"§ 1 Geltungsbereich",text:"Diese Nutzungsbedingungen regeln das Hochladen von Bildern (nachfolgend «Inhalte») durch registrierte und nicht-registrierte Nutzerinnen und Nutzer (nachfolgend «Nutzer») auf die Plattform Hanami Zürich unter hanami-zh.ch (nachfolgend «Plattform»), betrieben von sinnhaft GmbH, Seefeldstrasse, 8008 Zürich, Schweiz (nachfolgend «Betreiber»)."},{heading:"§ 2 Rechteeinräumung und Lizenz",items:["Mit dem Hochladen eines Inhalts verzichtet der Nutzer im grösstmöglichen gesetzlich zulässigen Umfang auf sämtliche Urheber- und verwandten Schutzrechte am hochgeladenen Inhalt und gibt diesen unter der CC0 1.0 Universal Public Domain Dedication (creativecommons.org/publicdomain/zero/1.0/) für die Allgemeinheit frei.","Der Nutzer stimmt zu, dass der Betreiber den Inhalt ohne Namensnennung und ohne Einschränkungen veröffentlichen, vervielfältigen, bearbeiten und an Dritte weitergeben darf.","Die Freigabe ist unwiderruflich. Der Nutzer kann jedoch jederzeit verlangen, dass der Betreiber den Inhalt von der Plattform entfernt. Bereits unter CC0 an Dritte weitergegebene oder veröffentlichte Kopien bleiben von der Entfernung unberührt."]},{heading:"§ 3 Zusicherungen des Nutzers",text:"Mit dem Hochladen eines Inhalts versichert der Nutzer:",items:["dass er Urheber des Inhalts ist oder über die erforderlichen Rechte verfügt, um die in § 2 beschriebene Freigabe vorzunehmen;","dass der Inhalt keine Rechte Dritter verletzt (insbesondere Urheberrechte, Markenrechte, Persönlichkeitsrechte);","dass auf dem Inhalt abgebildete Personen in die Veröffentlichung eingewilligt haben oder dass keine Personen erkennbar abgebildet sind;","dass der Inhalt keine rechtswidrigen, anstössigen, diskriminierenden oder anderweitig unzulässigen Darstellungen enthält;","dass er minderjährige Personen weder abgebildet noch identifizierbar gemacht hat, es sei denn, eine ausdrückliche Einwilligung der Erziehungsberechtigten liegt vor."],ordered:!0,labels:["a)","b)","c)","d)","e)"]},{heading:"§ 4 Haftung und Freistellung",items:["Der Nutzer stellt den Betreiber von sämtlichen Ansprüchen Dritter frei, die aus einer Verletzung der in § 3 genannten Zusicherungen resultieren.","Der Betreiber haftet nicht für die Rechtmässigkeit der hochgeladenen Inhalte. Eine inhaltliche Prüfung findet nicht statt.","Der Betreiber behält sich das Recht vor, Inhalte ohne Angabe von Gründen zu entfernen."]},{heading:"§ 5 Datenschutz",text:"Die Verarbeitung personenbezogener Daten im Zusammenhang mit dem Bild-Upload richtet sich nach der separaten Datenschutzerklärung. Insbesondere werden EXIF-Metadaten (GPS-Koordinaten, Zeitstempel, Geräteinformationen) vor der Veröffentlichung entfernt, sofern der Nutzer nicht ausdrücklich in deren Veröffentlichung einwilligt."},{heading:"§ 6 Anwendbares Recht und Gerichtsstand",text:"Es gilt schweizerisches Recht. Gerichtsstand ist Zürich, Schweiz."}]},Fx={title:"Terms of Use for Image Uploads",intro:"The following terms apply to the uploading of images by users on hanami-zh.ch.",sections:[{heading:"Section 1: Scope",text:'These Terms of Use govern the uploading of images (hereinafter "Content") by registered and unregistered users (hereinafter "User") on the platform Hanami Zürich at hanami-zh.ch (hereinafter "Platform"), operated by sinnhaft GmbH, Seefeldstrasse, 8008 Zurich, Switzerland (hereinafter "Operator").'},{heading:"Section 2: Grant of Rights and License",items:["By uploading Content, the User waives, to the fullest extent permitted by law, all c
12opyright and related rights in the uploaded Content and dedicates it to the public domain under the CC0 1.0 Universal Public Domain Dedication (creativecommons.org/publicdomain/zero/1.0/).","The User agrees that the Operator may publish, reproduce, modify, and distribute the Content to third parties without attribution and without restriction.","The dedication is irrevocable. However, the User may at any time request that the Operator remove the Content from the Platform. Copies already published or distributed to third parties under CC0 remain unaffected by such removal."]},{heading:"Section 3: User Representations",text:"By uploading Content, the User represents and warrants that:",items:["the User is the creator of the Content or holds the necessary rights to make the dedication described in Section 2;","the Content does not infringe any third-party rights (including copyright, trademark, and personality rights);","any persons depicted in the Content have consented to its publication, or no persons are identifiably depicted;","the Content does not contain unlawful, offensive, discriminatory, or otherwise impermissible material;","no minors are depicted or identifiable unless explicit consent from a legal guardian has been obtained."],ordered:!0,labels:["a)","b)","c)","d)","e)"]},{heading:"Section 4: Liability and Indemnification",items:["The User shall indemnify and hold harmless the Operator from any third-party claims arising from a breach of the representations in Section 3.","The Operator assumes no liability for the legality of uploaded Content. No content review is performed.","The Operator reserves the right to remove Content without stating reasons."]},{heading:"Section 5: Data Protection",text:"The processing of personal data in connection with image uploads is governed by the separate Privacy Notice. In particular, EXIF metadata (GPS coordinates, timestamps, device information) will be removed prior to publication unless the User explicitly consents to their publication."},{heading:"Section 6: Governing Law and Jurisdiction",text:"Swiss law shall apply. The place of jurisdiction is Zurich, Switzerland."}]};function Vy({open:j,onClose:P}){const{i18n:D}=qa(),N=(D.language?.startsWith("de")?"de":"en")==="de"?Nx:Fx;return j?te.jsxs(te.Fragment,{children:[te.jsx("div",{className:"impressum-backdrop",onClick:P}),te.jsxs("div",{className:"image-terms-modal",children:[te.jsx("button",{className:"impressum-close",onClick:P,"aria-label":"Close",children:"✕"}),te.jsx("h2",{className:"impressum-title",children:N.title}),te.jsx("p",{className:"image-terms-intro",children:N.intro}),N.sections.map((E,T)=>te.jsxs("div",{className:"image-terms-section",children:[te.jsx("h3",{children:E.heading}),E.text&&te.jsx("p",{children:E.text}),E.items&&te.jsx("ul",{className:E.ordered?"image-terms-list--labeled":"image-terms-list",children:E.items.map((u,V)=>te.jsx("li",{children:E.labels?te.jsxs(te.Fragment,{children:[te.jsx("span",{className:"image-terms-label",children:E.labels[V]})," ",u]}):u},V))})]},T)),te.jsxs("div",{className:"impressum-copy",children:["© ",new Date().getFullYear()," sinnhaft GmbH"]})]})]}):null}const hy={de:{communityPhotos:"Community-Fotos",addPhoto:"Foto hinzufügen",firstPhoto:"Noch kein Foto — lade das allererste Bild hoch!",uploading:"Wird hochgeladen...",uploadSuccess:"Hochgeladen! Wird nach Prüfung angezeigt.",uploadError:"Fehler beim Hochladen",tooLarge:"Bild zu gross (max. 10 MB)",invalidType:"Nur Bilder erlaubt",pendingReview:"Wird geprüft",creditPlaceholder:"Dein Name (optional)",copyright:"Ich bestätige, dass ich die Urheberrechte am Bild habe und es unter CC0 1.0 (Public Domain) unwiderruflich für die Allgemeinheit freigebe.",termsLink:"Vollständige Nutzungsbedingungen",send:"Hochladen",cancel:"Abbrechen"},en:{communityPhotos:"Community photos",addPhoto:"Add photo",firstPhoto:"No photos yet — be the first to upload one!",uploading:"Uploading...",uploadSuccess:"Uploaded! Will appear after review.",uploadError:"Upload failed",tooLarge:"Image too large (max 10 MB)",invalidType:"Only images allowed",pendingReview:"Pending review",creditPlaceholder:"Your name (optional)",copyright:"I confirm that I hold the copyright to this image and irrevocably dedicate it to the public domain under CC0 1.0 (Public Domain).",termsLink:"Full Terms of Use",send:"Upload",cancel:"Cancel"}};function jx(j){return j.replace("/upload/","/upload/c_fill,w_128,h_128,q_auto/")}function Ux({treeId:j,objectId:P,lang:D}){const R=hy[D]||hy.de,N=Qe.useRef(null),[E,T]=Qe.useState(null),[u,V]=Qe.useState(null),[X,ce]=Qe.useState(null),[ne,ye]=Qe.useState(""),[Se,Ie]=Qe.useState(!1),[Te,ve]=Qe.useState(!1),{photos:lt,loading:Tt,uploading:dt,uploadProgress:Bt,uploadSuccess:Vt,uploadPhoto:ui,error:Ft}=Uy(j,P);function vi(ii){const Vi=ii.target.files?.[0];Vi&&(V(Vi),ce(URL.createObjectURL(Vi)),Ie(!1)),ii.target.value=""}function Kt(){!u||!Se||(ui(u,ne),V(null),X&&URL.revokeObjectURL(X),ce(null),ye(""),Ie(!1))}function qt(){V(null),X&&URL.revokeObjectURL(X),ce(null),ye(""),Ie(!1)}function Ht(){return Ft==="too_large"?R.tooLarge:Ft==="invalid_type"?R.invalidType:R.uploadError}const Xt=lt.length>0,si=u&&!dt;
12return te.jsxs("div",{className:"photo-upload",children:[(Xt||!Tt)&&te.jsx("div",{className:"photo-upload-title",children:R.communityPhotos}),!Xt&&!Tt&&!si&&te.jsx("div",{className:"photo-upload-first",children:R.firstPhoto}),Xt&&te.jsx("div",{className:"photo-upload-gallery",children:lt.map((ii,Vi)=>te.jsxs("div",{className:`photo-upload-thumb ${ii.pending?"photo-upload-thumb--pending":""}`,onClick:()=>!ii.pending&&T(Vi),children:[te.jsx("img",{src:jx(ii.url),alt:"",loading:"lazy"}),ii.pending&&te.jsx("span",{className:"photo-upload-pending-badge",title:R.pendingReview,children:"🕐"})]},ii.public_id||Vi))}),si&&te.jsxs("div",{className:"photo-upload-form",children:[te.jsx("div",{className:"photo-upload-preview",children:te.jsx("img",{src:X,alt:""})}),te.jsx("input",{type:"text",className:"photo-upload-credit",placeholder:R.creditPlaceholder,value:ne,onChange:ii=>ye(ii.target.value),maxLength:50}),te.jsxs("label",{className:"photo-upload-copyright",children:[te.jsx("input",{type:"checkbox",checked:Se,onChange:ii=>Ie(ii.target.checked)}),te.jsxs("span",{children:[R.copyright," ",te.jsx("button",{type:"button",className:"photo-upload-terms-link",onClick:ii=>{ii.preventDefault(),ve(!0)},children:R.termsLink})]})]}),te.jsxs("div",{className:"photo-upload-form-actions",children:[te.jsx("button",{className:"photo-upload-confirm",onClick:Kt,disabled:!Se,children:R.send}),te.jsx("button",{className:"photo-upload-cancel",onClick:qt,children:R.cancel})]})]}),!si&&te.jsx("button",{className:"photo-upload-btn",onClick:()=>N.current?.click(),disabled:dt,children:dt?te.jsx("span",{children:R.uploading}):te.jsxs(te.Fragment,{children:[te.jsx("span",{className:"photo-upload-btn-icon",children:"📷"}),te.jsx("span",{children:R.addPhoto})]})}),te.jsx("input",{ref:N,type:"file",accept:"image/*",capture:"environment",onChange:vi,hidden:!0}),dt&&te.jsx("div",{className:"photo-upload-progress",children:te.jsx("div",{className:"photo-upload-progress-bar",style:{width:`${Bt}%`}})}),Vt&&te.jsxs("div",{className:"photo-upload-msg photo-upload-msg--success",children:["✓ ",R.uploadSuccess]}),Ft&&te.jsx("div",{className:"photo-upload-msg photo-upload-msg--error",children:Ht()}),E!==null&&Sg.createPortal(te.jsx(Bx,{photos:lt.filter(ii=>!ii.pending),initialIndex:E,onClose:()=>T(null)}),document.body),Te&&Sg.createPortal(te.jsx(Vy,{open:Te,onClose:()=>ve(!1)}),document.body)]})}function Vx({feature:j,lang:P}){const D=j.properties,R=th[D.category],[N,E]=j.geometry.coordinates,T=P==="de"?Zx:Gx,V=(R?.[P]||R?.de)?.name||D.baumnamedeu,X=`${window.location.origin}${window.location.pathname}#tree=${D.id}`,ce=new Date,ne=dm(D.category,ce),ye=p_(D.category,ce),Se=Jf[D.category],Ie=P==="de"?["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"]:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Te(dt){return!dt||dt.length===0?null:dt.map(Bt=>`${Bt.start.day}. ${Ie[Bt.start.month]} – ${Bt.end.day}. ${Ie[Bt.end.month]}`).join(", ")}const ve=Te(Se),{heroPhoto:lt}=Uy(D.id),Tt=lt?{url:lt.url,attribution:lt.credit||"Community"}:R?.image?{url:R.image.url,attribution:R.image.attribution}:null;return te.jsxs("div",{className:"tree-popup",children:[Tt&&te.jsxs("div",{className:"tree-popup-image-wrapper",children:[te.jsx("img",{className:"tree-popup-image",src:Tt.url,alt:V,loading:"lazy"}),te.jsx("span",{className:"tree-popup-image-attr",children:Tt.attribution})]}),te.jsxs("div",{className:"tree-popup-header",children:[te.jsx("span",{className:"tree-popup-dot",style:{background:R?.color||"#FF69B4",borderColor:R?.color==="#FFFFFF"?"#ccc":R?.color}}),te.jsx("strong",{children:V})]}),te.jsx("div",{className:"tree-popup-latin",children:D.baumnamelat}),te.jsx("table",{className:"tree-popup-details",children:te.jsxs("tbody",{children:[te.jsxs("tr",{children:[te.jsx("td",{children:T.location}),te.jsx("td",{children:te.jsxs("a",{className:"tree-popup-address-link",href:`https://www.google.com/maps/search/?api=1&query=${E},${N}`,target:"_blank",rel:"noopener noreferrer",children:[D.strasse,", ",D.quartier]})})]}),te.jsxs("tr",{children:[te.jsx("td",{children:T.category}),te.jsx("td",{children:D.kategorie})]}),D.pflanzjahr>0&&te.jsxs("tr",{children:[te.jsx("td",{children:T.planted}),te.jsx("td",{children:D.pflanzjahr})]}),D.kronendurchmesser>0&&te.jsxs("tr",{children:[te.jsx("td",{children:T.crown}),te.jsxs("td",{children:[D.kronendurchmesser," m"]})]}),ve&&te.jsxs("tr",{children:[te.jsx("td",{children:T.bloom}),te.jsxs("td",{children:[ne?te.jsx("span",{className:"tree-popup-bloom tree-popup-bloom--active",children:T.bloomNow}):ye!=null&&ye>0?te.jsx("span",{className:"tree-popup-bloom",children:P==="de"?`In ${ye} Tagen`:`In ${ye} days`}):null,te.jsx("span",{className:"tree-popup-bloom-period",children:ve})]})]})]})}),te.jsx(Ux,{treeId:D.id,objectId:D.objectid,lang:P}),te.jsxs("div",{className:"tree-popup-actions",children:[te.jsx("a",{className:"tree-popup-navigate",href:`https://www.google.com/maps/dir/?api=1&destination=${E},${N}&travelmode=walking`,target:"_blank",rel:"noopener noreferrer",children:T.navigate}),te.jsx(jy,{url:X,title:V})]})]})}const Zx={location:"Standort",category:"Kategorie",planted:"Gepflanzt",crown:"Krone ⌀",bloom:"Blütezeit",bloomNow:"Blüht jetzt! 🌸",navigate:"Navigation →"},Gx={location:"Location",category:"Category",planted:"Planted",crown:"Crown ⌀",bloom:"Bloom",bloomNow:"Blooming now! 🌸",navigate:"Navigate here →"};function qx(j){const P=j.getChildCount();let D=36;return P>50?D=48:P>20&&(D=42),ih.divIcon({html:`<div>${P}</div>`,className:"cherry-cluster-icon",iconSize:[D,D]})}function Hx(j){const D=th[j]?.color||"#E91E8C";return ih.divIcon({html:`<div class="cherry-marker" style="background:${D};border-color:#fff"></div>`,className:"",iconSize:[16,16],iconAnchor:[8,8],popupAnchor:[0,-8]})}function $x({trees:j,lang:P,highlightedTreeId:D,showCherryPlums:R,cherryPlumTrees:N}){const E=Pg(),T=Qe.useRef(null),u=Qe.useRef(new Map),V=Qe.useMemo(()=>R&&N?.length?[...j,...N]:j,[j,R,N]);return Qe.useEffect(()=>{T.current||(T.current=ih.markerClusterGroup({maxClusterRadius:50,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,iconCreateFunction:qx}),E.addLayer(T.current));const X=T.current;X.clearLayers(),u.current.clear();const ce=V.map(ne=>{const[ye,Se]=ne.geometry.coordinates,Ie=ne.properties,Te=ih.marker([Se,ye],{icon:Hx(Ie.category)});return Te.bindPopup(()=>{const ve=document.createElement("div");return wy.createRoot(ve).render(te.jsx(Vx,{feature:ne,lang:P})),ve},{minWidth:200,maxWidth:280,autoPan:!1}),Te.on("popupopen",()=>{setTimeout(()=>{const ve=Te.getPopup();if(!ve?._container)return;const lt=ve._container.getBoundingClientRect(),Tt=Te._icon?.getBoundingClientRect(),dt=E.getContainer().getBoundingClientRect(),Bt=lt.top,Vt=Tt?Math.max(lt.bottom,Tt.bottom):lt.bottom,ui=Math.min(lt.left,Tt?Tt.left:lt.left),Ft=Math.max(lt.right,Tt?Tt.right:lt.right),vi=(ui+Ft)/2,Kt=(Bt+Vt)/2,qt=dt.top+96,Ht=dt.bottom,Xt=dt.left,si=dt.right,ii=(Xt+si)/2,Vi=(qt+Ht)/2,Ke=vi-ii,mt=Kt-Vi;(Math.abs(Ke)>10||Math.abs(mt)>10)&&E.panBy([Ke,mt],{animate:!0,duration:.3})},50)}),u.current.set(Ie.id,Te),Te});return X.addLayers(ce),()=>{X.clearLayers()}},[V,E,P]),Qe.useEffect(()=>{if(!D||!T.current)return;const X=u.current.get(D);X&&T.current.zoomToShowLayer(X,()=>{if(X.openPopup(),X._icon){const ce=X._icon.querySelector(".marker-pulse");ce&&ce.remove();const ne=document.createElement("div");ne.className="marker-pulse",X._icon.appendChild(ne),setTimeout(()=>{ne.remove()},3e3)}})},[D,V]),Qe.useEffect(()=>()=>{T.current&&(E.removeLayer(T.current),T.current=null)},[E]),null}function Xx({position:j}
12){return te.jsxs(te.Fragment,{children:[te.jsx(ly,{center:[j.lat,j.lng],radius:20,pathOptions:{color:"rgba(66, 133, 244, 0.2)",fillColor:"rgba(66, 133, 244, 0.1)",fillOpacity:1,weight:0}}),te.jsx(ly,{center:[j.lat,j.lng],radius:7,pathOptions:{color:"#fff",fillColor:"#4285F4",fillOpacity:1,weight:2}})]})}function Yx(){return ih.divIcon({className:"route-endpoint-icon",html:`<div class="route-endpoint route-endpoint--start">
13      <svg width="16" height="16" viewBox="0 0 24 24" fill="#fff" xmlns="http://www.w3.org/2000/svg">
14        <path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"/>
15        <line x1="2" y1="20" x2="2" y2="20"/>
16      </svg>
17    </div>`,iconSize:[32,32],iconAnchor:[16,16],popupAnchor:[0,-16]})}function Wx(){return ih.divIcon({className:"route-endpoint-icon",html:`<div class="route-endpoint route-endpoint--end">
18      <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" xmlns="http://www.w3.org/2000/svg">
19        <path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/>
20        <line x1="4" y1="22" x2="4" y2="15"/>
21      </svg>
22    </div>`,iconSize:[32,32],iconAnchor:[16,16],popupAnchor:[0,-16]})}function Kx({route:j,lang:P}){const D=Pg(),{t:R}=qa(),N=Qe.useMemo(()=>Yx(),[]),E=Qe.useMemo(()=>Wx(),[]);if(Qe.useEffect(()=>{if(j?.geometry){const Te=j.geometry.coordinates.map(([ve,lt])=>[lt,ve]);if(Te.length>1){const ve=ih.latLngBounds(Te);D.fitBounds(ve,{padding:[50,50]})}}},[j,D]),!j?.geometry)return null;const T=j.waypoints||[],u=j.transitStops||[],V=j.routeName,X=V?V[P]||V.de:null,ce=T[0],ne=T[T.length-1],ye=u[0],Se=u.length>1?u[u.length-1]:u[0],Ie=(Te,ve,lt)=>te.jsx(Mx,{className:"route-endpoint-popup",minWidth:200,maxWidth:280,autoPanPadding:[5,100],children:te.jsxs("div",{className:"route-endpoint-popup-content",children:[te.jsx("div",{className:"route-endpoint-popup-badge",style:{background:lt?"#43A047":"#2E7D32"},children:R(lt?"routes.start":"routes.end")}),X&&te.jsxs(te.Fragment,{children:[te.jsx("div",{className:"route-endpoint-popup-name",children:X.name}),te.jsx("div",{className:"route-endpoint-popup-desc",children:X.description}),te.jsxs("div",{className:"route-endpoint-popup-meta",children:[te.jsx("span",{children:R("routes.trees",{count:V?.treeCount||0})}),te.jsx("span",{children:R("routes.length",{length:V?.estimatedMinutes||0})})]})]}),ve&&te.jsxs("div",{className:"route-endpoint-popup-transit",children:[te.jsx("span",{className:"route-endpoint-popup-transit-icon",children:te.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#1565C0",xmlns:"http://www.w3.org/2000/svg",children:[te.jsx("rect",{x:"4",y:"3",width:"16",height:"14",rx:"3",fill:"#1565C0"}),te.jsx("rect",{x:"6",y:"5",width:"12",height:"5",rx:"1",fill:"#fff"}),te.jsx("circle",{cx:"8.5",cy:"13",r:"1.5",fill:"#fff"}),te.jsx("circle",{cx:"15.5",cy:"13",r:"1.5",fill:"#fff"}),te.jsx("rect",{x:"8",y:"19",width:"2",height:"2",rx:"0.5",fill:"#1565C0"}),te.jsx("rect",{x:"14",y:"19",width:"2",height:"2",rx:"0.5",fill:"#1565C0"})]})}),te.jsx("span",{className:"route-endpoint-popup-transit-name",children:ve.name}),te.jsx("span",{className:"route-endpoint-popup-transit-lines",children:ve.lines})]}),te.jsx("a",{className:"route-endpoint-popup-nav",href:`https://www.google.com/maps/dir/?api=1&destination=${Te.lat},${Te.lng}&travelmode=transit`,target:"_blank",rel:"noopener noreferrer",children:R("routes.navigateTransit")})]})});return te.jsxs(te.Fragment,{children:[te.jsx(wx,{data:j.geometry,style:{color:"#E91E8C",weight:4,opacity:.8,dashArray:"10, 6"}},JSON.stringify(j.geometry)),ce&&te.jsx(uy,{position:[ce.lat,ce.lng],icon:N,zIndexOffset:1e4,children:Ie(ce,ye,!0)}),ne&&ne!==ce&&te.jsx(uy,{position:[ne.lat,ne.lng],icon:E,zIndexOffset:1e4,children:Ie(ne,Se,!1)})]})}const Qx={stroller:{emoji:"♿",de:"Barrierefrei",en:"Accessible"},cafe:{emoji:"☕",de:"Cafés am Weg",en:"Cafés nearby"},photo:{emoji:"📸",de:"Fotospots",en:"Photo spots"},family:{emoji:"👨‍👩‍👧",de:"Familienfreundlich",en:"Family-friendly"}
22,shady:{emoji:"🌳",de:"Schattig",en:"Shady"},transit:{emoji:"🚋",de:"ÖV-Anbindung",en:"Transit access"},short:{emoji:"⚡",de:"Kurzer Weg",en:"Short walk"}},hm=[{id:"bertastrasse-lochergut",waypoints:[{lat:47.3754,lng:8.5165},{lat:47.3736,lng:8.5126},{lat:47.372,lng:8.5107}],transitStops:[{lat:47.3755,lng:8.5178,name:"Lochergut",lines:"Tram 2, 3"},{lat:47.372,lng:8.508,name:"Idaplatz",lines:"Bus 32"}],treeCount:90,estimatedMinutes:10,popular:1,cherryPlums:!0,tags:["stroller","photo","transit","short","cafe"],de:{name:"Bertastrasse Kirschblüten-Allee",description:"Die berühmteste Kirschblütenstrasse Zürichs! Rund 90 Kirschpflaumenbäume säumen die Bertastrasse vom Lochergut zum Idaplatz. Ein absolutes Highlight im Frühling."},en:{name:"Bertastrasse Cherry Blossom Avenue",description:"Zurich's most famous cherry blossom street! Around 90 cherry plum trees line Bertastrasse from Lochergut to Idaplatz. An absolute spring highlight."}},{id:"werd-cherry-mile",waypoints:[{lat:47.37207,lng:8.52705},{lat:47.37315,lng:8.52416},{lat:47.37439,lng:8.52176},{lat:47.37263,lng:8.52071},{lat:47.37244,lng:8.51316}],transitStops:[{lat:47.37232,lng:8.52684,name:"Werd",lines:"Tram 13"},{lat:47.37015,lng:8.51926,name:"Schmiede Wiedikon",lines:"Tram 9, 14"}],treeCount:163,estimatedMinutes:20,popular:2,tags:["stroller","photo","transit","family"],de:{name:"Werd Kirschblüten-Meile",description:"Die dichteste Kirschblüten-Konzentration der Stadt! 119 Gefülltblühende Vogelkirschen an der Werdstrasse, weiter über Gartenhof- und Köchlistrasse zum Schulhaus Wengi. Absoluter Hotspot."},en:{name:"Werd Cherry Blossom Mile",description:"The densest cherry blossom concentration in the city! 119 Double Wild Cherries at Werdstrasse, continuing through Gartenhof- and Köchlistrasse to Schulhaus Wengi. Absolute hotspot."}},{id:"rotbuchstrasse",waypoints:[{lat:47.39135,lng:8.53718},{lat:47.39171,lng:8.53444},{lat:47.3929,lng:8.5318}],transitStops:[{lat:47.38796,lng:8.53912,name:"Kronenstrasse",lines:"Tram 7, 15"},{lat:47.39163,lng:8.53871,name:"Schaffhauserplatz",lines:"Tram 11, 14"}],treeCount:89,estimatedMinutes:10,popular:3,tags:["stroller","photo","transit","short"],de:{name:"Rotbuchstrasse Kanzan-Allee",description:"89 Japanische Nelkenkirschen in einer einzigen Strasse! Die Rotbuchstrasse in Wipkingen/Unterstrass ist eine ununterbrochene Kanzan-Allee mit tiefrosa Blütenpracht."},en:{name:"Rotbuchstrasse Kanzan Avenue",description:"89 Kanzan Cherries in a single street! Rotbuchstrasse in Wipkingen/Unterstrass is an unbroken avenue of deep pink double blossoms."}},{id:"erlachstrasse-alt-wiedikon",waypoints:[{lat:47.36845,lng:8.51842},{lat:47.36763,lng:8.52108}],transitStops:[{lat:47.37015,lng:8.51926,name:"Schmiede Wiedikon",lines:"Tram 9, 14"},{lat:47.3668,lng:8.5241,name:"Schaufelbergerstrasse",lines:"Bus 72"}],treeCount:63,estimatedMinutes:10,popular:5,tags:["stroller","family","short","shady"],de:{name:"Alt-Wiedikon Kirschgarten",description:"51 Bäume an der Erlachstrasse und Wuhrstrasse, mit Royal Burgundy und Kanzan-Sorten. Weiter zur Schlossgasse bei der Kollerwiese. Kompakte Runde."},en:{name:"Alt-Wiedikon Cherry Garden",description:"51 trees along Erlachstrasse and Wuhrstrasse, with Royal Burgundy and Kanzan varieties. Continue to Schlossgasse at Kollerwiese. Compact loop."}},{id:"hard-erismannhof",waypoints:[{lat:47.3795,lng:8.51963},{lat:47.37739,lng:8.51673},{lat:47.38214,lng:8.5123},{lat:47.38283,lng:8.51069},{lat:47.38369,lng:8.50868}],transitStops:[{lat:47.37442,lng:8.52134,name:"Kalkbreite",lines:"Tram 2, 3"},{lat:47.37821,lng:8.5104,name:"Albisriederplatz",lines:"Tram 2, 3"}],treeCount:103,estimatedMinutes:20,popular:4,tags:["stroller","transit","cafe","family"],de:{name:"Hard & Eichbühlstrasse",description:"Vom Erismannhof (39 Kanzan) über den Anny-Klava-Platz die gesamte Eichbühlstrasse entlang. Kombination aus Kanzan und Vogelkirschen."},en:{name:"Hard & Eichbühlstrasse",description:"From Erismannhof (39 Kanzan) via Anny-Klava-Platz along the full Eichbühlstrasse. Mix of Kanzan and Wild Cherry trees."}},{id:"fluntern-kraehbuehl",waypoints:[{lat:47.37439,lng:8.55614},{lat:47.37263,lng:8.55934},{lat:47.37358,lng:8.55975},{lat:47.37691,lng:8.56392},{lat:47.37843,lng:8.56645},{lat:47.38009,lng:8.56796}],transitStops:[{lat:47.37501,lng:8.55264,name:"Platte",lines:"Tram 5, 6"},{lat:47.38009,lng:8.56801,name:"Susenbergstrasse",lines:"Tram 6"}
22],treeCount:73,estimatedMinutes:25,popular:6,tags:["photo","shady"],de:{name:"Fluntern Hügelrunde",description:"Wunderschöner Spaziergang am Zürichberg: Von der Attenhoferstrasse über die Spiegelhofstrasse die Krähbühlstrasse hinauf. 73 Bäume mit Vogelkirschen und Kanzan."},en:{name:"Fluntern Hillside Walk",description:"Lovely walk on the Zürichberg: From Attenhoferstrasse via Spiegelhofstrasse up Krähbühlstrasse. 73 trees with Wild Cherry and Kanzan varieties."}},{id:"hoengg",waypoints:[{lat:47.40751,lng:8.49495},{lat:47.40893,lng:8.49321},{lat:47.40977,lng:8.49189},{lat:47.41276,lng:8.48141}],transitStops:[{lat:47.40752,lng:8.4954,name:"Friedhof Hönggerberg",lines:"Bus 38"},{lat:47.41231,lng:8.48386,name:"Heizenholz",lines:"Bus 46, 78"}],treeCount:53,estimatedMinutes:20,popular:7,tags:["shady","family"],de:{name:"Hönggerberg Runde",description:"Vom Quartier Höngg über den Friedhof Hönggerberg zur Naglerwiesenstr. 53 Bäume mit Kanzan, Vogelkirschen und Herbstkirschen."},en:{name:"Hönggerberg Loop",description:"Through Höngg quarter via Hönggerberg Cemetery to Naglerwiesenstrasse. 53 trees with Kanzan, Wild Cherry and Autumn Cherry varieties."}},{id:"witikon-buchholz",waypoints:[{lat:47.36069,lng:8.58637},{lat:47.36042,lng:8.58865}],transitStops:[{lat:47.35873,lng:8.5856,name:"Zentrum Witikon",lines:"Bus 31, 91"},{lat:47.3612,lng:8.5904,name:"Buchholzstrasse",lines:"Bus 31"}],treeCount:43,estimatedMinutes:5,popular:8,tags:["stroller","short","family"],de:{name:"Witikon Buchholzstrasse",description:"43 Kanzan-Kirschbäume auf engstem Raum! Die Buchholzstrasse in Witikon ist eine kompakte Kanzan-Allee. Perfekt für einen kurzen Abstecher."},en:{name:"Witikon Buchholzstrasse",description:"43 Kanzan cherry trees in a tiny area! Buchholzstrasse in Witikon is a compact Kanzan avenue. Perfect for a quick detour."}},{id:"neumunster-seefeld",waypoints:[{lat:47.35737,lng:8.55628},{lat:47.36183,lng:8.55899},{lat:47.35625,lng:8.53319}],transitStops:[{lat:47.35517,lng:8.55689,name:"Fröhlichstrasse",lines:"Tram 2, 4"},{lat:47.35613,lng:8.53222,name:"Brunaustrasse",lines:"Tram 7"}],treeCount:36,estimatedMinutes:30,popular:9,tags:["stroller","photo","transit","cafe","family"],de:{name:"Seeufer: Seefeld bis Belvoirpark",description:"Vom Schulhaus Seefeld zum Neumünsterpark (Japanische Blütenkirschen), dann am See entlang zum Belvoirpark (Säulen-Zierkirschen). Schöne Uferperspektive."},en:{name:"Lakeside: Seefeld to Belvoirpark",description:"From Schulhaus Seefeld to Neumünsterpark (Japanese Cherries), then along the lake to Belvoirpark (Columnar Cherries). Beautiful lakeside views."}}];function Jx({onSelectRoute:j,activeRouteId:P,lang:D}){const R=Qe.useMemo(()=>hm.map(N=>({id:N.id,positions:N.waypoints.map(E=>[E.lat,E.lng]),name:(N[D]||N.de).name,route:N})),[D]);return te.jsx(te.Fragment,{children:R.filter(N=>N.id!==P).map(N=>te.jsx(Cx,{positions:N.positions,pathOptions:{color:"#E91E8C",weight:2,opacity:.25,dashArray:"4, 8"},eventHandlers:{click:()=>j(N.route),mouseover:E=>{E.target.setStyle({opacity:.6,weight:3})},mouseout:E=>{E.target.setStyle({opacity:.25,weight:2})}},children:te.jsx(Ax,{sticky:!0,children:N.name})},N.id))})}(function(){function j(P){return this instanceof j?(this._canvas=P=typeof P=="string"?document.getElementById(P):P,this._ctx=P.getContext("2d"),this._width=P.width,this._height=P.height,this._max=1,void this.clear()):new j(P)}j.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(P,D){return this._data=P,this},max:function(P){return this._max=P,this},add:function(P){return this._data.push(P),this},clear:function(){return this._data=[],this},radius:function(P,D){D=D||15;var R=this._circle=document.createElement("canvas"),N=R.getContext("2d"),E=this._r=P+D;return R.width=R.height=2*E,N.shadowOffsetX=N.shadowOffsetY=200,N.shadowBlur=D,N.shadowColor="black",N.beginPath(),N.arc(E-200,E-200,P,0,2*Math.PI,!0),N.closePath(),N.fill(),this},gradient:function(P){var D=document.createElement("canvas"),R=D.getContext("2d"),N=R.createLinearGradient(0,0,0,256);D.width=1,D.height=256;for(var E in P)N.addColorStop(E,P[E]);return R.fillStyle=N,R.fillRect(0,0,1,256),this._grad=R.getImageData(0,0,1,256).data,this},draw:function(P){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var D=this._ctx;D.clearRect(0,0,this._width,this._height);for(var R,N=0,E=this._data.length;E>N;N++)R=this._data[N],D.globalAlpha=Math.max(R[2]/this._max,P||.05),D.drawImage(this._circle,R[0]-this._r,R[1]-this._r);var T=D.getImageData(0,0,this._width,this._height);return this._colorize(T.data,this._grad),D.putImageData(T,0,0),this},_colorize:function(P,D){for(var R,N=3,E=P.length;E>N;N+=4)R=4*P[N],R&&(P[N-3]=D[R],P[N-2]=D[R+1],P[N-1]=D[R+2])}},window.simpleheat=j})(),L.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(j,P){this._latlngs=j,L.setOptions(this,P)},setLatLngs:function(j){return this._latlngs=j,this.redraw()},addLatLng:function(j){return this._latlngs.push(j),this.redraw()},setOptions:function(j){return L.setOptions(this,j),this._heat&&this._updateOptions(),this.redraw()},redraw:function(){return!this._heat||this._frame||this._map._animating||(this._frame=L.Util.requestAnimFrame
22(this._redraw,this)),this},onAdd:function(j){this._map=j,this._canvas||this._initCanvas(),j._panes.overlayPane.appendChild(this._canvas),j.on("moveend",this._reset,this),j.options.zoomAnimation&&L.Browser.any3d&&j.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(j){j.getPanes().overlayPane.removeChild(this._canvas),j.off("moveend",this._reset,this),j.options.zoomAnimation&&j.off("zoomanim",this._animateZoom,this)},addTo:function(j){return j.addLayer(this),this},_initCanvas:function(){var j=this._canvas=L.DomUtil.create("canvas","leaflet-heatmap-layer leaflet-layer"),P=L.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);j.style[P]="50% 50%";var D=this._map.getSize();j.width=D.x,j.height=D.y;var R=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(j,"leaflet-zoom-"+(R?"animated":"hide")),this._heat=simpleheat(j),this._updateOptions()},_updateOptions:function(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)},_reset:function(){var j=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,j);var P=this._map.getSize();this._heat._width!==P.x&&(this._canvas.width=this._heat._width=P.x),this._heat._height!==P.y&&(this._canvas.height=this._heat._height=P.y),this._redraw()},_redraw:function(){var j,P,D,R,N,E,T,u,V,X=[],ce=this._heat._r,ne=this._map.getSize(),ye=new L.Bounds(L.point([-ce,-ce]),ne.add([ce,ce])),Se=this.options.max===void 0?1:this.options.max,Ie=this.options.maxZoom===void 0?this._map.getMaxZoom():this.options.maxZoom,Te=1/Math.pow(2,Math.max(0,Math.min(Ie-this._map.getZoom(),12))),ve=ce/2,lt=[],Tt=this._map._getMapPanePos(),dt=Tt.x%ve,Bt=Tt.y%ve;for(j=0,P=this._latlngs.length;P>j;j++)if(D=this._map.latLngToContainerPoint(this._latlngs[j]),ye.contains(D)){N=Math.floor((D.x-dt)/ve)+2,E=Math.floor((D.y-Bt)/ve)+2;var Vt=this._latlngs[j].alt!==void 0?this._latlngs[j].alt:this._latlngs[j][2]!==void 0?+this._latlngs[j][2]:1;V=Vt*Te,lt[E]=lt[E]||[],R=lt[E][N],R?(R[0]=(R[0]*R[2]+D.x*V)/(R[2]+V),R[1]=(R[1]*R[2]+D.y*V)/(R[2]+V),R[2]+=V):lt[E][N]=[D.x,D.y,V]}for(j=0,P=lt.length;P>j;j++)if(lt[j])for(T=0,u=lt[j].length;u>T;T++)R=lt[j][T],R&&X.push([Math.round(R[0]),Math.round(R[1]),Math.min(R[2],Se)]);this._heat.data(X).draw(this.options.minOpacity),this._frame=null},_animateZoom:function(j){var P=this._map.getZoomScale(j.zoom),D=this._map._getCenterOffset(j.center)._multiplyBy(-P).subtract(this._map._getMapPanePos());L.DomUtil.setTransform?L.DomUtil.setTransform(this._canvas,D,P):this._canvas.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(D)+" scale("+P+")"}}),L.heatLayer=function(j,P){return new L.HeatLayer(j,P)};function eb({trees:j}){const P=Pg(),D=Qe.useRef(null);return Qe.useEffect(()=>{const R=j.map(N=>{const[E,T]=N.geometry.coordinates;return[T,E,1]});return D.current&&P.removeLayer(D.current),D.current=ih.heatLayer(R,{radius:25,blur:15,maxZoom:17,max:1,gradient:{.2:"#ffe0ec",.4:"#ffb6c1",.6:"#ff69b4",.8:"#ff1493",1:"#c71585"}}),D.current.addTo(P),()=>{D.current&&(P.removeLayer(D.current),D.current=null)}},[j,P]),null}var yg={exports:{}},vg={exports:{}};var tb=vg.exports,dy;function ib(){return dy||(dy=1,(function(j,P){(function(D,R){j.exports=R()})(tb,(function(){var D={},R={};function N(T,u,V){if(R[T]=V,T==="index"){var X="var sharedModule = {}; ("+R.shared+")(sharedModule); ("+R.worker+")(sharedModule);",ce={};return R.shared(ce),R.index(D,ce),typeof window<"u"&&D.setWorkerUrl(window.URL.createObjectURL(new Blob([X],{type:"text/javascript"}))),D}}N("shared",["exports"],(function(T){function u(n,e,i,o){return new(i||(i=Promise))((function(h,p){function m(A){try{w(o.next(A))}catch(k){p(k)}}function x(A){try{w(o.throw(A))}catch(k){p(k)}}function w(A){var k;A.done?h(A.value):(k=A.value,k instanceof i?k:new i((function(F){F(k)}))).then(m,x)}w((o=o.apply(n,e||[])).next())}))}function V(n,e){this.x=n,this.y=e}function X(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ce,ne;typeof SuppressedError=="function"&&SuppressedError,V.prototype={clone(){return new V(this.x,this.y)},add(n){return this.clone()._add(n)},sub(n){return this.clone()._sub(n)},multByPoint(n){return this.clone()._multByPoint(n)},divByPoint(n){return this.clone()._divByPoint(n)},mult(n){return this.clone()._mult(n)},div(n){return this.clone()._div(n)},rotate(n){return this.clone()._rotate(n)}
vendor: 1,309 bytes, line 22
22,rotateAround(n,e){return this.clone()._rotateAround(n,e)},matMult(n){return this.clone()._matMult(n)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(n){return this.x===n.x&&this.y===n.y},dist(n){return Math.sqrt(this.distSqr(n))},distSqr(n){const e=n.x-this.x,i=n.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(n){return Math.atan2(this.y-n.y,this.x-n.x)},angleWith(n){return this.angleWithSep(n.x,n.y)},angleWithSep(n,e){return Math.atan2(this.x*e-this.y*n,this.x*n+this.y*e)},_matMult(n){const e=n[2]*this.x+n[3]*this.y;return this.x=n[0]*this.x+n[1]*this.y,this.y=e,this},_add(n){return this.x+=n.x,this.y+=n.y,this},_sub(n){return this.x-=n.x,this.y-=n.y,this},_mult(n){return this.x*=n,this.y*=n,this},_div(n){return this.x/=n,this.y/=n,this},_multByPoint(n){return this.x*=n.x,this.y*=n.y,this},_divByPoint(n){return this.x/=n.x,this.y/=n.y,this},_unit(){return this._div(this.mag()),this},_perp(){const n=this.y;return this.y=this.x,this.x=-n,this},_rotate(n){const e=Math.cos(n),i=Math.sin(n),o=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=o,this},_rotateAround(n,e){const i=Math.cos(n),o=Math.sin(n),h=e.y+o*(this.x-e.x)+i*(this.y-e.y);
vendor: 11,062 bytes, line 22
22return this.x=e.x+i*(this.x-e.x)-o*(this.y-e.y),this.y=h,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:V},V.convert=function(n){if(n instanceof V)return n;if(Array.isArray(n))return new V(+n[0],+n[1]);if(n.x!==void 0&&n.y!==void 0)return new V(+n.x,+n.y);throw new Error("Expected [x, y] or {x, y} point format")};var ye=(function(){if(ne)return ce;function n(e,i,o,h){this.cx=3*e,this.bx=3*(o-e)-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=e,this.p1y=i,this.p2x=o,this.p2y=h}return ne=1,ce=n,n.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var o=e,h=0;h<8;h++){var p=this.sampleCurveX(o)-e;if(Math.abs(p)<i)return o;var m=this.sampleCurveDerivativeX(o);if(Math.abs(m)<1e-6)break;o-=p/m}var x=0,w=1;for(o=e,h=0;h<20&&(p=this.sampleCurveX(o),!(Math.abs(p-e)<i));h++)e>p?x=o:w=o,o=.5*(w-x)+x;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},ce})(),Se=X(ye);let Ie,Te;function ve(){return Ie==null&&(Ie=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Ie}function lt(){if(Te==null&&(Te=!1,ve())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let o=0;o<25;o++){const h=4*o;e.fillStyle=`rgb(${h},${h+1},${h+2})`,e.fillRect(o%5,Math.floor(o/5),1,1)}const i=e.getImageData(0,0,5,5).data;for(let o=0;o<100;o++)if(o%4!=3&&i[o]!==o){Te=!0;break}}}return Te||!1}var Tt=1e-6,dt=typeof Float32Array<"u"?Float32Array:Array;function Bt(){var n=new dt(9);return dt!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function Vt(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function ui(){var n=new dt(3);return dt!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function Ft(n){var e=n[0],i=n[1],o=n[2];return Math.sqrt(e*e+i*i+o*o)}function vi(n,e,i){var o=new dt(3);return o[0]=n,o[1]=e,o[2]=i,o}function Kt(n,e,i){return n[0]=e[0]+i[0],n[1]=e[1]+i[1],n[2]=e[2]+i[2],n}function qt(n,e,i){return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n}function Ht(n,e,i){var o=e[0],h=e[1],p=e[2],m=i[0],x=i[1],w=i[2];return n[0]=h*w-p*x,n[1]=p*m-o*w,n[2]=o*x-h*m,n}var Xt,si=Ft;function ii(n,e,i){var o=e[0],h=e[1],p=e[2],m=e[3];return n[0]=i[0]*o+i[4]*h+i[8]*p+i[12]*m,n[1]=i[1]*o+i[5]*h+i[9]*p+i[13]*m,n[2]=i[2]*o+i[6]*h+i[10]*p+i[14]*m,n[3]=i[3]*o+i[7]*h+i[11]*p+i[15]*m,n}function Vi(){var n=new dt(4);return dt!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function Ke(n,e,i,o){var h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",p=Math.PI/360;e*=p,o*=p,i*=p;var m=Math.sin(e),x=Math.cos(e),w=Math.sin(i),A=Math.cos(i),k=Math.sin(o),F=Math.cos(o);switch(h){case"xyz":n[0]=m*A*F+x*w*k,n[1]=x*w*F-m*A*k,n[2]=x*A*k+m*w*F,n[3]=x*A*F-m*w*k;break;case"xzy":n[0]=m*A*F-x*w*k,n[1]=x*w*F-m*A*k,n[2]=x*A*k+m*w*F,n[3]=x*A*F+m*w*k;break;case"yxz":n[0]=m*A*F+x*w*k,n[1]=x*w*F-m*A*k,n[2]=x*A*k-m*w*F,n[3]=x*A*F+m*w*k;break;case"yzx":n[0]=m*A*F+x*w*k,n[1]=x*w*F+m*A*k,n[2]=x*A*k-m*w*F,n[3]=x*A*F-m*w*k;break;case"zxy":n[0]=m*A*F-x*w*k,n[1]=x*w*F+m*A*k,n[2]=x*A*k+m*w*F,n[3]=x*A*F-m*w*k;break;case"zyx":n[0]=m*A*F-x*w*k,n[1]=x*w*F+m*A*k,n[2]=x*A*k-m*w*F,n[3]=x*A*F+m*w*k;break;default:throw new Error("Unknown angle order "+h)}return n}function mt(){var n=new dt(2);return dt!=Float32Array&&(n[0]=0,n[1]=0),n}function gt(n,e){var i=new dt(2);return i[0]=n,i[1]=e,i}ui(),Xt=new dt(4),dt!=Float32Array&&(Xt[0]=0,Xt[1]=0,Xt[2]=0,Xt[3]=0),ui(),vi(1,0,0),vi(0,1,0),Vi(),Vi(),Bt(),mt();const Yt=8192;function It(n,e,i){return e*(Yt/(n.tileSize*Math.pow(2,i-n.tileID.overscaledZ)))}function ze(n,e){return(n%e+e)%e}function rt(n,e,i){return n*(1-i)+e*i}function Et(n){if(n<=0)return 0;if(n>=1)return 1;const e=n*n,i=e*n;return 4*(n<.5?i:3*(n-e)+i-.75)}function Pt(n,e,i,o){const h=new Se(n,e,i,o);return p=>h.solve(p)}const St=Pt(.25,.1,.25,1);function Ct(n,e,i){return Math.min(i,Math.max(e,n))}function ri(n,e,i){const o=i-e,h=((n-e)%o+o)%o+e;return h===e?i:h}function wi(n,...e){for(const i of e)for(const o in i)n[o]=i[o];return n}let Wi=1;function vr(n,e,i){const o={};for(const h in n)o[h]=e.call(this,n[h],h,n);return o}function Ur(n,e,i){const o={};for(const h in n)e.call(this,n[h],h,n)&&(o[h]=n[h]);return o}function xr(n){return Array.isArray(n)?n.map(xr):typeof n=="object"&&n?vr(n,xr):n}const Ho={};function En(n){Ho[n]||(typeof console<"u"&&console.warn(n),Ho[n]=!0)}function Vr(n,e,i){return(i.y-n.y)*(e.x-n.x)>(e.y-n.y)*(i.x-n.x)}function ta(n){return typeof WorkerGlobalScope<"u"&&n!==void 0&&n instanceof WorkerGlobalScope}let yn=null;function Ta(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap}const mo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function js(n,e,i,o,h){return u(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const p=new VideoFrame(n,{timestamp:0});try{const m=p?.format;if(!m||!m.startsWith("BGR")&&!m.startsWith("RGB"))throw new Error(`Unrecognized format ${m}`);const x=m.startsWith("BGR"),w=new Uint8ClampedArray(o*h*4);if(yield p.copyTo(w,(function(A,k,F,Z,G){const W=4*Math.max(-k,0),K=(Math.max(0,F)-F)*Z*4+W,J=4*Z,se=Math.max(0,k),ge=Math.max(0,F);return{rect:{x:se,y:ge,width:Math.min(A.width,k+Z)-se,height:Math.min(A.height,F+G)-ge},layout:[{offset:K,stride:J}]}})(n,e,i,o,h)),x)for(let A=0;A<w.length;A+=4){const k=w[A];w[A]=w[A+2],w[A+2]=k}return w}finally{p.close()}}))}let ia,ps;function go(n,e,i,o){return n.addEventListener(e,i,o),{unsubscribe:()=>{n.removeEventListener(e,i,o)}}}function pr(n){return n*Math.PI/180}function Sa(n){return n/Math.PI*180}const Ha={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},$o={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},ms="AbortError";class Al extends Error{constructor(e=ms){super(e instanceof Error?e.message:e),this.name=ms,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function Be(n){return n.name===ms}const ee={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ie(n){return ee.REGISTERED_PROTOCOLS[n.substring(0,n.indexOf("://"))]}const ae="global-dispatcher";class be extends Error{constructor(e,i,o,h){super(`AJAXError: ${i} (${e}): ${o}`),this.status=e,this.statusText=i,this.url=o,this.body=h}}const Pe=()=>ta(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Fe=function(n,e){if(/:\/\//.test(n.url)&&!/^https?:|^file:/.test(n.url)){const o=ie(n.url);if(o)return o(n,e);if(ta(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:n,targetMapId:ae},e)}if(!(/^file:/.test(i=n.url)||/^file:/.test(Pe())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(o,h){return u(this,void 0,void 0,(function*(){const p=new Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,cache:o.cache,referrer:Pe(),signal:h.signal});let m,x;o.type!=="json"||p.headers.has("Accept")||p.headers.set("Accept","application/json");try{m=yield fetch(p)}catch(A){throw Be(A)?A:new be(0,A.message,o.url,new Blob)}if(!m.ok){const A=yield m.blob();throw new be(m.status,m.statusText,o.url,A)}x=o.type==="arrayBuffer"||o.type==="image"?m.arrayBuffer():o.type==="json"?m.json():m.text();const w=yield x;return h.signal.throwIfAborted(),{data:w,cacheControl:m.headers.get("Cache-Control"),expires:m.headers.get("Expires")}}))})(n,e);if(ta(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:n,mustQueue:!0,targetMapId:ae},e)}var i;return(function(o,h){return new Promise(((p,m)=>{var x;const w=new XMLHttpRequest;w.open(o.method||"GET",o.url,!0),o.type!=="arrayBuffer"&&o.type!=="image"||(w.responseType="arraybuffer");for(const A in o.headers)w.setRequestHeader(A,o.headers[A]);o.type==="json"&&(w.responseType="text",!((x=o.headers)===null||x===void 0)&&x.Accept||w.setRequestHeader("Accept","application/json")),w.withCredentials=o.credentials==="include",w.onerror=()=>{m(new Error(w.statusText))},w.onload=()=>{if(!h.signal.aborted)if((w.status>=200&&w.status<300||w.status===0)&&w.response!==null){let A=w.response;if(o.type==="json")try{A=JSON.parse(w.response)}catch(k){return void m(k)}p({data:A,cacheControl:w.getResponseHeader("Cache-Control"),expires:w.getResponseHeader("Expires")})}else{const A=new Blob([w.response],{type:w.getResponseHeader("Content-Type")});m(new be(w.status,w.statusText,o.url,A))}},h.signal.addEventListener("abort",(()=>{w.abort(),m(new Al(h.signal.reason))})),w.send(o.body)}))})(n,e)};function Ue(n){if(!n||n.indexOf("://")<=0||n.indexOf("data:image/")===0||n.indexOf("blob:")===0)return!0;const e=new URL(n),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function Ne(n,e,i){i[n]&&i[n].indexOf(e)!==-1||(i[n]=i[n]||[],i[n].push(e))}function Ze(n,e,i){if(i&&i[n]){const o=i[n].indexOf(e);o!==-1&&i[n].splice(o,1)}}class ct{constructor(e,i={}){wi(this,i),this.type=e}}class it extends ct{constructor(e,i={}){super("error",wi({error:e},i))}}class yt{on(e,i){return this._listeners=this._listeners||{},Ne(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return Ze(e,i,this._listeners),Ze(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},Ne(e,i,this._oneTimeListeners),this):new Promise((o=>this.once(e,o)))}fire(e,i){typeof e=="string"&&(e=new ct(e,i||{}));const o=e.type;if(this.listens(o)){e.target=this;const h=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const x of h)x.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const x of p)Ze(o,x,this._oneTimeListeners),x.call(this,e);const m=this._eventedParent;m&&(wi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),m.fire(e))}else e instanceof it&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var ke={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"}
vendor: 20,999 bytes, line 22
22,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven
vendor: 8,689 bytes, line 22
22"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},
vendor: 5,130 bytes, line 22
22"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const oi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Hi(n,e){const i={};for(const o in n)o!=="ref"&&(i[o]=n[o]);return oi.forEach((o=>{o in e&&(i[o]=e[o])})),i}function Gt(n,e){if(Array.isArray(n)){if(!Array.isArray(e)||n.length!==e.length)return!1;for(let i=0;i<n.length;i++)if(!Gt(n[i],e[i]))return!1;return!0}if(typeof n=="object"&&n!==null&&e!==null){if(typeof e!="object"||Object.keys(n).length!==Object.keys(e).length)return!1;for(const i in n)if(!Gt(n[i],e[i]))return!1;return!0}return n===e}function Wt(n,e){n.push(e)}function yi(n,e,i){Wt(i,{command:"addSource",args:[n,e[n]]})}function rn(n,e,i){Wt(e,{command:"removeSource",args:[n]}),i[n]=!0}function dn(n,e,i,o){rn(n,i,o),yi(n,e,i)}function tr(n,e,i){let o;for(o in n[i])if(Object.prototype.hasOwnProperty.call(n[i],o)&&o!=="data"&&!Gt(n[i][o],e[i][o]))return!1;for(o in e[i])if(Object.prototype.hasOwnProperty.call(e[i],o)&&o!=="data"&&!Gt(n[i][o],e[i][o]))return!1;return!0}function ir(n,e,i,o,h,p){n=n||{},e=e||{};for(const m in n)Object.prototype.hasOwnProperty.call(n,m)&&(Gt(n[m],e[m])||i.push({command:p,args:[o,m,e[m],h]}));for(const m in e)Object.prototype.hasOwnProperty.call(e,m)&&!Object.prototype.hasOwnProperty.call(n,m)&&(Gt(n[m],e[m])||i.push({command:p,args:[o,m,e[m],h]}))}function An(n){return n.id}function Qi(n,e){return n[e.id]=e,n}class Ve{constructor(e,i,o,h){this.message=(e?`${e}: `:"")+o,h&&(this.identifier=h),i!=null&&i.__line__&&(this.line=i.__line__)}}function kn(n,...e){for(const i of e)for(const o in i)n[o]=i[o];return n}
vendor: 94,363 bytes, lines 22-23
22class Pr extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class Zr{constructor(e,i=[]){this.parent=e,this.bindings={};for(const[o,h]of i)this.bindings[o]=h}concat(e){return new Zr(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Pi={kind:"null"},bt={kind:"number"},li={kind:"string"},hi={kind:"boolean"},na={kind:"color"},Nu={kind:"projectionDefinition"},gs={kind:"object"},fi={kind:"value"},Xo={kind:"collator"},$a={kind:"formatted"},Us={kind:"padding"},Ca={kind:"colorArray"},_s={kind:"numberArray"},Rn={kind:"resolvedImage"},Pl={kind:"variableAnchorOffsetCollection"};function zr(n,e){return{kind:"array",itemType:n,N:e}}function Oi(n){if(n.kind==="array"){const e=Oi(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}return n.kind}const Xa=[Pi,bt,li,hi,na,Nu,$a,gs,zr(fi),Us,_s,Ca,Rn,Pl];function ys(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ys(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const i of Xa)if(!ys(i,e))return null}}return`Expected ${Oi(n)} but found ${Oi(e)} instead.`}function Yo(n,e){return e.some((i=>i.kind===n.kind))}function Vs(n,e){return e.some((i=>i==="null"?n===null:i==="array"?Array.isArray(n):i==="object"?n&&!Array.isArray(n)&&typeof n=="object":i===typeof n))}function Gr(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Bi=.96422,$i=.82521,qr=4/29,zi=6/29,_o=3*zi*zi,Fu=zi*zi*zi,xi=Math.PI/180,On=180/Math.PI;function Wo(n){return(n%=360)<0&&(n+=360),n}function Ql([n,e,i,o]){let h,p;const m=Jl((.2225045*(n=vn(n))+.7168786*(e=vn(e))+.0606169*(i=vn(i)))/1);n===e&&e===i?h=p=m:(h=Jl((.4360747*n+.3850649*e+.1430804*i)/Bi),p=Jl((.0139322*n+.0971045*e+.7141733*i)/$i));const x=116*m-16;return[x<0?0:x,500*(h-m),200*(m-p),o]}function vn(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Jl(n){return n>Fu?Math.pow(n,1/3):n/_o+qr}function Ko([n,e,i,o]){let h=(n+16)/116,p=isNaN(e)?h:h+e/500,m=isNaN(i)?h:h-i/200;return h=1*fn(h),p=Bi*fn(p),m=$i*fn(m),[Ya(3.1338561*p-1.6168667*h-.4906146*m),Ya(-.9787684*p+1.9161415*h+.033454*m),Ya(.0719453*p-.2289914*h+1.4052427*m),o]}function Ya(n){return(n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055)<0?0:n>1?1:n}function fn(n){return n>zi?n*n*n:_o*(n-qr)}const yo=Object.hasOwn||function(n,e){return Object.prototype.hasOwnProperty.call(n,e)};function vs(n,e){return yo(n,e)?n[e]:void 0}function Ma(n){return parseInt(n.padEnd(2,n),16)/255}function ju(n,e){return Wa(e?n/100:n,0,1)}function Wa(n,e,i){return Math.min(Math.max(e,n),i)}function zl(n){return!n.some(Number.isNaN)}const Zs={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 Ka(n,e,i){return n+i*(e-n)}function vo(n,e,i){return n.map(((o,h)=>Ka(o,e[h],i)))}class mi{constructor(e,i,o,h=1,p=!0){this.r=e,this.g=i,this.b=o,this.a=h,p||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[e,i,o,h]))}static parse(e){if(e instanceof mi)return e;if(typeof e!="string")return;const i=(function(o){if((o=o.toLowerCase().trim())==="transparent")return[0,0,0,0];const h=vs(Zs,o);if(h){const[m,x,w]=h;return[m/255,x/255,w/255,1]}if(o.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(o)){const m=o.length<6?1:2;let x=1;return[Ma(o.slice(x,x+=m)),Ma(o.slice(x,x+=m)),Ma(o.slice(x,x+=m)),Ma(o.slice(x,x+m)||"ff")]}if(o.startsWith("rgb")){const m=o.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(m){const[x,w,A,k,F,Z,G,W,K,J,se,ge]=m,le=[k||" ",G||" ",J].join("");if(le==="  "||le==="  /"||le===",,"||le===",,,"){const he=[A,Z,K].join(""),xe=he==="%%%"?100:he===""?255:0;if(xe){const Ae=[Wa(+w/xe,0,1),Wa(+F/xe,0,1),Wa(+W/xe,0,1),se?ju(+se,ge):1];if(zl(Ae))return Ae}}return}}const p=o.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[m,x,w,A,k,F,Z,G,W]=p,K=[w||" ",k||" ",Z].join("");if(K==="  "||K==="  /"||K===",,"||K===",,,"){const J=[+x,Wa(+A,0,100),Wa(+F,0,100),G?ju(+G,W):1];if(zl(J))return(function([se,ge,le,he]){function xe(Ae){const He=(Ae+se/30)%12,ut=ge*Math.min(le,1-le);return le-ut*Math.max(-1,Math.min(He-3,9-He,1))}return se=Wo(se),ge/=100,le/=100,[xe(0),xe(8),xe(4),he]})(J)}}})(e);return i?new mi(...i,!1):void 0}get rgb(){const{r:e,g:i,b:o,a:h}=this,p=h||1/0;return this.overwriteGetter("rgb",[e/p,i/p,o/p,h])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[i,o,h,p]=Ql(e),m=Math.sqrt(o*o+h*h);return[Math.round(1e4*m)?Wo(Math.atan2(h,o)*On):NaN,m,i,p]})(this.rgb))}get lab(){return this.overwriteGetter("lab",Ql(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){const[e,i,o,h]=this.rgb;return`rgba(${[e,i,o].map((p=>Math.round(255*p))).join(",")},${h})`}static interpolate(e,i,o,h="rgb"){switch(h){case"rgb":{const[p,m,x,w]=vo(e.rgb,i.rgb,o);return new mi(p,m,x,w,!1)}case"hcl":{const[p,m,x,w]=e.hcl,[A,k,F,Z]=i.hcl;let G,W;if(isNaN(p)||isNaN(A))isNaN(p)?isNaN(A)?G=NaN:(G=A,x!==1&&x!==0||(W=k)):(G=p,F!==1&&F!==0||(W=m));else{let le=A-p;A>p&&le>180?le-=360:A<p&&p-A>180&&(le+=360),G=p+o*le}const[K,J,se,ge]=(function([le,he,xe,Ae]){return le=isNaN(le)?0:le*xi,Ko([xe,Math.cos(le)*he,Math.sin(le)*he,Ae])})([G,W??Ka(m,k,o),Ka(x,F,o),Ka(w,Z,o)]);return new mi(K,J,se,ge,!1)}case"lab":{const[p,m,x,w]=Ko(vo(e.lab,i.lab,o));return new mi(p,m,x,w,!1)}}}}mi.black=new mi(0,0,0,1),mi.white=new mi(1,1,1,1),mi.transparent=new mi(0,0,0,0),mi.red=new mi(1,0,0,1);class ra{constructor(e,i,o){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Uu=["bottom","center","top"];class Qo{constructor(e,i,o,h,p,m){this.text=e,this.image=i,this.scale=o,this.fontStack=h,this.textColor=p,this.verticalAlign=m}}class or{constructor(e){this.sections=e}static fromString(e){return new or([new Qo(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof or?e:or.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class Qt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qt)return e;if(typeof e=="number")return new Qt([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const i of e)if(typeof i!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Qt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){return new Qt(vo(e.values,i.values,o))}}class Ni{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ni)return e;if(typeof e=="number")return new Ni([e]);if(Array.isArray(e)){for(const i of e)if(typeof i!="number")return;return new Ni(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){return new Ni(vo(e.values,i.values,o))}}class jt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof jt)return e;if(typeof e=="string"){const o=mi.parse(e);return o?new jt([o]):void 0}if(!Array.isArray(e))return;const i=[];for(const o of e){if(typeof o!="string")return;const h=mi.parse(o);if(!h)return;i.push(h)}return new jt(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o,h="rgb"){const p=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let m=0;m<e.values.length;m++)p.push(mi.interpolate(e.values[m],i.values[m],o,h));return new jt(p)}}class Ji extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const aa=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class wn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof wn)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){const o=e[i],h=e[i+1];if(typeof o!="string"||!aa.has(o)||!Array.isArray(h)||h.length!==2||typeof h[0]!="number"||typeof h[1]!="number")return}return new wn(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){const h=e.values,p=i.values;if(h.length!==p.length)throw new Ji(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);const m=[];for(let x=0;x<h.length;x+=2){if(h[x]!==p[x])throw new Ji(`Cannot interpolate values containing mismatched anchors. from[${x}]: ${h[x]}, to[${x}]: ${p[x]}`);m.push(h[x]);const[w,A]=h[x+1],[k,F]=p[x+1];m.push([Ka(w,k,o),Ka(A,F,o)])}return new wn(m)}}class br{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new br({name:e,available:!1}):null}}class Tn{constructor(e,i,o){this.from=e,this.to=i,this.transition=o}static interpolate(e,i,o){return new Tn(e,i,o)}static parse(e){return e instanceof Tn?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new Tn(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new Tn(e.from,e.to,e.transition):typeof e=="string"?new Tn(e,e,1):void 0}}function Hr(n,e,i,o){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[n,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[n,e,i,o]:[n,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function sa(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof Tn||n instanceof mi||n instanceof ra||n instanceof or||n instanceof Qt||n instanceof Ni||n instanceof jt||n instanceof wn||n instanceof br)return!0;if(Array.isArray(n)){for(const e of n)if(!sa(e))return!1;return!0}if(typeof n=="object"){for(const e in n)if(!sa(n[e]))return!1;return!0}return!1}function Ti(n){if(n===null)return Pi;if(typeof n=="string")return li;if(typeof n=="boolean")return hi;if(typeof n=="number")return bt;if(n instanceof mi)return na;if(n instanceof Tn)return Nu;if(n instanceof ra)return Xo;if(n instanceof or)return $a;if(n instanceof Qt)return Us;if(n instanceof Ni)return _s;if(n instanceof jt)return Ca;if(n instanceof wn)return Pl;if(n instanceof br)return Rn;if(Array.isArray(n)){const e=n.length;let i;for(const o of n){const h=Ti(o);if(i){if(i===h)continue;i=fi;break}i=h}return zr(i||fi,e)}return gs}function oa(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof mi||n instanceof Tn||n instanceof or||n instanceof Qt||n instanceof Ni||n instanceof jt||n instanceof wn||n instanceof br?n.toString():JSON.stringify(n)}class la{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!sa(e[1]))return i.error("invalid value");const o=e[1];let h=Ti(o);const p=i.expectedType;return h.kind!=="array"||h.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(h=p),new la(h,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const xo={string:li,number:bt,boolean:hi,object:gs};class $r{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o,h=1;const p=e[0];if(p==="array"){let x,w;if(e.length>2){const A=e[1];if(typeof A!="string"||!(A in xo)||A==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);x=xo[A],h++}else x=fi;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);w=e[2],h++}o=zr(x,w)}else{if(!xo[p])throw new Error(`Types doesn't contain name = ${p}`);o=xo[p]}const m=[];for(;h<e.length;h++){const x=i.parse(e[h],h,fi);if(!x)return null;m.push(x)}return new $r(o,m)}evaluate(e){for(let i=0;i<this.args.length;i++){const o=this.args[i].evaluate(e);if(!ys(this.type,Ti(o)))return o;if(i===this.args.length-1)throw new Ji(`Expected value to be of type ${Oi(this.type)}, but found ${Oi(Ti(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const $n={"to-boolean":hi,"to-color":na,"to-number":bt,"to-string":li};class wr{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const o=e[0];if(!$n[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&e.length!==2)return i.error("Expected one argument.");const h=$n[o],p=[];for(let m=1;m<e.length;m++){const x=i.parse(e[m],m,fi);if(!x)return null;p.push(x)}return new wr(h,p)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,o;for(const h of this.args){if(i=h.evaluate(e),o=null,i instanceof mi)return i;if(typeof i=="string"){const p=e.parseColor(i);if(p)return p}else if(Array.isArray(i)&&(o=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Hr(i[0],i[1],i[2],i[3]),!o))return new mi(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Ji(o||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(const o of this.args){i=o.evaluate(e);const h=Qt.parse(i);if(h)return h}throw new Ji(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(const o of this.args){i=o.evaluate(e);const h=Ni.parse(i);if(h)return h}throw new Ji(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(const o of this.args){i=o.evaluate(e);const h=jt.parse(i);if(h)return h}throw new Ji(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(const o of this.args){i=o.evaluate(e);const h=wn.parse(i);if(h)return h}throw new Ji(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(const o of this.args){if(i=o.evaluate(e),i===null)return 0;const h=Number(i);if(!isNaN(h))return h}throw new Ji(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return or.fromString(oa(this.args[0].evaluate(e)));case"resolvedImage":return br.fromString(oa(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return oa(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const eu=["Unknown","Point","LineString","Polygon"];class bo{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?eu[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(e){let i=this._parseColorCache.get(e);return i||(i=mi.parse(e),this._parseColorCache.set(e,i)),i}}class Ci{constructor(e,i,o=[],h,p=new Zr,m=[]){this.registry=e,this.path=o,this.key=o.map((x=>`[${x}]`)).join(""),this.scope=p,this.errors=m,this.expectedType=h,this._isConstant=i}parse(e,i,o,h,p={}){return i?this.concat(i,o,h)._parse(e,p):this._parse(e,p)}_parse(e,i){function o(h,p,m){return m==="assert"?new $r(p,[h]):m==="coerce"?new wr(p,[h]):h}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const h=e[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 p=this.registry[h];if(p){let m=p.parse(e,this);if(!m)return null;if(this.expectedType){const x=this.expectedType,w=m.type;if(x.kind!=="string"&&x.kind!=="number"&&x.kind!=="boolean"&&x.kind!=="object"&&x.kind!=="array"||w.kind!=="value"){if(x.kind==="projectionDefinition"&&["string","array"].includes(w.kind)||["color","formatted","resolvedImage"].includes(x.kind)&&["value","string"].includes(w.kind)||["padding","numberArray"].includes(x.kind)&&["value","number","array"].includes(w.kind)||x.kind==="colorArray"&&["value","string","array"].includes(w.kind)||x.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(w.kind))m=o(m,x,i.typeAnnotation||"coerce");else if(this.checkSubtype(x,w))return null}else m=o(m,x,i.typeAnnotation||"assert")}if(!(m instanceof la)&&m.type.kind!=="resolvedImage"&&this._isConstant(m)){const x=new bo;try{m=new la(m.type,m.evaluate(x))}catch(w){return this.error(w.message),null}}return m}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,o){const h=typeof e=="number"?this.path.concat(e):this.path,p=o?this.scope.concat(o):this.scope;return new Ci(this.registry,this._isConstant,h,i||null,p,this.errors)}error(e,...i){const o=`${this.key}${i.map((h=>`[${h}]`)).join("")}`;this.errors.push(new Pr(o,e))}checkSubtype(e,i){const o=ys(e,i);return o&&this.error(o),o}}class en{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let p=1;p<e.length-1;p+=2){const m=e[p];if(typeof m!="string")return i.error(`Expected string, but found ${typeof m} instead.`,p);if(/[^a-zA-Z0-9_]/.test(m))return i.error("Variable names must contain only alphanumeric characters or '_'.",p);const x=i.parse(e[p+1],p+1);if(!x)return null;o.push([m,x])}const h=i.parse(e[e.length-1],e.length-1,i.expectedType,o);return h?new en(o,h):null}outputDefined(){return this.result.outputDefined()}}class mr{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");const o=e[1];return i.scope.has(o)?new mr(o,i.scope.get(o)):i.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class bi{constructor(e,i,o){this.type=e,this.index=i,this.input=o}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,bt),h=i.parse(e[2],2,zr(i.expectedType||fi));return o&&h?new bi(h.type.itemType,o,h):null}evaluate(e){const i=this.index.evaluate(e),o=this.input.evaluate(e);if(i<0)throw new Ji(`Array index out of bounds: ${i} < 0.`);if(i>=o.length)throw new Ji(`Array index out of bounds: ${i} > ${o.length-1}.`);if(i!==Math.floor(i))throw new Ji(`Array index must be an integer, but found ${i} instead.`);return o[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class pi{constructor(e,i){this.type=hi,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,fi),h=i.parse(e[2],2,fi);return o&&h?Yo(o.type,[hi,li,bt,Pi,fi])?new pi(o,h):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Oi(o.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!Vs(i,["boolean","string","number","null"]))throw new Ji(`Expected first argument to be of type boolean, string, number or null, but found ${Oi(Ti(i))} instead.`);if(!Vs(o,["string","array"]))throw new Ji(`Expected second argument to be of type array or string, but found ${Oi(Ti(o))} instead.`);return o.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Jo{constructor(e,i,o){this.type=bt,this.needle=e,this.haystack=i,this.fromIndex=o}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,fi),h=i.parse(e[2],2,fi);if(!o||!h)return null;if(!Yo(o.type,[hi,li,bt,Pi,fi]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Oi(o.type)} instead`);if(e.length===4){const p=i.parse(e[3],3,bt);return p?new Jo(o,h,p):null}return new Jo(o,h)}evaluate(e){const i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!Vs(i,["boolean","string","number","null"]))throw new Ji(`Expected first argument to be of type boolean, string, number or null, but found ${Oi(Ti(i))} instead.`);let h;if(this.fromIndex&&(h=this.fromIndex.evaluate(e)),Vs(o,["string"])){const p=o.indexOf(i,h);return p===-1?-1:[...o.slice(0,p)].length}if(Vs(o,["array"]))return o.indexOf(i,h);throw new Ji(`Expected second argument to be of type array or string, but found ${Oi(Ti(o))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Di{constructor(e,i,o,h,p,m){this.inputType=e,this.type=i,this.input=o,this.cases=h,this.outputs=p,this.otherwise=m}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let o,h;i.expectedType&&i.expectedType.kind!=="value"&&(h=i.expectedType);const p={},m=[];for(let A=2;A<e.length-1;A+=2){let k=e[A];const F=e[A+1];Array.isArray(k)||(k=[k]);const Z=i.concat(A);if(k.length===0)return Z.error("Expected at least one branch label.");for(const W of k){if(typeof W!="number"&&typeof W!="string")return Z.error("Branch labels must be numbers or strings.");if(typeof W=="number"&&Math.abs(W)>Number.MAX_SAFE_INTEGER)return Z.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof W=="number"&&Math.floor(W)!==W)return Z.error("Numeric branch labels must be integer values.");if(o){if(Z.checkSubtype(o,Ti(W)))return null}else o=Ti(W);if(p[String(W)]!==void 0)return Z.error("Branch labels must be unique.");p[String(W)]=m.length}const G=i.parse(F,A,h);if(!G)return null;h=h||G.type,m.push(G)}const x=i.parse(e[1],1,fi);if(!x)return null;const w=i.parse(e[e.length-1],e.length-1,h);return w?x.type.kind!=="value"&&i.concat(1).checkSubtype(o,x.type)?null:new Di(o,h,x,p,m,w):null}evaluate(e){const i=this.input.evaluate(e);return(Ti(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class tu{constructor(e,i,o){this.type=e,this.branches=i,this.otherwise=o}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);const h=[];for(let m=1;m<e.length-1;m+=2){const x=i.parse(e[m],m,hi);if(!x)return null;const w=i.parse(e[m+1],m+1,o);if(!w)return null;h.push([x,w]),o=o||w.type}const p=i.parse(e[e.length-1],e.length-1,o);if(!p)return null;if(!o)throw new Error("Can't infer output type");return new tu(o,h,p)}evaluate(e){for(const[i,o]of this.branches)if(i.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[i,o]of this.branches)e(i),e(o);e(this.otherwise)}outputDefined(){return this.branches.every((([e,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class Ea{constructor(e,i,o,h){this.type=e,this.input=i,this.beginIndex=o,this.endIndex=h}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const o=i.parse(e[1],1,fi),h=i.parse(e[2],2,bt);if(!o||!h)return null;if(!Yo(o.type,[zr(fi),li,fi]))return i.error(`Expected first argument to be of type array or string, but found ${Oi(o.type)} instead`);if(e.length===4){const p=i.parse(e[3],3,bt);return p?new Ea(o.type,o,h,p):null}return new Ea(o.type,o,h)}evaluate(e){const i=this.input.evaluate(e),o=this.beginIndex.evaluate(e);let h;if(this.endIndex&&(h=this.endIndex.evaluate(e)),Vs(i,["string"]))return[...i].slice(o,h).join("");if(Vs(i,["array"]))return i.slice(o,h);throw new Ji(`Expected first argument to be of type array or string, but found ${Oi(Ti(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function wo(n,e){const i=n.length-1;let o,h,p=0,m=i,x=0;for(;p<=m;)if(x=Math.floor((p+m)/2),o=n[x],h=n[x+1],o<=e){if(x===i||e<h)return x;p=x+1}else{if(!(o>e))throw new Ji("Input is not a number.");m=x-1}return 0}class To{constructor(e,i,o){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[h,p]of o)this.labels.push(h),this.outputs.push(p)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const o=i.parse(e[1],1,bt);if(!o)return null;const h=[];let p=null;i.expectedType&&i.expectedType.kind!=="value"&&(p=i.expectedType);for(let m=1;m<e.length;m+=2){const x=m===1?-1/0:e[m],w=e[m+1],A=m,k=m+1;if(typeof x!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(h.length&&h[h.length-1][0]>=x)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);const F=i.parse(w,k,p);if(!F)return null;p=p||F.type,h.push([x,F])}return new To(p,o,h)}evaluate(e){const i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);const h=this.input.evaluate(e);if(h<=i[0])return o[0].evaluate(e);const p=i.length;return h>=i[p-1]?o[p-1].evaluate(e):o[wo(i,h)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Vu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var iu,Da,Hh=(function(){if(Da)return iu;function n(e,i,o,h){this.cx=3*e,this.bx=3*(o-e)-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=e,this.p1y=i,this.p2x=o,this.p2y=h}return Da=1,iu=n,n.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var o=e,h=0;h<8;h++){var p=this.sampleCurveX(o)-e;if(Math.abs(p)<i)return o;var m=this.sampleCurveDerivativeX(o);if(Math.abs(m)<1e-6)break;o-=p/m}var x=0,w=1;for(o=e,h=0;h<20&&(p=this.sampleCurveX(o),!(Math.abs(p-e)<i));h++)e>p?x=o:w=o,o=.5*(w-x)+x;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},iu})(),Zu=Vu(Hh);class Zn{constructor(e,i,o,h,p){this.type=e,this.operator=i,this.interpolation=o,this.input=h,this.labels=[],this.outputs=[];for(const[m,x]of p)this.labels.push(m),this.outputs.push(x)}static interpolationFactor(e,i,o,h){let p=0;if(e.name==="exponential")p=Qa(i,e.base,o,h);else if(e.name==="linear")p=Qa(i,1,o,h);else if(e.name==="cubic-bezier"){const m=e.controlPoints;p=new Zu(m[0],m[1],m[2],m[3]).solve(Qa(i,1,o,h))}return p}static parse(e,i){let[o,h,p,...m]=e;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 A=h[1];if(typeof A!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:A}}else{if(h[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(h[0])}`,1,0);{const A=h.slice(1);if(A.length!==4||A.some((k=>typeof k!="number"||k<0||k>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:A}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(p=i.parse(p,2,bt),!p)return null;const x=[];let w=null;o!=="interpolate-hcl"&&o!=="interpolate-lab"||i.expectedType==Ca?i.expectedType&&i.expectedType.kind!=="value"&&(w=i.expectedType):w=na;for(let A=0;A<m.length;A+=2){const k=m[A],F=m[A+1],Z=A+3,G=A+4;if(typeof k!="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(x.length&&x[x.length-1][0]>=k)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Z);const W=i.parse(F,G,w);if(!W)return null;w=w||W.type,x.push([k,W])}return Gr(w,bt)||Gr(w,Nu)||Gr(w,na)||Gr(w,Us)||Gr(w,_s)||Gr(w,Ca)||Gr(w,Pl)||Gr(w,zr(bt))?new Zn(w,o,h,p,x):i.error(`Type ${Oi(w)} is not interpolatable.`)}evaluate(e){const i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);const h=this.input.evaluate(e);if(h<=i[0])return o[0].evaluate(e);const p=i.length;if(h>=i[p-1])return o[p-1].evaluate(e);const m=wo(i,h),x=Zn.interpolationFactor(this.interpolation,h,i[m],i[m+1]),w=o[m].evaluate(e),A=o[m+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ka(w,A,x);case"color":return mi.interpolate(w,A,x);case"padding":return Qt.interpolate(w,A,x);case"colorArray":return jt.interpolate(w,A,x);case"numberArray":return Ni.interpolate(w,A,x);case"variableAnchorOffsetCollection":return wn.interpolate(w,A,x);case"array":return vo(w,A,x);case"projectionDefinition":return Tn.interpolate(w,A,x)}case"interpolate-hcl":switch(this.type.kind){case"color":return mi.interpolate(w,A,x,"hcl");case"colorArray":return jt.interpolate(w,A,x,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return mi.interpolate(w,A,x,"lab");case"colorArray":return jt.interpolate(w,A,x,"lab")}}}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Qa(n,e,i,o){const h=o-i,p=n-i;return h===0?0:e===1?p/h:(Math.pow(e,p)-1)/(Math.pow(e,h)-1)}const xn={color:mi.interpolate,number:Ka,padding:Qt.interpolate,numberArray:Ni.interpolate,colorArray:jt.interpolate,variableAnchorOffsetCollection:wn.interpolate,array:vo};class Gs{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=null;const h=i.expectedType;h&&h.kind!=="value"&&(o=h);const p=[];for(const x of e.slice(1)){const w=i.parse(x,1+p.length,o,void 0,{typeAnnotation:"omit"});if(!w)return null;o=o||w.type,p.push(w)}if(!o)throw new Error("No output type");const m=h&&p.some((x=>ys(h,x.type)));return new Gs(m?fi:o,p)}evaluate(e){let i,o=null,h=0;for(const p of this.args)if(h++,o=p.evaluate(e),o&&o instanceof br&&!o.available&&(i||(i=o.name),o=null,h===this.args.length&&(o=i)),o!==null)break;return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function nu(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Ll(n,e,i,o){return o.compare(e,i)===0}function Pn(n,e,i){const o=n!=="=="&&n!=="!=";return class Zy{constructor(p,m,x){this.type=hi,this.lhs=p,this.rhs=m,this.collator=x,this.hasUntypedArgument=p.type.kind==="value"||m.type.kind==="value"}static parse(p,m){if(p.length!==3&&p.length!==4)return m.error("Expected two or three arguments.");const x=p[0];let w=m.parse(p[1],1,fi);if(!w)return null;if(!nu(x,w.type))return m.concat(1).error(`"${x}" comparisons are not supported for type '${Oi(w.type)}'.`);let A=m.parse(p[2],2,fi);if(!A)return null;if(!nu(x,A.type))return m.concat(2).error(`"${x}" comparisons are not supported for type '${Oi(A.type)}'.`);if(w.type.kind!==A.type.kind&&w.type.kind!=="value"&&A.type.kind!=="value")return m.error(`Cannot compare types '${Oi(w.type)}' and '${Oi(A.type)}'.`);o&&(w.type.kind==="value"&&A.type.kind!=="value"?w=new $r(A.type,[w]):w.type.kind!=="value"&&A.type.kind==="value"&&(A=new $r(w.type,[A])));let k=null;if(p.length===4){if(w.type.kind!=="string"&&A.type.kind!=="string"&&w.type.kind!=="value"&&A.type.kind!=="value")return m.error("Cannot use collator to compare non-string types.");if(k=m.parse(p[3],3,Xo),!k)return null}return new Zy(w,A,k)}evaluate(p){const m=this.lhs.evaluate(p),x=this.rhs.evaluate(p);if(o&&this.hasUntypedArgument){const w=Ti(m),A=Ti(x);if(w.kind!==A.kind||w.kind!=="string"&&w.kind!=="number")throw new Ji(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${w.kind}, ${A.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const w=Ti(m),A=Ti(x);if(w.kind!=="string"||A.kind!=="string")return e(p,m,x)}return this.collator?i(p,m,x,this.collator.evaluate(p)):e(p,m,x)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}}}const nh=Pn("==",(function(n,e,i){return e===i}),Ll),Gu=Pn("!=",(function(n,e,i){return e!==i}),(function(n,e,i,o){return!Ll(0,e,i,o)})),qu=Pn("<",(function(n,e,i){return e<i}),(function(n,e,i,o){return o.compare(e,i)<0})),$h=Pn(">",(function(n,e,i){return e>i}),(function(n,e,i,o){return o.compare(e,i)>0})),el=Pn("<=",(function(n,e,i){return e<=i}),(function(n,e,i,o){return o.compare(e,i)<=0})),ru=Pn(">=",(function(n,e,i){return e>=i}),(function(n,e,i,o){return o.compare(e,i)>=0}));class qs{constructor(e,i,o){this.type=Xo,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");const o=e[1];if(typeof o!="object"||Array.isArray(o))return i.error("Collator options argument must be an object.");const h=i.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,hi);if(!h)return null;const p=i.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,hi);if(!p)return null;let m=null;return o.locale&&(m=i.parse(o.locale,1,li),!m)?null:new qs(h,p,m)}evaluate(e){return new ra(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Hs{constructor(e,i,o,h,p){this.type=li,this.number=e,this.locale=i,this.currency=o,this.minFractionDigits=h,this.maxFractionDigits=p}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const o=i.parse(e[1],1,bt);if(!o)return null;const h=e[2];if(typeof h!="object"||Array.isArray(h))return i.error("NumberFormat options argument must be an object.");let p=null;if(h.locale&&(p=i.parse(h.locale,1,li),!p))return null;let m=null;if(h.currency&&(m=i.parse(h.currency,1,li),!m))return null;let x=null;if(h["min-fraction-digits"]&&(x=i.parse(h["min-fraction-digits"],1,bt),!x))return null;let w=null;return h["max-fraction-digits"]&&(w=i.parse(h["max-fraction-digits"],1,bt),!w)?null:new Hs(o,p,m,x,w)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class au{constructor(e){this.type=$a,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&typeof o=="object")return i.error("First argument must be an image or text section.");const h=[];let p=!1;for(let m=1;m<=e.length-1;++m){const x=e[m];if(p&&typeof x=="object"&&!Array.isArray(x)){p=!1;let w=null;if(x["font-scale"]&&(w=i.parse(x["font-scale"],1,bt),!w))return null;let A=null;if(x["text-font"]&&(A=i.parse(x["text-font"],1,zr(li)),!A))return null;let k=null;if(x["text-color"]&&(k=i.parse(x["text-color"],1,na),!k))return null;let F=null;if(x["vertical-align"]){if(typeof x["vertical-align"]=="string"&&!Uu.includes(x["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${x["vertical-align"]}' instead.`);if(F=i.parse(x["vertical-align"],1,li),!F)return null}const Z=h[h.length-1];Z.scale=w,Z.font=A,Z.textColor=k,Z.verticalAlign=F}else{const w=i.parse(e[m],1,fi);if(!w)return null;const A=w.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,h.push({content:w,scale:null,font:null,textColor:null,verticalAlign:null})}}return new au(h)}evaluate(e){return new or(this.sections.map((i=>{const o=i.content.evaluate(e);return Ti(o)===Rn?new Qo("",o,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Qo(oa(o),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class xs{constructor(e){this.type=Rn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const o=i.parse(e[1],1,li);return o?new xs(o):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),o=br.fromString(i);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(i)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class Tr{constructor(e){this.type=bt,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=i.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Oi(o.type)} instead.`):new Tr(o):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new Ji(`Expected value to be of type string or array, but found ${Oi(Ti(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Bn=8192;function tl(n,e){const i=(180+n[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,h=Math.pow(2,e.z);return[Math.round(i*h*Bn),Math.round(o*h*Bn)]}function Dl(n,e){const i=Math.pow(2,e.z);return[(h=(n[0]/Bn+e.x)/i,360*h-180),(o=(n[1]/Bn+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90)];var o,h}function So(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function bs(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function rh(n,e,i){const o=n[0]-e[0],h=n[1]-e[1],p=n[0]-i[0],m=n[1]-i[1];return o*m-p*h==0&&o*p<=0&&h*m<=0}function su(n,e,i,o){return(h=[o[0]-i[0],o[1]-i[1]])[0]*(p=[e[0]-n[0],e[1]-n[1]])[1]-h[1]*p[0]!=0&&!(!Ia(n,e,i,o)||!Ia(i,o,n,e));var h,p}function Tc(n,e,i){for(const o of i)for(let h=0;h<o.length-1;++h)if(su(n,e,o[h],o[h+1]))return!0;return!1}function Ja(n,e,i=!1){let o=!1;for(const x of e)for(let w=0;w<x.length-1;w++){if(rh(n,x[w],x[w+1]))return i;(p=x[w])[1]>(h=n)[1]!=(m=x[w+1])[1]>h[1]&&h[0]<(m[0]-p[0])*(h[1]-p[1])/(m[1]-p[1])+p[0]&&(o=!o)}var h,p,m;return o}function ua(n,e){for(const i of e)if(Ja(n,i))return!0;return!1}function il(n,e){for(const i of n)if(!Ja(i,e))return!1;for(let i=0;i<n.length-1;++i)if(Tc(n[i],n[i+1],e))return!1;return!0}function ah(n,e){for(const i of e)if(il(n,i))return!0;return!1}function Ia(n,e,i,o){const h=o[0]-i[0],p=o[1]-i[1],m=(n[0]-i[0])*p-h*(n[1]-i[1]),x=(e[0]-i[0])*p-h*(e[1]-i[1]);return m>0&&x<0||m<0&&x>0}function Hu(n,e,i){const o=[];for(let h=0;h<n.length;h++){const p=[];for(let m=0;m<n[h].length;m++){const x=tl(n[h][m],i);So(e,x),p.push(x)}o.push(p)}return o}function ka(n,e,i){const o=[];for(let h=0;h<n.length;h++){const p=Hu(n[h],e,i);o.push(p)}return o}function Il(n,e,i,o){if(n[0]<i[0]||n[0]>i[2]){const h=.5*o;let p=n[0]-i[0]>h?-o:i[0]-n[0]>h?o:0;p===0&&(p=n[0]-i[2]>h?-o:i[2]-n[0]>h?o:0),n[0]+=p}So(e,n)}function kl(n,e,i,o){const h=Math.pow(2,o.z)*Bn,p=[o.x*Bn,o.y*Bn],m=[];for(const x of n)for(const w of x){const A=[w.x+p[0],w.y+p[1]];Il(A,e,i,h),m.push(A)}return m}function Rl(n,e,i,o){const h=Math.pow(2,o.z)*Bn,p=[o.x*Bn,o.y*Bn],m=[];for(const w of n){const A=[];for(const k of w){const F=[k.x+p[0],k.y+p[1]];So(e,F),A.push(F)}m.push(A)}if(e[2]-e[0]<=h/2){(x=e)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(const w of m)for(const A of w)Il(A,e,i,h)}var x;return m}class es{constructor(e,i){this.type=hi,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(sa(e[1])){const o=e[1];if(o.type==="FeatureCollection"){const h=[];for(const p of o.features){const{type:m,coordinates:x}=p.geometry;m==="Polygon"&&h.push(x),m==="MultiPolygon"&&h.push(...x)}if(h.length)return new es(o,{type:"MultiPolygon",coordinates:h})}else if(o.type==="Feature"){const h=o.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new es(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new es(o,o)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,o){const h=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],m=i.canonicalID();if(o.type==="Polygon"){const x=Hu(o.coordinates,p,m),w=kl(i.geometry(),h,p,m);if(!bs(h,p))return!1;for(const A of w)if(!Ja(A,x))return!1}if(o.type==="MultiPolygon"){const x=ka(o.coordinates,p,m),w=kl(i.geometry(),h,p,m);if(!bs(h,p))return!1;for(const A of w)if(!ua(A,x))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,o){const h=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],m=i.canonicalID();if(o.type==="Polygon"){const x=Hu(o.coordinates,p,m),w=Rl(i.geometry(),h,p,m);if(!bs(h,p))return!1;for(const A of w)if(!il(A,x))return!1}if(o.type==="MultiPolygon"){const x=ka(o.coordinates,p,m),w=Rl(i.geometry(),h,p,m);if(!bs(h,p))return!1;for(const A of w)if(!ah(A,x))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Sc=class{constructor(n=[],e=(i,o)=>i<o?-1:i>o?1:0){if(this.data=n,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(n){this.data.push(n),this._up(this.length++)}pop(){if(this.length===0)return;const n=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),n}peek(){return this.data[0]}_up(n){const{data:e,compare:i}=this,o=e[n];for(;n>0;){const h=n-1>>1,p=e[h];if(i(o,p)>=0)break;e[n]=p,n=h}e[n]=o}_down(n){const{data:e,compare:i}=this,o=this.length>>1,h=e[n];for(;n<o;){let p=1+(n<<1);const m=p+1;if(m<this.length&&i(e[m],e[p])<0&&(p=m),i(e[p],h)>=0)break;e[n]=e[p],n=p}e[n]=h}};function Ra(n,e,i=0,o=n.length-1,h=Cc){for(;o>i;){if(o-i>600){const w=o-i+1,A=e-i+1,k=Math.log(w),F=.5*Math.exp(2*k/3),Z=.5*Math.sqrt(k*F*(w-F)/w)*(A-w/2<0?-1:1);Ra(n,e,Math.max(i,Math.floor(e-A*F/w+Z)),Math.min(o,Math.floor(e+(w-A)*F/w+Z)),h)}const p=n[e];let m=i,x=o;for(ts(n,i,e),h(n[o],p)>0&&ts(n,i,o);m<x;){for(ts(n,m,x),m++,x--;h(n[m],p)<0;)m++;for(;h(n[x],p)>0;)x--}h(n[i],p)===0?ts(n,i,x):(x++,ts(n,x,o)),x<=e&&(i=x+1),e<=x&&(o=x-1)}}function ts(n,e,i){const o=n[e];n[e]=n[i],n[i]=o}function Cc(n,e){return n<e?-1:n>e?1:0}function nl(n,e){if(n.length<=1)return[n];const i=[];let o,h;for(const p of n){const m=$s(p);m!==0&&(p.area=Math.abs(m),h===void 0&&(h=m<0),h===m<0?(o&&i.push(o),o=[p]):o.push(p))}if(o&&i.push(o),e>1)for(let p=0;p<i.length;p++)i[p].length<=e||(Ra(i[p],e,1,i[p].length-1,sh),i[p]=i[p].slice(0,e));return i}function sh(n,e){return e.area-n.area}function $s(n){let e=0;for(let i,o,h=0,p=n.length,m=p-1;h<p;m=h++)i=n[h],o=n[m],e+=(o.x-i.x)*(i.y+o.y);return e}const oh=1/298.257223563,ws=oh*(2-oh),lh=Math.PI/180;class is{constructor(e){const i=6378.137*lh*1e3,o=Math.cos(e*lh),h=1/(1-ws*(1-o*o)),p=Math.sqrt(h);this.kx=i*p*o,this.ky=i*p*h*(1-ws)}distance(e,i){const o=this.wrap(e[0]-i[0])*this.kx,h=(e[1]-i[1])*this.ky;return Math.sqrt(o*o+h*h)}pointOnLine(e,i){let o,h,p,m,x=1/0;for(let w=0;w<e.length-1;w++){let A=e[w][0],k=e[w][1],F=this.wrap(e[w+1][0]-A)*this.kx,Z=(e[w+1][1]-k)*this.ky,G=0;F===0&&Z===0||(G=(this.wrap(i[0]-A)*this.kx*F+(i[1]-k)*this.ky*Z)/(F*F+Z*Z),G>1?(A=e[w+1][0],k=e[w+1][1]):G>0&&(A+=F/this.kx*G,k+=Z/this.ky*G)),F=this.wrap(i[0]-A)*this.kx,Z=(i[1]-k)*this.ky;const W=F*F+Z*Z;W<x&&(x=W,o=A,h=k,p=w,m=G)}return{point:[o,h],index:p,t:Math.max(0,Math.min(1,m))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Sr(n,e){return e[0]-n[0]}function Xs(n){return n[1]-n[0]+1}function ca(n,e){return n[1]>=n[0]&&n[1]<e}function Co(n,e){if(n[0]>n[1])return[null,null];const i=Xs(n);if(e){if(i===2)return[n,null];const h=Math.floor(i/2);return[[n[0],n[0]+h],[n[0]+h,n[1]]]}if(i===1)return[n,null];const o=Math.floor(i/2)-1;return[[n[0],n[0]+o],[n[0]+o+1,n[1]]]}function Ol(n,e){if(!ca(e,n.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let o=e[0];o<=e[1];++o)So(i,n[o]);return i}function rl(n){const e=[1/0,1/0,-1/0,-1/0];for(const i of n)for(const o of i)So(e,o);return e}function Ts(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function al(n,e,i){if(!Ts(n)||!Ts(e))return NaN;let o=0,h=0;return n[2]<e[0]&&(o=e[0]-n[2]),n[0]>e[2]&&(o=n[0]-e[2]),n[1]>e[3]&&(h=n[1]-e[3]),n[3]<e[1]&&(h=e[1]-n[3]),i.distance([0,0],[o,h])}function ha(n,e,i){const o=i.pointOnLine(e,n);return i.distance(n,o.point)}function Bl(n,e,i,o,h){const p=Math.min(ha(n,[i,o],h),ha(e,[i,o],h)),m=Math.min(ha(i,[n,e],h),ha(o,[n,e],h));return Math.min(p,m)}function ou(n,e,i,o,h){if(!ca(e,n.length)||!ca(o,i.length))return 1/0;let p=1/0;for(let m=e[0];m<e[1];++m){const x=n[m],w=n[m+1];for(let A=o[0];A<o[1];++A){const k=i[A],F=i[A+1];if(su(x,w,k,F))return 0;p=Math.min(p,Bl(x,w,k,F,h))}}return p}function sl(n,e,i,o,h){if(!ca(e,n.length)||!ca(o,i.length))return NaN;let p=1/0;for(let m=e[0];m<=e[1];++m)for(let x=o[0];x<=o[1];++x)if(p=Math.min(p,h.distance(n[m],i[x])),p===0)return p;return p}function uh(n,e,i){if(Ja(n,e,!0))return 0;let o=1/0;for(const h of e){const p=h[0],m=h[h.length-1];if(p!==m&&(o=Math.min(o,ha(n,[m,p],i)),o===0))return o;const x=i.pointOnLine(h,n);if(o=Math.min(o,i.distance(n,x.point)),o===0)return o}return o}function Mo(n,e,i,o){if(!ca(e,n.length))return NaN;for(let p=e[0];p<=e[1];++p)if(Ja(n[p],i,!0))return 0;let h=1/0;for(let p=e[0];p<e[1];++p){const m=n[p],x=n[p+1];for(const w of i)for(let A=0,k=w.length,F=k-1;A<k;F=A++){const Z=w[F],G=w[A];if(su(m,x,Z,G))return 0;h=Math.min(h,Bl(m,x,Z,G,o))}}return h}function ol(n,e){for(const i of n)for(const o of i)if(Ja(o,e,!0))return!0;return!1}function $u(n,e,i,o=1/0){const h=rl(n),p=rl(e);if(o!==1/0&&al(h,p,i)>=o)return o;if(bs(h,p)){if(ol(n,e))return 0}else if(ol(e,n))return 0;let m=1/0;for(const x of n)for(let w=0,A=x.length,k=A-1;w<A;k=w++){const F=x[k],Z=x[w];for(const G of e)for(let W=0,K=G.length,J=K-1;W<K;J=W++){const se=G[J],ge=G[W];if(su(F,Z,se,ge))return 0;m=Math.min(m,Bl(F,Z,se,ge,i))}}return m}function Fi(n,e,i,o,h,p){if(!p)return;const m=al(Ol(o,p),h,i);m<e&&n.push([m,p,[0,0]])}function lr(n,e,i,o,h,p,m){if(!p||!m)return;const x=al(Ol(o,p),Ol(h,m),i);x<e&&n.push([x,p,m])}function Eo(n,e,i,o,h=1/0){let p=Math.min(o.distance(n[0],i[0][0]),h);if(p===0)return p;const m=new Sc([[0,[0,n.length-1],[0,0]]],Sr),x=rl(i);for(;m.length>0;){const w=m.pop();if(w[0]>=p)continue;const A=w[1],k=e?50:100;if(Xs(A)<=k){if(!ca(A,n.length))return NaN;if(e){const F=Mo(n,A,i,o);if(isNaN(F)||F===0)return F;p=Math.min(p,F)}else for(let F=A[0];F<=A[1];++F){const Z=uh(n[F],i,o);if(p=Math.min(p,Z),p===0)return 0}}else{const F=Co(A,e);Fi(m,p,o,n,x,F[0]),Fi(m,p,o,n,x,F[1])}}return p}function lu(n,e,i,o,h,p=1/0){let m=Math.min(p,h.distance(n[0],i[0]));if(m===0)return m;const x=new Sc([[0,[0,n.length-1],[0,i.length-1]]],Sr);for(;x.length>0;){const w=x.pop();if(w[0]>=m)continue;const A=w[1],k=w[2],F=e?50:100,Z=o?50:100;if(Xs(A)<=F&&Xs(k)<=Z){if(!ca(A,n.length)&&ca(k,i.length))return NaN;let G;if(e&&o)G=ou(n,A,i,k,h),m=Math.min(m,G);else if(e&&!o){const W=n.slice(A[0],A[1]+1);for(let K=k[0];K<=k[1];++K)if(G=ha(i[K],W,h),m=Math.min(m,G),m===0)return m}else if(!e&&o){const W=i.slice(k[0],k[1]+1);for(let K=A[0];K<=A[1];++K)if(G=ha(n[K],W,h),m=Math.min(m,G),m===0)return m}else G=sl(n,A,i,k,h),m=Math.min(m,G)}else{const G=Co(A,e),W=Co(k,o);lr(x,m,h,n,i,G[0],W[0]),lr(x,m,h,n,i,G[0],W[1]),lr(x,m,h,n,i,G[1],W[0]),lr(x,m,h,n,i,G[1],W[1])}}return m}function ll(n){return n.type==="MultiPolygon"?n.coordinates.map((e=>({type:"Polygon",coordinates:e}))):n.type==="MultiLineString"?n.coordinates.map((e=>({type:"LineString",coordinates:e}))):n.type==="MultiPoint"?n.coordinates.map((e=>({type:"Point",coordinates:e}))):[n]}class ul{constructor(e,i){this.type=bt,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(sa(e[1])){const o=e[1];if(o.type==="FeatureCollection")return new ul(o,o.features.map((h=>ll(h.geometry))).flat());if(o.type==="Feature")return new ul(o,ll(o.geometry));if("type"in o&&"coordinates"in o)return new ul(o,ll(o))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,o){const h=i.geometry(),p=h.flat().map((w=>Dl([w.x,w.y],i.canonical)));if(h.length===0)return NaN;const m=new is(p[0][1]);let x=1/0;for(const w of o){switch(w.type){case"Point":x=Math.min(x,lu(p,!1,[w.coordinates],!1,m,x));break;case"LineString":x=Math.min(x,lu(p,!1,w.coordinates,!0,m,x));break;case"Polygon":x=Math.min(x,Eo(p,!1,w.coordinates,m,x))}if(x===0)return x}return x})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,o){const h=i.geometry(),p=h.flat().map((w=>Dl([w.x,w.y],i.canonical)));if(h.length===0)return NaN;const m=new is(p[0][1]);let x=1/0;for(const w of o){switch(w.type){case"Point":x=Math.min(x,lu(p,!0,[w.coordinates],!1,m,x));break;case"LineString":x=Math.min(x,lu(p,!0,w.coordinates,!0,m,x));break;case"Polygon":x=Math.min(x,Eo(p,!0,w.coordinates,m,x))}if(x===0)return x}return x})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,o){const h=i.geometry();if(h.length===0||h[0].length===0)return NaN;const p=nl(h,0).map((w=>w.map((A=>A.map((k=>Dl([k.x,k.y],i.canonical))))))),m=new is(p[0][0][0][1]);let x=1/0;for(const w of o)for(const A of p){switch(w.type){case"Point":x=Math.min(x,Eo([w.coordinates],!1,A,m,x));break;case"LineString":x=Math.min(x,Eo(w.coordinates,!0,A,m,x));break;case"Polygon":x=Math.min(x,$u(A,w.coordinates,m,x))}if(x===0)return x}return x})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Nl{constructor(e){this.type=fi,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=e[1];return o==null?i.error("Global state property must be defined."):typeof o!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Nl(o)}evaluate(e){var i;const o=(i=e.globals)===null||i===void 0?void 0:i.globalState;return o&&Object.keys(o).length!==0?vs(o,this.key):null}eachChild(){}outputDefined(){return!1}}const Fl={"==":nh,"!=":Gu,">":$h,"<":qu,">=":ru,"<=":el,array:$r,at:bi,boolean:$r,case:tu,coalesce:Gs,collator:qs,format:au,image:xs,in:pi,"index-of":Jo,interpolate:Zn,"interpolate-hcl":Zn,"interpolate-lab":Zn,length:Tr,let:en,literal:la,match:Di,number:$r,"number-format":Hs,object:$r,slice:Ea,step:To,string:$r,"to-boolean":wr,"to-color":wr,"to-number":wr,"to-string":wr,var:mr,within:es,distance:ul,"global-state":Nl};class Cr{constructor(e,i,o,h){this.name=e,this.type=i,this._evaluate=o,this.args=h}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){const o=e[0],h=Cr.definitions[o];if(!h)return i.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(h)?h[0]:h.type,m=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,x=m.filter((([A])=>!Array.isArray(A)||A.length===e.length-1));let w=null;for(const[A,k]of x){w=new Ci(i.registry,Xr,i.path,null,i.scope);const F=[];let Z=!1;for(let G=1;G<e.length;G++){const W=e[G],K=Array.isArray(A)?A[G-1]:A.type,J=w.parse(W,1+F.length,K);if(!J){Z=!0;break}F.push(J)}if(!Z)if(Array.isArray(A)&&A.length!==F.length)w.error(`Expected ${A.length} arguments, but found ${F.length} instead.`);else{for(let G=0;G<F.length;G++){const W=Array.isArray(A)?A[G]:A.type,K=F[G];w.concat(G+1).checkSubtype(W,K.type)}if(w.errors.length===0)return new Cr(o,p,k,F)}}if(x.length===1)i.errors.push(...w.errors);else{const A=(x.length?x:m).map((([F])=>{return Z=F,Array.isArray(Z)?`(${Z.map(Oi).join(", ")})`:`(${Oi(Z.type)}...)`;var Z})).join(" | "),k=[];for(let F=1;F<e.length;F++){const Z=i.parse(e[F],1+k.length);if(!Z)return null;k.push(Oi(Z.type))}i.error(`Expected arguments of type ${A}, but found (${k.join(", ")}) instead.`)}return null}static register(e,i){Cr.definitions=i;for(const o in i)e[o]=Cr}}function Mc(n,[e,i,o,h]){e=e.evaluate(n),i=i.evaluate(n),o=o.evaluate(n);const p=h?h.evaluate(n):1,m=Hr(e,i,o,p);if(m)throw new Ji(m);return new mi(e/255,i/255,o/255,p,!1)}function Ys(n,e){return n in e}function da(n,e){const i=e[n];return i===void 0?null:i}function ns(n){return{type:n}}function Xr(n){if(n instanceof mr)return Xr(n.boundExpression);if(n instanceof Cr&&n.name==="error"||n instanceof qs||n instanceof es||n instanceof ul||n instanceof Nl)return!1;const e=n instanceof wr||n instanceof $r;let i=!0;return n.eachChild((o=>{i=e?i&&Xr(o):i&&o instanceof la})),!!i&&Mr(n)&&Po(n,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Mr(n){if(n instanceof Cr&&(n.name==="get"&&n.args.length===1||n.name==="feature-state"||n.name==="has"&&n.args.length===1||n.name==="properties"||n.name==="geometry-type"||n.name==="id"||/^filter-/.test(n.name))||n instanceof es||n instanceof ul)return!1;let e=!0;return n.eachChild((i=>{e&&!Mr(i)&&(e=!1)})),e}function Ao(n){if(n instanceof Cr&&n.name==="feature-state")return!1;let e=!0;return n.eachChild((i=>{e&&!Ao(i)&&(e=!1)})),e}function Po(n,e){if(n instanceof Cr&&e.indexOf(n.name)>=0)return!1;let i=!0;return n.eachChild((o=>{i&&!Po(o,e)&&(i=!1)})),i}function Ws(n){return{result:"success",value:n}}function zo(n){return{result:"error",value:n}}function Yr(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function cl(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function hl(n){return!!n.expression&&n.expression.interpolated}function gi(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function Xu(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&Ti(n)===gs}function fa(n){return n}function uu(n,e){const i=n.stops&&typeof n.stops[0][0]=="object",o=i||!(i||n.property!==void 0),h=n.type||(hl(e)?"exponential":"interval"),p=(function(k){switch(k.type){case"color":return mi.parse;case"padding":return Qt.parse;case"numberArray":return Ni.parse;case"colorArray":return jt.parse;default:return null}})(e);if(p&&((n=kn({},n)).stops&&(n.stops=n.stops.map((k=>[k[0],p(k[1])]))),n.default=p(n.default?n.default:e.default)),n.colorSpace&&(m=n.colorSpace)!=="rgb"&&m!=="hcl"&&m!=="lab")throw new Error(`Unknown color space: "${n.colorSpace}"`);var m;const x=(function(k){switch(k){case"exponential":return Lo;case"interval":return cu;case"categorical":return Ec;case"identity":return Yu;default:throw new Error(`Unknown function type "${k}"`)}})(h);let w,A;if(h==="categorical"){w=Object.create(null);for(const k of n.stops)w[k[0]]=k[1];A=typeof n.stops[0][0]}if(i){const k={},F=[];for(let W=0;W<n.stops.length;W++){const K=n.stops[W],J=K[0].zoom;k[J]===void 0&&(k[J]={zoom:J,type:n.type,property:n.property,default:n.default,stops:[]},F.push(J)),k[J].stops.push([K[0].value,K[1]])}const Z=[];for(const W of F)Z.push([k[W].zoom,uu(k[W],e)]);const G={name:"linear"};return{kind:"composite",interpolationType:G,interpolationFactor:Zn.interpolationFactor.bind(void 0,G),zoomStops:Z.map((W=>W[0])),evaluate:({zoom:W},K)=>Lo({stops:Z,base:n.base},e,W).evaluate(W,K)}}if(o){const k=h==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:Zn.interpolationFactor.bind(void 0,k),zoomStops:n.stops.map((F=>F[0])),evaluate:({zoom:F})=>x(n,e,F,w,A)}}return{kind:"source",evaluate(k,F){const Z=F&&F.properties?F.properties[n.property]:void 0;return Z===void 0?pa(n.default,e.default):x(n,e,Z,w,A)}}}function pa(n,e,i){return n!==void 0?n:e!==void 0?e:i!==void 0?i:void 0}function Ec(n,e,i,o,h){return pa(typeof i===h?o[i]:void 0,n.default,e.default)}function cu(n,e,i){if(gi(i)!=="number")return pa(n.default,e.default);const o=n.stops.length;if(o===1||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[o-1][0])return n.stops[o-1][1];const h=wo(n.stops.map((p=>p[0])),i);return n.stops[h][1]}function Lo(n,e,i){const o=n.base!==void 0?n.base:1;if(gi(i)!=="number")return pa(n.default,e.default);const h=n.stops.length;if(h===1||i<=n.stops[0][0])return n.stops[0][1];if(i>=n.stops[h-1][0])return n.stops[h-1][1];const p=wo(n.stops.map((k=>k[0])),i),m=(function(k,F,Z,G){const W=G-Z,K=k-Z;return W===0?0:F===1?K/W:(Math.pow(F,K)-1)/(Math.pow(F,W)-1)})(i,o,n.stops[p][0],n.stops[p+1][0]),x=n.stops[p][1],w=n.stops[p+1][1],A=xn[e.type]||fa;return typeof x.evaluate=="function"?{evaluate(...k){const F=x.evaluate.apply(void 0,k),Z=w.evaluate.apply(void 0,k);if(F!==void 0&&Z!==void 0)return A(F,Z,m,n.colorSpace)}}:A(x,w,m,n.colorSpace)}function Yu(n,e,i){switch(e.type){case"color":i=mi.parse(i);break;case"formatted":i=or.fromString(i.toString());break;case"resolvedImage":i=br.fromString(i.toString());break;case"padding":i=Qt.parse(i);break;case"colorArray":i=jt.parse(i);break;case"numberArray":i=Ni.parse(i);break;default:gi(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return pa(i,n.default,e.default)}Cr.register(Fl,{error:[{kind:"error"},[li],(n,[e])=>{throw new Ji(e.evaluate(n))}],typeof:[li,[fi],(n,[e])=>Oi(Ti(e.evaluate(n)))],"to-rgba":[zr(bt,4),[na],(n,[e])=>{const[i,o,h,p]=e.evaluate(n).rgb;return[255*i,255*o,255*h,p]}],rgb:[na,[bt,bt,bt],Mc],rgba:[na,[bt,bt,bt,bt],Mc],has:{type:hi,overloads:[[[li],(n,[e])=>Ys(e.evaluate(n),n.properties())],[[li,gs],(n,[e,i])=>Ys(e.evaluate(n),i.evaluate(n))]]},get:{type:fi,overloads:[[[li],(n,[e])=>da(e.evaluate(n),n.properties())],[[li,gs],(n,[e,i])=>da(e.evaluate(n),i.evaluate(n))]]},"feature-state":[fi,[li],(n,[e])=>da(e.evaluate(n),n.featureState||{})],properties:[gs,[],n=>n.properties()],"geometry-type":[li,[],n=>n.geometryType()],id:[fi,[],n=>n.id()],zoom:[bt,[],n=>n.globals.zoom],"heatmap-density":[bt,[],n=>n.globals.heatmapDensity||0],elevation:[bt,[],n=>n.globals.elevation||0],"line-progress":[bt,[],n=>n.globals.lineProgress||0],accumulated:[fi,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[bt,ns(bt),(n,e)=>{let i=0;for(const o of e)i+=o.evaluate(n);return i}],"*":[bt,ns(bt),(n,e)=>{let i=1;for(const o of e)i*=o.evaluate(n);return i}],"-":{type:bt,overloads:[[[bt,bt],(n,[e,i])=>e.evaluate(n)-i.evaluate(n)],[[bt],(n,[e])=>-e.evaluate(n)]]},"/":[bt,[bt,bt],(n,[e,i])=>e.evaluate(n)/i.evaluate(n)],"%":[bt,[bt,bt],(n,[e,i])=>e.evaluate(n)%i.evaluate(n)],ln2:[bt,[],()=>Math.LN2],pi:[bt,[],()=>Math.PI],e:[bt,[],()=>Math.E],"^":[bt,[bt,bt],(n,[e,i])=>Math.pow(e.evaluate(n),i.evaluate(n))],sqrt:[bt,[bt],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[bt,[bt],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[bt,[bt],(n,[e])=>Math.log(e.evaluate(n))],log2:[bt,[bt],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[bt,[bt],(n,[e])=>Math.sin(e.evaluate(n))],cos:[bt,[bt],(n,[e])=>Math.cos(e.evaluate(n))],tan:[bt,[bt],(n,[e])=>Math.tan(e.evaluate(n))],asin:[bt,[bt],(n,[e])=>Math.asin(e.evaluate(n))],acos:[bt,[bt],(n,[e])=>Math.acos(e.evaluate(n))],atan:[bt,[bt],(n,[e])=>Math.atan(e.evaluate(n))],min:[bt,ns(bt),(n,e)=>Math.min(...e.map((i=>i.evaluate(n))))],max:[bt,ns(bt),(n,e)=>Math.max(...e.map((i=>i.evaluate(n))))],abs:[bt,[bt],(n,[e])=>Math.abs(e.evaluate(n))],round:[bt,[bt],(n,[e])=>{const i=e.evaluate(n);return i<0?-Math.round(-i):Math.round(i)}],floor:[bt,[bt],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[bt,[bt],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[hi,[li,fi],(n,[e,i])=>n.properties()[e.value]===i.value],"filter-id-==":[hi,[fi],(n,[e])=>n.id()===e.value],"filter-type-==":[hi,[li],(n,[e])=>n.geometryType()===e.value],"filter-<":[hi,[li,fi],(n,[e,i])=>{const o=n.properties()[e.value],h=i.value;return typeof o==typeof h&&o<h}],"filter-id-<":[hi,[fi],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[hi,[li,fi],(n,[e,i])=>{const o=n.properties()[e.value],h=i.value;return typeof o==typeof h&&o>h}],"filter-id->":[hi,[fi],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[hi,[li,fi],(n,[e,i])=>{const o=n.properties()[e.value],h=i.value;return typeof o==typeof h&&o<=h}],"filter-id-<=":[hi,[fi],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[hi,[li,fi],(n,[e,i])=>{const o=n.properties()[e.value],h=i.value;return typeof o==typeof h&&o>=h}],"filter-id->=":[hi,[fi],(n,[e])=>{const i=n.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[hi,[fi],(n,[e])=>e.value in n.properties()],"filter-has-id":[hi,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[hi,[zr(li)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[hi,[zr(fi)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[hi,[li,zr(fi)],(n,[e,i])=>i.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[hi,[li,zr(fi)],(n,[e,i])=>(function(o,h,p,m){for(;p<=m;){const x=p+m>>1;if(h[x]===o)return!0;h[x]>o?m=x-1:p=x+1}return!1})(n.properties()[e.value],i.value,0,i.value.length-1)],all:{type:hi,overloads:[[[hi,hi],(n,[e,i])=>e.evaluate(n)&&i.evaluate(n)],[ns(hi),(n,e)=>{for(const i of e)if(!i.evaluate(n))return!1;return!0}]]},any:{type:hi,overloads:[[[hi,hi],(n,[e,i])=>e.evaluate(n)||i.evaluate(n)],[ns(hi),(n,e)=>{for(const i of e)if(i.evaluate(n))return!0;return!1}]]},"!":[hi,[hi],(n,[e])=>!e.evaluate(n)],"is-supported-script":[hi,[li],(n,[e])=>{const i=n.globals&&n.globals.isSupportedScript;return!i||i(e.evaluate(n))}],upcase:[li,[li],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[li,[li],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[li,ns(fi),(n,e)=>e.map((i=>oa(i.evaluate(n)))).join("")],"resolved-locale":[li,[Xo],(n,[e])=>e.evaluate(n).resolvedLocale()]});class hu{constructor(e,i,o){this.expression=e,this._warningHistory={},this._evaluator=new bo,this._defaultValue=i?(function(h){if(h.type==="color"&&Xu(h.default))return new mi(0,0,0,0);switch(h.type){case"color":return mi.parse(h.default)||null;case"padding":return Qt.parse(h.default)||null;case"numberArray":return Ni.parse(h.default)||null;case"colorArray":return jt.parse(h.default)||null;case"variableAnchorOffsetCollection":return wn.parse(h.default)||null;case"projectionDefinition":return Tn.parse(h.default)||null;default:return h.default===void 0?null:h.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=o}evaluateWithoutErrorHandling(e,i,o,h,p,m){return this._globalState&&(e=je(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=o,this._evaluator.canonical=h,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=m,this.expression.evaluate(this._evaluator)}evaluate(e,i,o,h,p,m){this._globalState&&(e=je(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=o||null,this._evaluator.canonical=h,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=m||null;try{const x=this.expression.evaluate(this._evaluator);if(x==null||typeof x=="number"&&x!=x)return this._defaultValue;if(this._enumValues&&!(x in this._enumValues))throw new Ji(`Expected value to be one of ${Object.keys(this._enumValues).map((w=>JSON.stringify(w))).join(", ")}, but found ${JSON.stringify(x)} instead.`);return x}catch(x){return this._warningHistory[x.message]||(this._warningHistory[x.message]=!0,typeof console<"u"&&console.warn(x.message)),this._defaultValue}}}function Do(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in Fl}function l(n,e,i){const o=new Ci(Fl,Xr,[],e?(function(p){const m={color:na,string:li,number:bt,enum:li,boolean:hi,formatted:$a,padding:Us,numberArray:_s,colorArray:Ca,projectionDefinition:Nu,resolvedImage:Rn,variableAnchorOffsetCollection:Pl};return p.type==="array"?zr(m[p.value]||fi,p.length):m[p.type]})(e):void 0),h=o.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return h?Ws(new hu(h,e,i)):zo(o.errors)}class _{constructor(e,i,o){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Ao(i.expression),this.globalStateRefs=Ee(i.expression),this._globalState=o}evaluateWithoutErrorHandling(e,i,o,h,p,m){return this._globalState&&(e=je(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,o,h,p,m)}evaluate(e,i,o,h,p,m){return this._globalState&&(e=je(e,this._globalState)),this._styleExpression.evaluate(e,i,o,h,p,m)}}class S{constructor(e,i,o,h,p){this.kind=e,this.zoomStops=o,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Ao(i.expression),this.globalStateRefs=Ee(i.expression),this.interpolationType=h,this._globalState=p}evaluateWithoutErrorHandling(e,i,o,h,p,m){return this._globalState&&(e=je(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,o,h,p,m)}evaluate(e,i,o,h,p,m){return this._globalState&&(e=je(e,this._globalState)),this._styleExpression.evaluate(e,i,o,h,p,m)}interpolationFactor(e,i,o){return this.interpolationType?Zn.interpolationFactor(this.interpolationType,e,i,o):0}}function B(n,e,i){const o=l(n,e,i);if(o.result==="error")return o;const h=o.value.expression,p=Mr(h);if(!p&&!Yr(e))return zo([new Pr("","data expressions not supported")]);const m=Po(h,["zoom"]);if(!m&&!cl(e))return zo([new Pr("","zoom expressions not supported")]);const x=oe(h);return x||m?x instanceof Pr?zo([x]):x instanceof Zn&&!hl(e)?zo([new Pr("",'"interpolate" expressions cannot be used with this property')]):Ws(x?new S(p?"camera":"composite",o.value,x.labels,x instanceof Zn?x.interpolation:void 0,i):new _(p?"constant":"source",o.value,i)):zo([new Pr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ${constructor(e,i){this._parameters=e,this._specification=i,kn(this,uu(this._parameters,this._specification))}static deserialize(e){return new $(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function oe(n){let e=null;if(n instanceof en)e=oe(n.result);else if(n instanceof Gs){for(const i of n.args)if(e=oe(i),e)break}else(n instanceof To||n instanceof Zn)&&n.input instanceof Cr&&n.input.name==="zoom"&&(e=n);return e instanceof Pr||n.eachChild((i=>{const o=oe(i);o instanceof Pr?e=o:!e&&o?e=new Pr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Pr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Ee(n,e=new Set){return n instanceof Nl&&e.add(n.key),n.eachChild((i=>{Ee(i,e)})),e}function je(n,e){const{zoom:i,heatmapDensity:o,elevation:h,lineProgress:p,isSupportedScript:m,accumulated:x}=n??{};return{zoom:i,heatmapDensity:o,elevation:h,lineProgress:p,isSupportedScript:m,accumulated:x,globalState:e}}function tt(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!tt(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const vt={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Rt(n,e){if(n==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};tt(n)||(n=Xn(n));const i=l(n,vt,e);if(i.result==="error")throw new Error(i.value.map((o=>`${o.key}: ${o.message}`)).join(", "));return{filter:(o,h,p)=>i.value.evaluate(o,h,{},p),needGeometry:Mi(n),getGlobalStateRefs:()=>Ee(i.value.expression)}}function ni(n,e){return n<e?-1:n>e?1:0}function Mi(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e<n.length;e++)if(Mi(n[e]))return!0;return!1}function Xn(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?Nn(n[1],n[2],"=="):e==="!="?ji(Nn(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Nn(n[1],n[2],e):e==="any"?(i=n.slice(1),["any"].concat(i.map(Xn))):e==="all"?["all"].concat(n.slice(1).map(Xn)):e==="none"?["all"].concat(n.slice(1).map(Xn).map(ji)):e==="in"?ma(n[1],n.slice(2)):e==="!in"?ji(ma(n[1],n.slice(2))):e==="has"?Ki(n[1]):e!=="!has"||ji(Ki(n[1]));var i}function Nn(n,e,i){switch(n){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,n,e]}}function ma(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",n,["literal",e.sort(ni)]]:["filter-in-small",n,["literal",e]]}}function Ki(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function ji(n){return["!",n]}function Ii(n){const e=typeof n;if(e==="number"||e==="boolean"||e==="string"||n==null)return JSON.stringify(n);if(Array.isArray(n)){let h="[";for(const p of n)h+=`${Ii(p)},`;return`${h}]`}const i=Object.keys(n).sort();let o="{";for(let h=0;h<i.length;h++)o+=`${JSON.stringify(i[h])}:${Ii(n[i[h]])},`;return`${o}}`}function Ks(n){let e="";for(const i of oi)e+=`/${Ii(n[i])}`;return e}function Aa(n){const e=n.value;return e?[new Ve(n.key,e,"constants have been deprecated as of v8")]:[]}function Sn(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function ga(n){if(Array.isArray(n))return n.map(ga);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const i in n)e[i]=ga(n[i]);return e}return Sn(n)}function Wr(n){const e=n.key,i=n.value,o=n.valueSpec||{},h=n.objectElementValidators||{},p=n.style,m=n.styleSpec,x=n.validateSpec;let w=[];const A=gi(i);if(A!=="object")return[new Ve(e,i,`object expected, ${A} found`)];for(const k in i){const F=k.split(".")[0],Z=vs(o,F)||o["*"];let G;if(vs(h,F))G=h[F];else if(vs(o,F)){if(i[k]===void 0)continue;G=x}else if(h["*"])G=h["*"];else{if(!o["*"]){w.push(new Ve(e,i[k],`unknown property "${k}"`));continue}G=x}w=w.concat(G({key:(e&&`${e}.`)+k,value:i[k],valueSpec:Z,style:p,styleSpec:m,object:i,objectKey:k,validateSpec:x},i))}for(const k in o)h[k]||o[k].required&&o[k].default===void 0&&i[k]===void 0&&w.push(new Ve(e,i,`missing required property "${k}"`));return w}function zn(n){const e=n.value,i=n.valueSpec,o=n.style,h=n.styleSpec,p=n.key,m=n.arrayElementValidator||n.validateSpec;if(gi(e)!=="array")return[new Ve(p,e,`array expected, ${gi(e)} found`)];if(i.length&&e.length!==i.length)return[new Ve(p,e,`array length ${i.length} expected, length ${e.length} found`)];let x={type:i.value,values:i.values};h.$version<7&&(x.function=i.function),gi(i.value)==="object"&&(x=i.value);let w=[];for(let A=0;A<e.length;A++)w=w.concat(m({array:e,arrayIndex:A,value:e[A],valueSpec:x,validateSpec:n.validateSpec,style:o,styleSpec:h,key:`${p}[${A}]`}));return w}function Pa(n){const e=n.key,i=n.value,o=n.valueSpec;let h=gi(i);return h==="number"&&i!=i&&(h="NaN"),h!=="number"?[new Ve(e,i,`number expected, ${h} found`)]:"minimum"in o&&i<o.minimum?[new Ve(e,i,`${i} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&i>o.maximum?[new Ve(e,i,`${i} is greater than the maximum value ${o.maximum}`)]:[]}function Ss(n){const e=n.valueSpec,i=Sn(n.value.type);let o,h,p,m={};const x=i!=="categorical"&&n.value.property===void 0,w=!x,A=gi(n.value.stops)==="array"&&gi(n.value.stops[0])==="array"&&gi(n.value.stops[0][0])==="object",k=Wr({key:n.key,value:n.value,valueSpec:n.styleSpec.function,validateSpec:n.validateSpec,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:function(G){if(i==="identity")return[new Ve(G.key,G.value,'identity function may not have a "stops" property')];let W=[];const K=G.value;return W=W.concat(zn({key:G.key,value:K,valueSpec:G.valueSpec,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,arrayElementValidator:F})),gi(K)==="array"&&K.length===0&&W.push(new Ve(G.key,K,"array must have at least one stop")),W},default:function(G){return G.validateSpec({key:G.key,value:G.value,valueSpec:e,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec})}}});return i==="identity"&&x&&k.push(new Ve(n.key,n.value,'missing required property "property"')),i==="identity"||n.value.stops||k.push(new Ve(n.key,n.value,'missing required property "stops"')),i==="exponential"&&n.valueSpec.expression&&!hl(n.valueSpec)&&k.push(new Ve(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(w&&!Yr(n.valueSpec)?k.push(new Ve(n.key,n.value,"property functions not supported")):x&&!cl(n.valueSpec)&&k.push(new Ve(n.key,n.value,"zoom functions not supported"))),i!=="categorical"&&!A||n.value.property!==void 0||k.push(new Ve(n.key,n.value,'"property" property is required')),k;function F(G){let W=[];const K=G.value,J=G.key;if(gi(K)!=="array")return[new Ve(J,K,`array expected, ${gi(K)} found`)];if(K.length!==2)return[new Ve(J,K,`array length 2 expected, length ${K.length} found`)];if(A){if(gi(K[0])!=="object")return[new Ve(J,K,`object expected, ${gi(K[0])} found`)];if(K[0].zoom===void 0)return[new Ve(J,K,"object stop key must have zoom")];if(K[0].value===void 0)return[new Ve(J,K,"object stop key must have value")];if(p&&p>Sn(K[0].zoom))return[new Ve(J,K[0].zoom,"stop zoom values must appear in ascending order")];Sn(K[0].zoom)!==p&&(p=Sn(K[0].zoom),h=void 0,m={}),W=W.concat(Wr({key:`${J}[0]`,value:K[0],valueSpec:{zoom:{}},validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,objectElementValidators:{zoom:Pa,value:Z}}))}else W=W.concat(Z({key:`${J}[0]`,value:K[0],validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec},K));return Do(ga(K[1]))?W.concat([new Ve(`${J}[1]`,K[1],"expressions are not allowed in function stops.")]):W.concat(G.validateSpec({key:`${J}[1]`,value:K[1],valueSpec:e,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec}))}function Z(G,W){const K=gi(G.value),J=Sn(G.value),se=G.value!==null?G.value:W;if(o){if(K!==o)return[new Ve(G.key,se,`${K} stop domain type must match previous stop domain type ${o}`)]}else o=K;if(K!=="number"&&K!=="string"&&K!=="boolean")return[new Ve(G.key,se,"stop domain value must be a number, string, or boolean")];if(K!=="number"&&i!=="categorical"){let ge=`number expected, ${K} found`;return Yr(e)&&i===void 0&&(ge+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ve(G.key,se,ge)]}return i!=="categorical"||K!=="number"||isFinite(J)&&Math.floor(J)===J?i!=="categorical"&&K==="number"&&h!==void 0&&J<h?[new Ve(G.key,se,"stop domain values must appear in ascending order")]:(h=J,i==="categorical"&&J in m?[new Ve(G.key,se,"stop domain values must be unique")]:(m[J]=!0,[])):[new Ve(G.key,se,`integer expected, found ${J}`)]}}function Cs(n){const e=(n.expressionContext==="property"?B:l)(ga(n.value),n.valueSpec);if(e.result==="error")return e.value.map((o=>new Ve(`${n.key}${o.key}`,n.value,o.message)));const i=e.value.expression||e.value._styleExpression.expression;if(n.expressionContext==="property"&&n.propertyKey==="text-font"&&!i.outputDefined())return[new Ve(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if(n.expressionContext==="property"&&n.propertyType==="layout"&&!Ao(i))return[new Ve(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if(n.expressionContext==="filter"&&!Ao(i))return[new Ve(n.key,n.value,'"feature-state" data expressions are not supported with filters.')];if(n.expressionContext&&n.expressionContext.indexOf("cluster")===0){if(!Po(i,["zoom","feature-state"]))return[new Ve(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(n.expressionContext==="cluster-initial"&&!Mr(i))return[new Ve(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qs(n){const e=n.key,i=n.value,o=gi(i);return o!=="string"?[new Ve(e,i,`color expected, ${o} found`)]:mi.parse(String(i))?[]:[new Ve(e,i,`color expected, "${i}" found`)]}function rs(n){const e=n.key,i=n.value,o=n.valueSpec,h=[];return Array.isArray(o.values)?o.values.indexOf(Sn(i))===-1&&h.push(new Ve(e,i,`expected one of [${o.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(o.values).indexOf(Sn(i))===-1&&h.push(new Ve(e,i,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(i)} found`)),h}function za(n){return tt(ga(n.value))?Cs(kn({},n,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ms(n)}function Ms(n){const e=n.value,i=n.key;if(gi(e)!=="array")return[new Ve(i,e,`array expected, ${gi(e)} found`)];const o=n.styleSpec;let h,p=[];if(e.length<1)return[new Ve(i,e,"filter array must have at least 1 element")];switch(p=p.concat(rs({key:`${i}[0]`,value:e[0],valueSpec:o.filter_operator,style:n.style,styleSpec:n.styleSpec})),Sn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Sn(e[1])==="$type"&&p.push(new Ve(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&p.push(new Ve(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(h=gi(e[1]),h!=="string"&&p.push(new Ve(`${i}[1]`,e[1],`string expected, ${h} found`)));for(let m=2;m<e.length;m++)h=gi(e[m]),Sn(e[1])==="$type"?p=p.concat(rs({key:`${i}[${m}]`,value:e[m],valueSpec:o.geometry_type,style:n.style,styleSpec:n.styleSpec})):h!=="string"&&h!=="number"&&h!=="boolean"&&p.push(new Ve(`${i}[${m}]`,e[m],`string, number, or boolean expected, ${h} found`));break;case"any":case"all":case"none":for(let m=1;m<e.length;m++)p=p.concat(Ms({key:`${i}[${m}]`,value:e[m],style:n.style,styleSpec:n.styleSpec}));break;case"has":case"!has":h=gi(e[1]),e.length!==2?p.push(new Ve(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):h!=="string"&&p.push(new Ve(`${i}[1]`,e[1],`string expected, ${h} found`))}return p}function dl(n,e){const i=n.key,o=n.validateSpec,h=n.style,p=n.styleSpec,m=n.value,x=n.objectKey,w=p[`${e}_${n.layerType}`];if(!w)return[];const A=x.match(/^(.*)-transition$/);if(e==="paint"&&A&&w[A[1]]&&w[A[1]].transition)return o({key:i,value:m,valueSpec:p.transition,style:h,styleSpec:p});const k=n.valueSpec||w[x];if(!k)return[new Ve(i,m,`unknown property "${x}"`)];let F;if(gi(m)==="string"&&Yr(k)&&!k.tokens&&(F=/^{([^}]+)}$/.exec(m)))return[new Ve(i,m,`"${x}" does not support interpolation syntax
23Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(F[1])} }\`.`)];const Z=[];return n.layerType==="symbol"&&x==="text-font"&&Xu(ga(m))&&Sn(m.type)==="identity"&&Z.push(new Ve(i,m,'"text-font" does not support identity functions')),Z.concat(o({key:n.key,value:m,valueSpec:k,style:h,styleSpec:p,expressionContext:"property",propertyType:e,propertyKey:x}))}function Io(n){return dl(n,"paint")}function ch(n){return dl(n,"layout")}function hh(n){let e=[];const i=n.value,o=n.key,h=n.style,p=n.styleSpec;if(gi(i)!=="object")return[new Ve(o,i,`object expected, ${gi(i)} found`)];i.type||i.ref||e.push(new Ve(o,i,'either "type" or "ref" is required'));let m=Sn(i.type);const x=Sn(i.ref);if(i.id){const w=Sn(i.id);for(let A=0;A<n.arrayIndex;A++){const k=h.layers[A];Sn(k.id)===w&&e.push(new Ve(o,i.id,`duplicate layer id "${i.id}", previously used at line ${k.id.__line__}`))}}if("ref"in i){let w;["type","source","source-layer","filter","layout"].forEach((A=>{A in i&&e.push(new Ve(o,i[A],`"${A}" is prohibited for ref layers`))})),h.layers.forEach((A=>{Sn(A.id)===x&&(w=A)})),w?w.ref?e.push(new Ve(o,i.ref,"ref cannot reference another ref layer")):m=Sn(w.type):e.push(new Ve(o,i.ref,`ref layer "${x}" not found`))}else if(m!=="background")if(i.source){const w=h.sources&&h.sources[i.source],A=w&&Sn(w.type);w?A==="vector"&&m==="raster"?e.push(new Ve(o,i.source,`layer "${i.id}" requires a raster source`)):A!=="raster-dem"&&m==="hillshade"||A!=="raster-dem"&&m==="color-relief"?e.push(new Ve(o,i.source,`layer "${i.id}" requires a raster-dem source`)):A==="raster"&&m!=="raster"?e.push(new Ve(o,i.source,`layer "${i.id}" requires a vector source`)):A!=="vector"||i["source-layer"]?A==="raster-dem"&&m!=="hillshade"&&m!=="color-relief"?e.push(new Ve(o,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):m!=="line"||!i.paint||!i.paint["line-gradient"]||A==="geojson"&&w.lineMetrics||e.push(new Ve(o,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ve(o,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Ve(o,i.source,`source "${i.source}" not found`))}else e.push(new Ve(o,i,'missing required property "source"'));return e=e.concat(Wr({key:o,value:i,valueSpec:p.layer,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,objectElementValidators:{"*":()=>[],type:()=>n.validateSpec({key:`${o}.type`,value:i.type,valueSpec:p.layer.type,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,object:i,objectKey:"type"}),filter:za,layout:w=>Wr({layer:i,key:w.key,value:w.value,style:w.style,styleSpec:w.styleSpec,validateSpec:w.validateSpec,objectElementValidators:{"*":A=>ch(kn({layerType:m},A))}}),paint:w=>Wr({layer:i,key:w.key,value:w.value,style:w.style,styleSpec:w.styleSpec,validateSpec:w.validateSpec,objectElementValidators:{"*":A=>Io(kn({layerType:m},A))}})}})),e}function as(n){const e=n.value,i=n.key,o=gi(e);return o!=="string"?[new Ve(i,e,`string expected, ${o} found`)]:[]}const Wu={promoteId:function({key:n,value:e}){if(gi(e)==="string")return as({key:n,value:e});{const i=[];for(const o in e)i.push(...as({key:`${n}.${o}`,value:e[o]}));return i}}};function fl(n){const e=n.value,i=n.key,o=n.styleSpec,h=n.style,p=n.validateSpec;if(!e.type)return[new Ve(i,e,'"type" is required')];const m=Sn(e.type);let x;switch(m){case"vector":case"raster":return x=Wr({key:i,value:e,valueSpec:o[`source_${m.replace("-","_")}`],style:n.style,styleSpec:o,objectElementValidators:Wu,validateSpec:p}),x;case"raster-dem":return x=(function(w){var A;const k=(A=w.sourceName)!==null&&A!==void 0?A:"",F=w.value,Z=w.styleSpec,G=Z.source_raster_dem,W=w.style;let K=[];const J=gi(F);if(F===void 0)return K;if(J!=="object")return K.push(new Ve("source_raster_dem",F,`object expected, ${J} found`)),K;const se=Sn(F.encoding)==="custom",ge=["redFactor","greenFactor","blueFactor","baseShift"],le=w.value.encoding?`"${w.value.encoding}"`:"Default";for(const he in F)!se&&ge.includes(he)?K.push(new Ve(he,F[he],`In "${k}": "${he}" is only valid when "encoding" is set to "custom". ${le} encoding found`)):G[he]?K=K.concat(w.validateSpec({key:he,value:F[he],valueSpec:G[he],validateSpec:w.validateSpec,style:W,styleSpec:Z})):K.push(new Ve(he,F[he],`unknown property "${he}"`));return K})({sourceName:i,value:e,style:n.style,styleSpec:o,validateSpec:p}),x;case"geojson":if(x=Wr({key:i,value:e,valueSpec:o.source_geojson,style:h,styleSpec:o,validateSpec:p,objectElementValidators:Wu}),e.cluster)for(const w in e.clusterProperties){const[A,k]=e.clusterProperties[w],F=typeof A=="string"?[A,["accumulated"],["get",w]]:A;x.push(...Cs({key:`${i}.${w}.map`,value:k,expressionContext:"cluster-map"})),x.push(...Cs({key:`${i}.${w}.reduce`,value:F,expressionContext:"cluster-reduce"}))}return x;case"video":return Wr({key:i,value:e,valueSpec:o.source_video,style:h,validateSpec:p,styleSpec:o});case"image":return Wr({key:i,value:e,valueSpec:o.source_image,style:h,validateSpec:p,styleSpec:o});case"canvas":return[new Ve(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rs({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ur(n){const e=n.value,i=n.styleSpec,o=i.light,h=n.style;let p=[];const m=gi(e);if(e===void 0)return p;if(m!=="object")return p=p.concat([new Ve("light",e,`object expected, ${m} found`)]),p;for(const x in e){const w=x.match(/^(.*)-transition$/);p=p.concat(w&&o[w[1]]&&o[w[1]].transition?n.validateSpec({key:x,value:e[x],valueSpec:i.transition,validateSpec:n.validateSpec,style:h,styleSpec:i}):o[x]?n.validateSpec({key:x,value:e[x],valueSpec:o[x],validateSpec:n.validateSpec,style:h,styleSpec:i}):[new Ve(x,e[x],`unknown property "${x}"`)])}return p}function Ac(n){const e=n.value,i=n.styleSpec,o=i.sky,h=n.style,p=gi(e);if(e===void 0)return[];if(p!=="object")return[new Ve("sky",e,`object expected, ${p} found`)];let m=[];for(const x in e)m=m.concat(o[x]?n.validateSpec({key:x,value:e[x],valueSpec:o[x],style:h,styleSpec:i}):[new Ve(x,e[x],`unknown property "${x}"`)]);return m}function dh(n){const e=n.value,i=n.styleSpec,o=i.terrain,h=n.style;let p=[];const m=gi(e);if(e===void 0)return p;if(m!=="object")return p=p.concat([new Ve("terrain",e,`object expected, ${m} found`)]),p;for(const x in e)p=p.concat(o[x]?n.validateSpec({key:x,value:e[x],valueSpec:o[x],validateSpec:n.validateSpec,style:h,styleSpec:i}):[new Ve(x,e[x],`unknown property "${x}"`)]);return p}function Xh(n){let e=[];const i=n.value,o=n.key;if(Array.isArray(i)){const h=[],p=[];for(const m in i)i[m].id&&h.includes(i[m].id)&&e.push(new Ve(o,i,`all the sprites' ids must be unique, but ${i[m].id} is duplicated`)),h.push(i[m].id),i[m].url&&p.includes(i[m].url)&&e.push(new Ve(o,i,`all the sprites' URLs must be unique, but ${i[m].url} is duplicated`)),p.push(i[m].url),e=e.concat(Wr({key:`${o}[${m}]`,value:i[m],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:n.validateSpec}));return e}return as({key:o,value:i})}function Gd(n){return!!n&&n.constructor===Object}function Yh(n){return Gd(n.value)?[]:[new Ve(n.key,n.value,`object expected, ${gi(n.value)} found`)]}const nr={"*":()=>[],array:zn,boolean:function(n){const e=n.value,i=n.key,o=gi(e);return o!=="boolean"?[new Ve(i,e,`boolean expected, ${o} found`)]:[]},number:Pa,color:Qs,constants:Aa,enum:rs,filter:za,function:Ss,layer:hh,object:Wr,source:fl,light:ur,sky:Ac,terrain:dh,projection:function(n){const e=n.value,i=n.styleSpec,o=i.projection,h=n.style,p=gi(e);if(e===void 0)return[];if(p!=="object")return[new Ve("projection",e,`object expected, ${p} found`)];let m=[];for(const x in e)m=m.concat(o[x]?n.validateSpec({key:x,value:e[x],valueSpec:o[x],style:h,styleSpec:i}):[new Ve(x,e[x],`unknown property "${x}"`)]);return m},projectionDefinition:function(n){const e=n.key;let i=n.value;i=i instanceof String?i.valueOf():i;const o=gi(i);return o!=="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(o)?[]:[new Ve(e,i,`projection expected, invalid type "${o}" found`)]:[new Ve(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:as,formatted:function(n){return as(n).length===0?[]:Cs(n)},resolvedImage:function(n){return as(n).length===0?[]:Cs(n)},padding:function(n){const e=n.key,i=n.value;if(gi(i)==="array"){if(i.length<1||i.length>4)return[new Ve(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];const o={type:"number"};let h=[];for(let p=0;p<i.length;p++)h=h.concat(n.validateSpec({key:`${e}[${p}]`,value:i[p],validateSpec:n.validateSpec,valueSpec:o}));return h}return Pa({key:e,value:i,valueSpec:{}}
23)},numberArray:function(n){const e=n.key,i=n.value;if(gi(i)==="array"){const o={type:"number"};if(i.length<1)return[new Ve(e,i,"array length at least 1 expected, length 0 found")];let h=[];for(let p=0;p<i.length;p++)h=h.concat(n.validateSpec({key:`${e}[${p}]`,value:i[p],validateSpec:n.validateSpec,valueSpec:o}));return h}return Pa({key:e,value:i,valueSpec:{}})},colorArray:function(n){const e=n.key,i=n.value;if(gi(i)==="array"){if(i.length<1)return[new Ve(e,i,"array length at least 1 expected, length 0 found")];let o=[];for(let h=0;h<i.length;h++)o=o.concat(Qs({key:`${e}[${h}]`,value:i[h]}));return o}return Qs({key:e,value:i})},variableAnchorOffsetCollection:function(n){const e=n.key,i=n.value,o=gi(i),h=n.styleSpec;if(o!=="array"||i.length<1||i.length%2!=0)return[new Ve(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let p=[];for(let m=0;m<i.length;m+=2)p=p.concat(rs({key:`${e}[${m}]`,value:i[m],valueSpec:h.layout_symbol["text-anchor"]})),p=p.concat(zn({key:`${e}[${m+1}]`,value:i[m+1],valueSpec:{length:2,value:"number"},validateSpec:n.validateSpec,style:n.style,styleSpec:h}));return p},sprite:Xh,state:Yh,fontFaces:function(n){const e=n.key,i=n.value,o=n.validateSpec,h=n.styleSpec,p=n.style;if(!Gd(i))return[new Ve(e,i,`object expected, ${gi(i)} found`)];const m=[];for(const x in i){const w=i[x],A=gi(w);if(A==="string")m.push(...as({key:`${e}.${x}`,value:w}));else if(A==="array"){const k={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(const[F,Z]of w.entries())m.push(...Wr({key:`${e}.${x}[${F}]`,value:Z,valueSpec:k,styleSpec:h,style:p,validateSpec:o}))}else m.push(new Ve(`${e}.${x}`,w,`string or array expected, ${A} found`))}return m}};function ko(n){const e=n.value,i=n.valueSpec,o=n.styleSpec;return n.validateSpec=ko,i.expression&&Xu(Sn(e))?Ss(n):i.expression&&Do(ga(e))?Cs(n):i.type&&nr[i.type]?nr[i.type](n):Wr(kn({},n,{valueSpec:i.type?o[i.type]:i}))}function Ku(n){const e=n.value,i=n.key,o=as(n);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new Ve(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new Ve(i,e,'"glyphs" url must include a "{range}" token'))),o}function _a(n,e=ke){let i=[];return i=i.concat(ko({key:"",value:n,valueSpec:e.$root,styleSpec:e,style:n,validateSpec:ko,objectElementValidators:{glyphs:Ku,"*":()=>[]}})),n.constants&&(i=i.concat(Aa({key:"constants",value:n.constants}))),du(i)}function ss(n){return function(e){return n(Object.assign({},e,{validateSpec:ko}))}}function du(n){return[].concat(n).sort(((e,i)=>e.line-i.line))}function ya(n){return function(...e){return du(n.apply(this,e))}}_a.source=ya(ss(fl)),_a.sprite=ya(ss(Xh)),_a.glyphs=ya(ss(Ku)),_a.light=ya(ss(ur)),_a.sky=ya(ss(Ac)),_a.terrain=ya(ss(dh)),_a.state=ya(ss(Yh)),_a.layer=ya(ss(hh)),_a.filter=ya(ss(za)),_a.paintProperty=ya(ss(Io)),_a.layoutProperty=ya(ss(ch));const ep={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class Qu{constructor(e,i){this._globalState=i,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!==null&&e!==void 0?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none")return this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);const i=l(e,ep,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(i.value.map((o=>`${o.key}: ${o.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=Ee(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}const Pc=ke,Er=_a,Js=Er.light,fh=Er.sky,ph=Er.paintProperty,qd=Er.layoutProperty;function eo(n,e){let i=!1;if(e&&e.length)for(const o of e)n.fire(new it(new Error(o.message))),i=!0;return i}class jl{constructor(e,i,o){const h=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const m=new Int32Array(this.arrayBuffer);e=m[0],this.d=(i=m[1])+2*(o=m[2]);for(let w=0;w<this.d*this.d;w++){const A=m[3+w],k=m[3+w+1];h.push(A===k?null:m.subarray(A,k))}const x=m[3+h.length+1];this.keys=m.subarray(m[3+h.length],x),this.bboxes=m.subarray(x),this.insert=this._insertReadonly}else{this.d=i+2*o;for(let m=0;m<this.d*this.d;m++)h.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=o,this.scale=i/e,this.uid=0;const p=o/i*e;this.min=-p,this.max=e+p}
vendor: 20,299 bytes, line 23
23insert(e,i,o,h,p){this._forEachCell(i,o,h,p,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(h),this.bboxes.push(p)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,o,h,p,m){this.cells[p].push(m)}query(e,i,o,h,p){const m=this.min,x=this.max;if(e<=m&&i<=m&&x<=o&&x<=h&&!p)return Array.prototype.slice.call(this.keys);{const w=[];return this._forEachCell(e,i,o,h,this._queryCell,w,{},p),w}}_queryCell(e,i,o,h,p,m,x,w){const A=this.cells[p];if(A!==null){const k=this.keys,F=this.bboxes;for(let Z=0;Z<A.length;Z++){const G=A[Z];if(x[G]===void 0){const W=4*G;(w?w(F[W+0],F[W+1],F[W+2],F[W+3]):e<=F[W+2]&&i<=F[W+3]&&o>=F[W+0]&&h>=F[W+1])?(x[G]=!0,m.push(k[G])):x[G]=!1}}}}_forEachCell(e,i,o,h,p,m,x,w){const A=this._convertToCellCoord(e),k=this._convertToCellCoord(i),F=this._convertToCellCoord(o),Z=this._convertToCellCoord(h);for(let G=A;G<=F;G++)for(let W=k;W<=Z;W++){const K=this.d*W+G;if((!w||w(this._convertFromCellCoord(G),this._convertFromCellCoord(W),this._convertFromCellCoord(G+1),this._convertFromCellCoord(W+1)))&&p.call(this,e,i,o,h,K,m,x,w))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,i=3+this.cells.length+1+1;let o=0;for(let m=0;m<this.cells.length;m++)o+=this.cells[m].length;const h=new Int32Array(i+o+this.keys.length+this.bboxes.length);h[0]=this.extent,h[1]=this.n,h[2]=this.padding;let p=i;for(let m=0;m<e.length;m++){const x=e[m];h[3+m]=p,h.set(x,p),p+=x.length}return h[3+e.length]=p,h.set(this.keys,p),p+=this.keys.length,h[3+e.length+1]=p,h.set(this.bboxes,p),p+=this.bboxes.length,h.buffer}static serialize(e,i){const o=e.toArrayBuffer();return i&&i.push(o),{buffer:o}}static deserialize(e){return new jl(e.buffer)}}const Oa={};function Nt(n,e,i={}){if(Oa[n])throw new Error(`${n} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:n,writeable:!1}),Oa[n]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}Nt("Object",Object),Nt("Set",Set),Nt("TransferableGridIndex",jl),Nt("Color",mi),Nt("Error",Error),Nt("AJAXError",be),Nt("ResolvedImage",br),Nt("StylePropertyFunction",$),Nt("StyleExpression",hu,{omit:["_evaluator"]}),Nt("ZoomDependentExpression",S),Nt("ZoomConstantExpression",_),Nt("CompoundExpression",Cr,{omit:["_evaluate"]});for(const n in Fl)Fl[n]._classRegistryKey||Nt(`Expression_${n}`,Fl[n]);function zc(n){return n&&typeof ArrayBuffer<"u"&&(n instanceof ArrayBuffer||n.constructor&&n.constructor.name==="ArrayBuffer")}function mh(n){return n.$name||n.constructor._classRegistryKey}function Es(n){return!(function(e){if(e===null||typeof e!="object")return!1;const i=mh(e);return!(!i||i==="Object")})(n)&&(n==null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||n instanceof Boolean||n instanceof Number||n instanceof String||n instanceof Date||n instanceof RegExp||n instanceof Blob||n instanceof Error||zc(n)||Ta(n)||ArrayBuffer.isView(n)||n instanceof ImageData)}function to(n,e){if(Es(n))return(zc(n)||Ta(n))&&e&&e.push(n),ArrayBuffer.isView(n)&&e&&e.push(n.buffer),n instanceof ImageData&&e&&e.push(n.data.buffer),n;if(Array.isArray(n)){const p=[];for(const m of n)p.push(to(m,e));return p}if(typeof n!="object")throw new Error("can't serialize object of type "+typeof n);const i=mh(n);if(!i)throw new Error(`can't serialize object of unregistered class ${n.constructor.name}`);if(!Oa[i])throw new Error(`${i} is not registered.`);const{klass:o}=Oa[i],h=o.serialize?o.serialize(n,e):{};if(o.serialize){if(e&&h===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const p in n){if(!n.hasOwnProperty(p)||Oa[i].omit.indexOf(p)>=0)continue;const m=n[p];h[p]=Oa[i].shallow.indexOf(p)>=0?m:to(m,e)}n instanceof Error&&(h.message=n.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(h.$name=i),h}function Ju(n){if(Es(n))return n;if(Array.isArray(n))return n.map(Ju);if(typeof n!="object")throw new Error("can't deserialize object of type "+typeof n);const e=mh(n)||"Object";if(!Oa[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:i}=Oa[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(n);const o=Object.create(i.prototype);for(const h of Object.keys(n)){if(h==="$name")continue;const p=n[h];o[h]=Oa[e].shallow.indexOf(h)>=0?p:Ju(p)}return o}class gh{constructor(){this.first=!0}update(e,i){const o=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=i),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=o,!0))}}function Ro(n){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(n))}function fu(n){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(n))}function Lc(n){return/\s/u.test(String.fromCodePoint(n))}function Oo(n){for(const e of n)if(fu(e.codePointAt(0)))return!0;return!1}function _h(n){for(const e of n)if(!Wh(e.codePointAt(0)))return!1;return!0}function Dc(n){const e=n.map((i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}})).filter((i=>i));return new RegExp(e.join("|"),"u")}const Bo=Dc(["Arab","Dupl","Mong","Ougr","Syrc"]);function Wh(n){return!Bo.test(String.fromCodePoint(n))}function No(n){return!(fu(n)||(e=n,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))));var e}const yh=Dc(["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 Ic(n){return yh.test(String.fromCodePoint(n))}function Fo(n,e){return!(!e&&Ic(n)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(n)))}function pl(n){for(const e of n)if(Ic(e.codePointAt(0)))return!0;return!1}const As=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(n){this.pluginStatus=n.pluginStatus,this.pluginURL=n.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(n){if(As.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=n.applyArabicShaping,this.processBidirectionalText=n.processBidirectionalText,this.processStyledBidirectionalText=n.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(n,e){return u(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(n.pluginStatus!=="loading")return this.setState(n),n;const i=n.pluginURL,o=new Promise((p=>{this.loadScriptResolve=p}));e(i);const h=new Promise((p=>setTimeout((()=>p()),this.TIMEOUT)));if(yield Promise.race([o,h]),this.isParsed()){const p={pluginStatus:"loaded",pluginURL:i};return this.setState(p),p}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)}))}};class an{constructor(e,i){this.isSupportedScript=Kh,this.zoom=e,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new gh,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new gh,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,i=e-Math.floor(e),o=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*i}}}function Kh(n){return(function(e,i){for(const o of e)if(!Fo(o.codePointAt(0),i))return!1;return!0})(n,As.getRTLTextPluginStatus()==="loaded")}const ml="-transition";class Ul{constructor(e,i,o){this.property=e,this.value=i,this.expression=(function(h,p,m){if(Xu(h))return new $(h,p);if(Do(h)){const x=B(h,p,m);if(x.result==="error")throw new Error(x.value.map((w=>`${w.key}: ${w.message}`)).join(", "));return x.value}{let x=h;return p.type==="color"&&typeof h=="string"?x=mi.parse(h):p.type!=="padding"||typeof h!="number"&&!Array.isArray(h)?p.type!=="numberArray"||typeof h!="number"&&!Array.isArray(h)?p.type!=="colorArray"||typeof h!="string"&&!Array.isArray(h)?p.type==="variableAnchorOffsetCollection"&&Array.isArray(h)?x=wn.parse(h):p.type==="projectionDefinition"&&typeof h=="string"&&(x=Tn.parse(h)):x=jt.parse(h):x=Ni.parse(h):x=Qt.parse(h),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>x}}})(i===void 0?e.specification.default:i,e.specification,o)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,i,o){return this.property.possiblyEvaluate(this,e,i,o)}}class kc{constructor(e,i){this.property=e,this.value=new Ul(e,void 0,i)}transitioned(e,i){return new pu(this.property,this.value,i,wi({},e.transition,this.transition),e.now)}untransitioned(){return new pu(this.property,this.value,null,{},0)}}class vh{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i}getValue(e){return xr(this._values[e].value.value)}setValue(e,i){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new kc(this._values[e].property,this._globalState)),this._values[e].value=new Ul(this._values[e].property,i===null?void 0:xr(i),this._globalState)}getTransition(e){return xr(this._values[e].transition)}setTransition(e,i){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new kc(this._values[e].property,this._globalState)),this._values[e].transition=xr(i)||void 0}serialize(){const e={};for(const i of Object.keys(this._values)){const o=this.getValue(i);o!==void 0&&(e[i]=o);const h=this.getTransition(i);h!==void 0&&(e[`${i}${ml}`]=h)}return e}transitioned(e,i){const o=new Rc(this._properties);for(const h of Object.keys(this._values))o._values[h]=this._values[h].transitioned(e,i._values[h]);return o}untransitioned(){const e=new Rc(this._properties);for(const i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class pu{constructor(e,i,o,h,p){this.property=e,this.value=i,this.begin=p+h.delay||0,this.end=this.begin+h.duration||0,e.specification.transition&&(h.delay||h.duration)&&(this.prior=o)}possiblyEvaluate(e,i,o){const h=e.now||0,p=this.value.possiblyEvaluate(e,i,o),m=this.prior;if(m){if(h>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(h<this.begin)return m.possiblyEvaluate(e,i,o);{const x=(h-this.begin)/(this.end-this.begin);return this.property.interpolate(m.possiblyEvaluate(e,i,o),p,Et(x))}}return p}}class Rc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,o){const h=new mu(this._properties);for(const p of Object.keys(this._values))h._values[p]=this._values[p].possiblyEvaluate(e,i,o);return h}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Qh{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i}hasValue(e){return this._values[e].value!==void 0}getValue(e){return xr(this._values[e].value)}setValue(e,i){this._values[e]=new Ul(this._values[e].property,i===null?void 0:xr(i),this._globalState)}serialize(){const e={};for(const i of Object.keys(this._values)){const o=this.getValue(i);o!==void 0&&(e[i]=o)}return e}possiblyEvaluate(e,i,o){const h=new mu(this._properties);for(const p of Object.keys(this._values))h._values[p]=this._values[p].possiblyEvaluate(e,i,o);return h}}class os{constructor(e,i,o){this.property=e,this.value=i,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,o,h){return this.property.evaluate(this.value,this.parameters,e,i,o,h)}}class mu{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ut{constructor(e){this.specification=e}possiblyEvaluate(e,i){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(i)}interpolate(e,i,o){const h=xn[this.specification.type];return h?h(e,i,o):e}}class $t{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,o,h){return new os(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},o,h)}:e.expression,i)}interpolate(e,i,o){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new os(this,{kind:"constant",value:void 0},e.parameters);const h=xn[this.specification.type];if(h){const p=h(e.value.value,i.value.value,o);return new os(this,{kind:"constant",value:p},e.parameters)}return e}evaluate(e,i,o,h,p,m){return e.kind==="constant"?e.value:e.evaluate(i,o,h,p,m)}}class Ps extends $t{possiblyEvaluate(e,i,o,h){if(e.value===void 0)return new os(this,{kind:"constant",value:void 0},i);if(e.expression.kind==="constant"){const p=e.expression.evaluate(i,null,{},o,h),m=e.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,x=this._calculate(m,m,m,i);return new os(this,{kind:"constant",value:x},i)}if(e.expression.kind==="camera"){const p=this._calculate(e.expression.evaluate({zoom:i.zoom-1}),e.expression.evaluate({zoom:i.zoom}),e.expression.evaluate({zoom:i.zoom+1}),i);return new os(this,{kind:"constant",value:p},i)}return new os(this,e.expression,i)}evaluate(e,i,o,h,p,m){if(e.kind==="source"){const x=e.evaluate(i,o,h,p,m);return this._calculate(x,x,x,i)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(i.zoom)-1},o,h),e.evaluate({zoom:Math.floor(i.zoom)},o,h),e.evaluate({zoom:Math.floor(i.zoom)+1},o,h),i):e.value}_calculate(e,i,o,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:o,to:i}}interpolate(e){return e}}class ec{constructor(e){this.specification=e}possiblyEvaluate(e,i,o,h){if(e.value!==void 0){if(e.expression.kind==="constant"){const p=e.expression.evaluate(i,null,{},o,h);return this._calculate(p,p,p,i)}return this._calculate(e.expression.evaluate(new an(Math.floor(i.zoom-1),i)),e.expression.evaluate(new an(Math.floor(i.zoom),i)),e.expression.evaluate(new an(Math.floor(i.zoom+1),i)),i)}}_calculate(e,i,o,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:o,to:i}}interpolate(e){return e}}class Oc{constructor(e){this.specification=e}possiblyEvaluate(e,i,o,h){return!!e.expression.evaluate(i,null,{},o,h)}interpolate(){return!1}}class rr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const i in e){const o=e[i];o.specification.overridable&&this.overridableProperties.push(i);const h=this.defaultPropertyValues[i]=new Ul(o,void 0,void 0),p=this.defaultTransitionablePropertyValues[i]=new kc(o,void 0);this.defaultTransitioningPropertyValues[i]=p.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=h.possiblyEvaluate({})}}}Nt("DataDrivenProperty",$t),Nt("DataConstantProperty",Ut),Nt("CrossFadedDataDrivenProperty",Ps),Nt("CrossFadedProperty",ec),Nt("ColorRampProperty",Oc);class Gn extends yt{constructor(e,i,o){if(super(),this.id=e.id,this.type=e.type,this._globalState=o,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(h,p){return new Qu(h,p)})(this.visibility,o),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Rt(e.filter,o)),i.layout&&(this._unevaluatedLayout=new Qh(i.layout,o)),i.paint)){this._transitionablePaint=new vh(i.paint,o);for(const h in e.paint)this.setPaintProperty(h,e.paint[h],{validate:!1});for(const h in e.layout)this.setLayoutProperty(h,e.layout[h],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new mu(i.paint)}}setFilter(e){this.filter=e,this._featureFilter=Rt(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){const e=new Set;for(const i of this._visibilityExpression.getGlobalStateRefs())e.add(i);if(this._unevaluatedLayout)for(const i in this._unevaluatedLayout._values){const o=this._unevaluatedLayout._values[i];for(const h of o.getGlobalStateRefs())e.add(h)}for(const i of this._featureFilter.getGlobalStateRefs())e.add(i);return e}getPaintAffectingGlobalStateRefs(){var e;const i=new globalThis.Map;if(this._transitionablePaint)for(const o in this._transitionablePaint._values){const h=this._transitionablePaint._values[o].value;for(const p of h.getGlobalStateRefs()){const m=(e=i.get(p))!==null&&e!==void 0?e:[];m.push({name:o,value:h.value}),i.set(p,m)}}return i}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,i,o={}
23){if(i==null||!this._validate(qd,`layers.${this.id}.layout.${e}`,e,i,o))return e==="visibility"?(this.visibility=i,this._visibilityExpression.setValue(i),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(e,i)}getPaintProperty(e){return e.endsWith(ml)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,o={}){if(i!=null&&this._validate(ph,`layers.${this.id}.paint.${e}`,e,i,o))return!1;if(e.endsWith(ml))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{const h=this._transitionablePaint._values[e],p=h.property.specification["property-type"]==="cross-faded-data-driven",m=h.value.isDataDriven(),x=h.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);const w=this._transitionablePaint._values[e].value;return w.isDataDriven()||m||p||this._handleOverridablePaintPropertyUpdate(e,x,w)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,i,o){return!1}isHidden(e=this.minzoom,i=!1){return!!(this.minzoom&&e<(i?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&e>=this.maxzoom)||this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,i){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}
vendor: 5,455 bytes, line 23
23serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Ur(e,((i,o)=>!(i===void 0||o==="layout"&&!Object.keys(i).length||o==="paint"&&!Object.keys(i).length)))}_validate(e,i,o,h,p={}){return(!p||p.validate!==!1)&&eo(this,e.call(Er,{key:i,layerType:this.type,objectKey:o,value:h,styleSpec:ke,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const i=this.paint.get(e);if(i instanceof os&&Yr(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let Yn;var Bc={get paint(){return Yn=Yn||new rr({"raster-opacity":new Ut(ke.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ut(ke.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ut(ke.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ut(ke.paint_raster["raster-brightness-max"]),"raster-saturation":new Ut(ke.paint_raster["raster-saturation"]),"raster-contrast":new Ut(ke.paint_raster["raster-contrast"]),"raster-resampling":new Ut(ke.paint_raster["raster-resampling"]),"raster-fade-duration":new Ut(ke.paint_raster["raster-fade-duration"])})}};class gl extends Gn{constructor(e,i){super(e,Bc,i)}}const Ei={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class tn{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Si{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,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 Fn(n,e=1){let i=0,o=0;return{members:n.map((h=>{const p=Ei[h.type].BYTES_PER_ELEMENT,m=i=zs(i,Math.max(e,p)),x=h.components||1;return o=Math.max(o,p),i+=p*x,{name:h.name,type:h.type,components:x,offset:m}})),size:zs(i,Math.max(o,e)),alignment:e}}function zs(n,e){return Math.ceil(n/e)*e}class io extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){const h=2*e;return this.int16[h+0]=i,this.int16[h+1]=o,e}}io.prototype.bytesPerElement=4,Nt("StructArrayLayout2i4",io);class gu extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o)}emplace(e,i,o,h){const p=3*e;return this.int16[p+0]=i,this.int16[p+1]=o,this.int16[p+2]=h,e}}gu.prototype.bytesPerElement=6,Nt("StructArrayLayout3i6",gu);class _u extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,h)}emplace(e,i,o,h,p){const m=4*e;return this.int16[m+0]=i,this.int16[m+1]=o,this.int16[m+2]=h,this.int16[m+3]=p,e}}_u.prototype.bytesPerElement=8,Nt("StructArrayLayout4i8",_u);class _l extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m){const x=this.length;return this.resize(x+1),this.emplace(x,e,i,o,h,p,m)}emplace(e,i,o,h,p,m,x){const w=6*e;return this.int16[w+0]=i,this.int16[w+1]=o,this.int16[w+2]=h,this.int16[w+3]=p,this.int16[w+4]=m,this.int16[w+5]=x,e}}_l.prototype.bytesPerElement=12,Nt("StructArrayLayout2i4i12",_l);class Jh extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m){const x=this.length;return this.resize(x+1),this.emplace(x,e,i,o,h,p,m)}emplace(e,i,o,h,p,m,x){const w=4*e,A=8*e;return this.int16[w+0]=i,this.int16[w+1]=o,this.uint8[A+4]=h,this.uint8[A+5]=p,this.uint8[A+6]=m,this.uint8[A+7]=x,e}}Jh.prototype.bytesPerElement=8,Nt("StructArrayLayout2i4ub8",Jh);class Ln extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){const h=2*e;return this.float32[h+0]=i,this.float32[h+1]=o,e}}Ln.prototype.bytesPerElement=8,Nt("StructArrayLayout2f8",Ln);
vendor: 9,713 bytes, line 23
23class no extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m,x,w,A,k){const F=this.length;return this.resize(F+1),this.emplace(F,e,i,o,h,p,m,x,w,A,k)}emplace(e,i,o,h,p,m,x,w,A,k,F){const Z=10*e;return this.uint16[Z+0]=i,this.uint16[Z+1]=o,this.uint16[Z+2]=h,this.uint16[Z+3]=p,this.uint16[Z+4]=m,this.uint16[Z+5]=x,this.uint16[Z+6]=w,this.uint16[Z+7]=A,this.uint16[Z+8]=k,this.uint16[Z+9]=F,e}}no.prototype.bytesPerElement=20,Nt("StructArrayLayout10ui20",no);class tc extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m,x,w){const A=this.length;return this.resize(A+1),this.emplace(A,e,i,o,h,p,m,x,w)}emplace(e,i,o,h,p,m,x,w,A){const k=8*e;return this.uint16[k+0]=i,this.uint16[k+1]=o,this.uint16[k+2]=h,this.uint16[k+3]=p,this.uint16[k+4]=m,this.uint16[k+5]=x,this.uint16[k+6]=w,this.uint16[k+7]=A,e}}tc.prototype.bytesPerElement=16,Nt("StructArrayLayout8ui16",tc);class ic extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m,x,w,A,k,F,Z){const G=this.length;return this.resize(G+1),this.emplace(G,e,i,o,h,p,m,x,w,A,k,F,Z)}emplace(e,i,o,h,p,m,x,w,A,k,F,Z,G){const W=12*e;return this.int16[W+0]=i,this.int16[W+1]=o,this.int16[W+2]=h,this.int16[W+3]=p,this.uint16[W+4]=m,this.uint16[W+5]=x,this.uint16[W+6]=w,this.uint16[W+7]=A,this.int16[W+8]=k,this.int16[W+9]=F,this.int16[W+10]=Z,this.int16[W+11]=G,e}}ic.prototype.bytesPerElement=24,Nt("StructArrayLayout4i4ui4i24",ic);class Nc extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o)}emplace(e,i,o,h){const p=3*e;return this.float32[p+0]=i,this.float32[p+1]=o,this.float32[p+2]=h,e}}Nc.prototype.bytesPerElement=12,Nt("StructArrayLayout3f12",Nc);class Fc extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}Fc.prototype.bytesPerElement=4,Nt("StructArrayLayout1ul4",Fc);class jc extends Si{_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(e,i,o,h,p,m,x,w,A){const k=this.length;return this.resize(k+1),this.emplace(k,e,i,o,h,p,m,x,w,A)}emplace(e,i,o,h,p,m,x,w,A,k){const F=10*e,Z=5*e;return this.int16[F+0]=i,this.int16[F+1]=o,this.int16[F+2]=h,this.int16[F+3]=p,this.int16[F+4]=m,this.int16[F+5]=x,this.uint32[Z+3]=w,this.uint16[F+8]=A,this.uint16[F+9]=k,e}}jc.prototype.bytesPerElement=20,Nt("StructArrayLayout6i1ul2ui20",jc);class Vl extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m){const x=this.length;return this.resize(x+1),this.emplace(x,e,i,o,h,p,m)}emplace(e,i,o,h,p,m,x){const w=6*e;return this.int16[w+0]=i,this.int16[w+1]=o,this.int16[w+2]=h,this.int16[w+3]=p,this.int16[w+4]=m,this.int16[w+5]=x,e}}Vl.prototype.bytesPerElement=12,Nt("StructArrayLayout2i2i2i12",Vl);class yl extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p){const m=this.length;return this.resize(m+1),this.emplace(m,e,i,o,h,p)}emplace(e,i,o,h,p,m){const x=4*e,w=8*e;return this.float32[x+0]=i,this.float32[x+1]=o,this.float32[x+2]=h,this.int16[w+6]=p,this.int16[w+7]=m,e}}yl.prototype.bytesPerElement=16,Nt("StructArrayLayout2f1f2i16",yl);class Kr extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,h,p,m){const x=this.length;return this.resize(x+1),this.emplace(x,e,i,o,h,p,m)}emplace(e,i,o,h,p,m,x){const w=16*e,A=4*e,k=8*e;return this.uint8[w+0]=i,this.uint8[w+1]=o,this.float32[A+1]=h,this.float32[A+2]=p,this.int16[k+6]=m,this.int16[k+7]=x,e}}Kr.prototype.bytesPerElement=16,Nt("StructArrayLayout2ub2f2i16",Kr);class jn extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o)}emplace(e,i,o,h){const p=3*e;return this.uint16[p+0]=i,this.uint16[p+1]=o,this.uint16[p+2]=h,e}}jn.prototype.bytesPerElement=6,Nt("StructArrayLayout3ui6",jn);class jo extends Si{_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(e,i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se){const ge=this.length;return this.resize(ge+1),this.emplace(ge,e,i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se)}emplace(e,i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se,ge){const le=24*e,he=12*e,xe=48*e;return this.int16[le+0]=i,this.int16[le+1]=o,this.uint16[le+2]=h,this.uint16[le+3]=p,this.uint32[he+2]=m,this.uint32[he+3]=x,this.uint32[he+4]=w,this.uint16[le+10]=A,this.uint16[le+11]=k,this.uint16[le+12]=F,this.float32[he+7]=Z,this.float32[he+8]=G,this.uint8[xe+36]=W,this.uint8[xe+37]=K,this.uint8[xe+38]=J,this.uint32[he+10]=se,this.int16[le+22]=ge,e}}jo.prototype.bytesPerElement=48,Nt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",jo);class yu extends Si{_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(e,i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se,ge,le,he,xe,Ae,He,ut,st,ft,zt,wt){const at=this.length;return this.resize(at+1),this.emplace(at,e,i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se,ge,le,he,xe,Ae,He,ut,st,ft,zt,wt)}emplace(e,i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se,ge,le,he,xe,Ae,He,ut,st,ft,zt,wt,at){const et=32*e,Ot=16*e;return this.int16[et+0]=i,this.int16[et+1]=o,this.int16[et+2]=h,this.int16[et+3]=p,this.int16[et+4]=m,this.int16[et+5]=x,this.int16[et+6]=w,this.int16[et+7]=A,this.uint16[et+8]=k,this.uint16[et+9]=F,this.uint16[et+10]=Z,this.uint16[et+11]=G,this.uint16[et+12]=W,this.uint16[et+13]=K,this.uint16[et+14]=J,this.uint16[et+15]=se,this.uint16[et+16]=ge,this.uint16[et+17]=le,this.uint16[et+18]=he,this.uint16[et+19]=xe,this.uint16[et+20]=Ae,this.uint16[et+21]=He,this.uint16[et+22]=ut,this.uint32[Ot+12]=st,this.float32[Ot+13]=ft,this.float32[Ot+14]=zt,this.uint16[et+30]=wt,this.uint16[et+31]=at,e}}yu.prototype.bytesPerElement=64,Nt("StructArrayLayout8i15ui1ul2f2ui64",yu);class vu extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}vu.prototype.bytesPerElement=4,Nt("StructArrayLayout1f4",vu);class nc extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o)}emplace(e,i,o,h){const p=3*e;return this.uint16[6*e+0]=i,this.float32[p+1]=o,this.float32[p+2]=h,e}}nc.prototype.bytesPerElement=12,Nt("StructArrayLayout1ui2f12",nc);class ro extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,i,o)}emplace(e,i,o,h){const p=4*e;return this.uint32[2*e+0]=i,this.uint16[p+2]=o,this.uint16[p+3]=h,e}}ro.prototype.bytesPerElement=8,Nt("StructArrayLayout1ul2ui8",ro);class g extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){const h=2*e;return this.uint16[h+0]=i,this.uint16[h+1]=o,e}}g.prototype.bytesPerElement=4,Nt("StructArrayLayout2ui4",g);class t extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}t.prototype.bytesPerElement=2,Nt("StructArrayLayout1ui2",t);class a extends Si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,h)}emplace(e,i,o,h,p){const m=4*e;return this.float32[m+0]=i,this.float32[m+1]=o,this.float32[m+2]=h,this.float32[m+3]=p,e}}a.prototype.bytesPerElement=16,Nt("StructArrayLayout4f16",a);class c extends tn{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: 78,329 bytes, line 23
23get anchorPoint(){return new V(this.anchorPointX,this.anchorPointY)}}c.prototype.size=20;class f extends jc{get(e){return new c(this,e)}}Nt("CollisionBoxArray",f);class v extends tn{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}v.prototype.size=48;class b extends jo{get(e){return new v(this,e)}}Nt("PlacedSymbolArray",b);class C extends tn{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(e){this._structArray.uint32[this._pos4+12]=e}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]}}C.prototype.size=64;class z extends yu{get(e){return new C(this,e)}}Nt("SymbolInstanceArray",z);class O extends vu{getoffsetX(e){return this.float32[1*e+0]}}Nt("GlyphOffsetArray",O);class U extends gu{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Nt("SymbolLineVertexArray",U);class H extends tn{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]}}H.prototype.size=12;class q extends nc{get(e){return new H(this,e)}}Nt("TextAnchorOffsetArray",q);class Q extends tn{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]}}Q.prototype.size=8;class re extends ro{get(e){return new Q(this,e)}}Nt("FeatureIndexArray",re);class de extends io{}class pe extends io{}class fe extends io{}class _e extends _l{}class Me extends Jh{}class me extends Ln{}class Ce extends no{}class Le extends tc{}class we extends ic{}class Re extends Nc{}class Ye extends Fc{}class qe extends Vl{}class $e extends Kr{}class Xe extends jn{}class Mt extends g{}const At=Fn([{name:"a_pos",components:2,type:"Int16"}],4),{members:pt}=At;class Lt{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,o,h){const p=this.segments[this.segments.length-1];return e>Lt.MAX_VERTEX_ARRAY_LENGTH&&En(`Max vertices per segment is ${Lt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Lt.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!p||p.vertexLength+e>Lt.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==h?this.createNewSegment(i,o,h):p}createNewSegment(e,i,o){const h={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return o!==void 0&&(h.sortKey=o),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(h),h}getOrCreateLatestSegment(e,i,o){return this.prepareSegment(0,e,i,o)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const e of this.segments)for(const i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,o,h){return new Lt([{vertexOffset:e,primitiveOffset:i,vertexLength:o,primitiveLength:h,vaos:{},sortKey:0}])}}function _i(n,e){return 256*(n=Ct(Math.floor(n),0,255))+Ct(Math.floor(e),0,255)}Lt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Nt("SegmentVector",Lt);const nn=Fn([{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"}]),bn=Fn([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var pn,Dn,ln,qn={exports:{}},In={exports:{}},Lr={exports:{}},Wn=(function(){if(ln)return qn.exports;ln=1;var n=(pn||(pn=1,In.exports=function(i,o){var h,p,m,x,w,A,k,F;for(p=i.length-(h=3&i.length),m=o,w=3432918353,A=461845907,F=0;F<p;)k=255&i.charCodeAt(F)|(255&i.charCodeAt(++F))<<8|(255&i.charCodeAt(++F))<<16|(255&i.charCodeAt(++F))<<24,++F,m=27492+(65535&(x=5*(65535&(m=(m^=k=(65535&(k=(k=(65535&k)*w+(((k>>>16)*w&65535)<<16)&4294967295)<<15|k>>>17))*A+(((k>>>16)*A&65535)<<16)&4294967295)<<13|m>>>19))+((5*(m>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(k=0,h){case 3:k^=(255&i.charCodeAt(F+2))<<16;case 2:k^=(255&i.charCodeAt(F+1))<<8;case 1:m^=k=(65535&(k=(k=(65535&(k^=255&i.charCodeAt(F)))*w+(((k>>>16)*w&65535)<<16)&4294967295)<<15|k>>>17))*A+(((k>>>16)*A&65535)<<16)&4294967295}return m^=i.length,m=2246822507*(65535&(m^=m>>>16))+((2246822507*(m>>>16)&65535)<<16)&4294967295,m=3266489909*(65535&(m^=m>>>13))+((3266489909*(m>>>16)&65535)<<16)&4294967295,(m^=m>>>16)>>>0}),In.exports),e=(Dn||(Dn=1,Lr.exports=function(i,o){for(var h,p=i.length,m=o^p,x=0;p>=4;)h=1540483477*(65535&(h=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24))+((1540483477*(h>>>16)&65535)<<16),m=1540483477*(65535&m)+((1540483477*(m>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),p-=4,++x;switch(p){case 3:m^=(255&i.charCodeAt(x+2))<<16;case 2:m^=(255&i.charCodeAt(x+1))<<8;case 1:m=1540483477*(65535&(m^=255&i.charCodeAt(x)))+((1540483477*(m>>>16)&65535)<<16)}return m=1540483477*(65535&(m^=m>>>13))+((1540483477*(m>>>16)&65535)<<16),(m^=m>>>15)>>>0}),Lr.exports);return qn.exports=n,qn.exports.murmur3=n,qn.exports.murmur2=e,qn.exports})(),Kn=X(Wn);class Dr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,o,h){this.ids.push(Uo(e)),this.positions.push(i,o,h)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const i=Uo(e);let o=0,h=this.ids.length-1;for(;o<h;){const m=o+h>>1;this.ids[m]>=i?h=m:o=m+1}const p=[];for(;this.ids[o]===i;)p.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return p}static serialize(e,i){const o=new Float64Array(e.ids),h=new Uint32Array(e.positions);return Vo(o,h,0,o.length-1),i&&i.push(o.buffer,h.buffer),{ids:o,positions:h}}static deserialize(e){const i=new Dr;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function Uo(n){const e=+n;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Kn(String(n))}function Vo(n,e,i,o){for(;i<o;){const h=n[i+o>>1];let p=i-1,m=o+1;for(;;){do p++;while(n[p]<h);do m--;while(n[m]>h);if(p>=m)break;ao(n,p,m),ao(e,3*p,3*m),ao(e,3*p+1,3*m+1),ao(e,3*p+2,3*m+2)}m-i<o-m?(Vo(n,e,i,m),i=m+1):(Vo(n,e,m+1,o),o=m)}}function ao(n,e,i){const o=n[e];n[e]=n[i],n[i]=o}Nt("FeaturePositionMap",Dr);class Ba{constructor(e,i){this.gl=e.gl,this.location=i}}class xu extends Ba{constructor(e,i){super(e,i),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class rc extends Ba{constructor(e,i){super(e,i),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class so extends Ba{constructor(e,i){super(e,i),this.current=mi.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Na=new Float32Array(16);function ls(n){return[_i(255*n.r,255*n.g),_i(255*n.b,255*n.a)]}class Ls{constructor(e,i,o){this.value=e,this.uniformNames=i.map((h=>`u_${h}`)),this.type=o}setUniform(e,i,o){e.set(o.constantOr(this.value))}getBinding(e,i,o){return this.type==="color"?new so(e,i):new xu(e,i)}}class Ds{constructor(e,i){this.uniformNames=i.map((o=>`u_${o}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,i){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(e,i,o,h){let p=null;h==="u_pattern_to"?p=this.patternTo:h==="u_pattern_from"?p=this.patternFrom:h==="u_dasharray_to"?p=this.dashTo:h==="u_dasharray_from"?p=this.dashFrom:h==="u_pixel_ratio_to"?p=this.pixelRatioTo:h==="u_pixel_ratio_from"&&(p=this.pixelRatioFrom),p!==null&&e.set(p)}getBinding(e,i,o){return o.substr(0,9)==="u_pattern"||o.substr(0,12)==="u_dasharray_"?new rc(e,i):new xu(e,i)}}class sn{constructor(e,i,o,h){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=i.map((p=>({name:`a_${p}`,type:"Float32",components:o==="color"?2:1,offset:0}))),this.paintVertexArray=new h}populatePaintArray(e,i,o){const h=this.paintVertexArray.length,p=this.expression.evaluate(new an(0,o),i,{},o.canonical,[],o.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(h,e,p)}updatePaintArray(e,i,o,h,p){const m=this.expression.evaluate(new an(0,p),o,h);this._setPaintValue(e,i,m)}_setPaintValue(e,i,o){if(this.type==="color"){const h=ls(o);for(let p=e;p<i;p++)this.paintVertexArray.emplace(p,h[0],h[1])}else{for(let h=e;h<i;h++)this.paintVertexArray.emplace(h,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class mn{constructor(e,i,o,h,p,m){this.expression=e,this.uniformNames=i.map((x=>`u_${x}_t`)),this.type=o,this.useIntegerZoom=h,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=i.map((x=>({name:`a_${x}`,type:"Float32",components:o==="color"?4:2,offset:0}))),this.paintVertexArray=new m}populatePaintArray(e,i,o){const h=this.expression.evaluate(new an(this.zoom,o),i,{},o.canonical,[],o.formattedSection),p=this.expression.evaluate(new an(this.zoom+1,o),i,{},o.canonical,[],o.formattedSection),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,h,p)}updatePaintArray(e,i,o,h,p){const m=this.expression.evaluate(new an(this.zoom,p),o,h),x=this.expression.evaluate(new an(this.zoom+1,p),o,h);this._setPaintValue(e,i,m,x)}_setPaintValue(e,i,o,h){if(this.type==="color"){const p=ls(o),m=ls(h);for(let x=e;x<i;x++)this.paintVertexArray.emplace(x,p[0],p[1],m[0],m[1])}else{for(let p=e;p<i;p++)this.paintVertexArray.emplace(p,o,h);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(h))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i){const o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,h=Ct(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(h)}getBinding(e,i,o){return new xu(e,i)}}class cr{constructor(e,i,o,h,p,m){this.expression=e,this.type=i,this.useIntegerZoom=o,this.zoom=h,this.layerId=m,this.zoomInPaintVertexArray=new p,this.zoomOutPaintVertexArray=new p}populatePaintArray(e,i,o){const h=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(h,e,this.getPositionIds(i),o)}updatePaintArray(e,i,o,h,p){this._setPaintValues(e,i,this.getPositionIds(o),p)}_setPaintValues(e,i,o,h){const p=this.getPositions(h);if(!p||!o)return;const m=p[o.min],x=p[o.mid],w=p[o.max];if(m&&x&&w)for(let A=e;A<i;A++)this.emplace(this.zoomInPaintVertexArray,A,x,m),this.emplace(this.zoomOutPaintVertexArray,A,x,w)}upload(e){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){const i=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,i,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,i,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class gr extends cr{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns&&e.patterns[this.layerId]}getVertexAttributes(){return nn.members}emplace(e,i,o,h){e.emplace(i,o.tlbr[0],o.tlbr[1],o.tlbr[2],o.tlbr[3],h.tlbr[0],h.tlbr[1],h.tlbr[2],h.tlbr[3],o.pixelRatio,h.pixelRatio)}}class xh extends cr{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes&&e.dashes[this.layerId]}getVertexAttributes(){return bn.members}emplace(e,i,o,h){e.emplace(i,0,o.y,o.height,o.width,0,h.y,h.height,h.width)}}class bh{constructor(e,i,o){this.binders={},this._buffers=[];const h=[];for(const p in e.paint._values){if(!o(p))continue;const m=e.paint.get(p);if(!(m instanceof os&&Yr(m.property.specification)))continue;const x=Hd(p,e.type),w=m.value,A=m.property.specification.type,k=m.property.useIntegerZoom,F=m.property.specification["property-type"],Z=F==="cross-faded"||F==="cross-faded-data-driven";if(w.kind==="constant")this.binders[p]=Z?new Ds(w.value,x):new Ls(w.value,x,A),h.push(`/u_${p}`);else if(w.kind==="source"||Z){const G=Gl(p,A,"source");this.binders[p]=Z?p==="line-dasharray"?new xh(w,A,k,i,G,e.id):new gr(w,A,k,i,G,e.id):new sn(w,x,A,G),h.push(`/a_${p}`)}else{const G=Gl(p,A,"composite");this.binders[p]=new mn(w,x,A,k,i,G),h.push(`/z_${p}`)}}this.cacheKey=h.sort().join("")}getMaxValue(e){const i=this.binders[e];return i instanceof sn||i instanceof mn?i.maxValue:0}populatePaintArrays(e,i,o){for(const h in this.binders){const p=this.binders[h];(p instanceof sn||p instanceof mn||p instanceof cr)&&p.populatePaintArray(e,i,o)}}setConstantPatternPositions(e,i){for(const o in this.binders){const h=this.binders[o];h instanceof Ds&&h.setConstantPatternPositions(e,i)}}setConstantDashPositions(e,i){for(const o in this.binders){const h=this.binders[o];h instanceof Ds&&h.setConstantDashPositions(e,i)}}updatePaintArrays(e,i,o,h,p){let m=!1;for(const x in e){const w=i.getPositions(x);for(const A of w){const k=o.feature(A.index);for(const F in this.binders){const Z=this.binders[F];if((Z instanceof sn||Z instanceof mn||Z instanceof cr)&&Z.expression.isStateDependent===!0){const G=h.paint.get(F);Z.expression=G.value,Z.updatePaintArray(A.start,A.end,k,e[x],p),m=!0}}}}return m}defines(){const e=[];for(const i in this.binders){const o=this.binders[i];(o instanceof Ls||o instanceof Ds)&&e.push(...o.uniformNames.map((h=>`#define HAS_UNIFORM_${h}`)))}return e}getBinderAttributes(){const e=[];for(const i in this.binders){const o=this.binders[i];if(o instanceof sn||o instanceof mn)for(let h=0;h<o.paintVertexAttributes.length;h++)e.push(o.paintVertexAttributes[h].name);else if(o instanceof cr){const h=o.getVertexAttributes();for(const p of h)e.push(p.name)}}return e}getBinderUniforms(){const e=[];for(const i in this.binders){const o=this.binders[i];if(o instanceof Ls||o instanceof Ds||o instanceof mn)for(const h of o.uniformNames)e.push(h)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,i){const o=[];for(const h in this.binders){const p=this.binders[h];if(p instanceof Ls||p instanceof Ds||p instanceof mn){for(const m of p.uniformNames)if(i[m]){const x=p.getBinding(e,i[m],m);o.push({name:m,property:h,binding:x})}}}return o}setUniforms(e,i,o,h){for(const{name:p,property:m,binding:x}of i)this.binders[m].setUniform(x,h,o.get(m),p)}updatePaintBuffers(e){this._buffers=[];for(const i in this.binders){const o=this.binders[i];if(e&&o instanceof cr){const h=e.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;h&&this._buffers.push(h)}else(o instanceof sn||o instanceof mn)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(const i in this.binders){const o=this.binders[i];(o instanceof sn||o instanceof mn||o instanceof cr)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const i=this.binders[e];(i instanceof sn||i instanceof mn||i instanceof cr)&&i.destroy()}}}class Zl{constructor(e,i,o=()=>!0){this.programConfigurations={};for(const h of e)this.programConfigurations[h.id]=new bh(h,i,o);this.needsUpload=!1,this._featureMap=new Dr,this._bufferOffset=0}populatePaintArrays(e,i,o,h){for(const p in this.programConfigurations)this.programConfigurations[p].populatePaintArrays(e,i,h);i.id!==void 0&&this._featureMap.add(i.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,o,h){for(const p of o)this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(e,this._featureMap,i,p,h)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Hd(n,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[n]||[n.replace(`${e}-`,"").replace(/-/g,"_")]}function Gl(n,e,i){const o={color:{source:Ln,composite:a},number:{source:vu,composite:Ln}},h=(function(p){return{"line-pattern":{source:Ce,composite:Ce},"fill-pattern":{source:Ce,composite:Ce},"fill-extrusion-pattern":{source:Ce,composite:Ce},"line-dasharray":{source:Le,composite:Le}}[p]})(n);return h&&h[i]||o[e][i]}Nt("ConstantBinder",Ls),Nt("CrossFadedConstantBinder",Ds),Nt("SourceExpressionBinder",sn),Nt("CrossFadedPatternBinder",gr),Nt("CrossFadedDasharrayBinder",xh),Nt("CompositeExpressionBinder",mn),Nt("ProgramConfiguration",bh,{omit:["_buffers"]}),Nt("ProgramConfigurationSet",Zl);const wh=Math.pow(2,14)-1,vl=-wh-1;function xl(n){const e=Yt/n.extent,i=n.loadGeometry();for(let o=0;o<i.length;o++){const h=i[o];for(let p=0;p<h.length;p++){const m=h[p],x=Math.round(m.x*e),w=Math.round(m.y*e);m.x=Ct(x,vl,wh),m.y=Ct(w,vl,wh),(x<m.x||x>m.x+1||w<m.y||w>m.y+1)&&En("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function oo(n,e){return{type:n.type,id:n.id,properties:n.properties,geometry:e?xl(n):[]}}const Th=-32768;function Uc(n,e,i,o,h){n.emplaceBack(Th+8*e+o,Th+8*i+h)}class Vc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new pe,this.indexArray=new Xe,this.segments=new Lt,this.programConfigurations=new Zl(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){const h=this.layers[0],p=[];let m=null,x=!1,w=h.type==="heatmap";if(h.type==="circle"){const k=h;m=k.layout.get("circle-sort-key"),x=!m.isConstant(),w=w||k.paint.get("circle-pitch-alignment")==="map"}const A=w?i.subdivisionGranularity.circle:1;for(const{feature:k,id:F,index:Z,sourceLayerIndex:G}of e){const W=this.layers[0]._featureFilter.needGeometry,K=oo(k,W);if(!this.layers[0]._featureFilter.filter(new an(this.zoom),K,o))continue;const J=x?m.evaluate(K,{},o):void 0,se={id:F,properties:k.properties,type:k.type,sourceLayerIndex:G,index:Z,geometry:W?K.geometry:xl(k),patterns:{},sortKey:J};p.push(se)}x&&p.sort(((k,F)=>k.sortKey-F.sortKey));for(const k of p){const{geometry:F,index:Z,sourceLayerIndex:G}=k,W=e[Z].feature;this.addFeature(k,F,Z,o,A),i.featureIndex.insert(W,F,Z,G,this.index)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pt),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,o,h,p=1){let m;switch(p){case 1:m=[0,7];break;case 3:m=[0,2,5,7];break;case 5:m=[0,1,3,4,6,7];break;case 7:m=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${p}; valid values are 1, 3, 5, 7.`)}const x=m.length;for(const w of i)for(const A of w){const k=A.x,F=A.y;if(k<0||k>=Yt||F<0||F>=Yt)continue;const Z=this.segments.prepareSegment(x*x,this.layoutVertexArray,this.indexArray,e.sortKey),G=Z.vertexLength;for(let W=0;W<x;W++)for(let K=0;K<x;K++)Uc(this.layoutVertexArray,k,F,m[K],m[W]);for(let W=0;W<x-1;W++)for(let K=0;K<x-1;K++){const J=G+W*x+K,se=G+(W+1)*x+K;this.indexArray.emplaceBack(J,se+1,J+1),this.indexArray.emplaceBack(J,se,se+1)}Z.vertexLength+=x*x,Z.primitiveLength+=(x-1)*(x-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:{},canonical:h})}}function Zc(n,e){for(let i=0;i<n.length;i++)if(ql(e,n[i]))return!0;for(let i=0;i<e.length;i++)if(ql(n,e[i]))return!0;return!!Qr(n,e)}function $d(n,e,i){return!!ql(n,e)||!!Yd(e,n,i)}function Xd(n,e){if(n.length===1)return ip(e,n[0]);for(let i=0;i<e.length;i++){const o=e[i];for(let h=0;h<o.length;h++)if(ql(n,o[h]))return!0}for(let i=0;i<n.length;i++)if(ip(e,n[i]))return!0;for(let i=0;i<e.length;i++)if(Qr(n,e[i]))return!0;return!1}function Ir(n,e,i){if(n.length>1){if(Qr(n,e))return!0;for(let o=0;o<e.length;o++)if(Yd(e[o],n,i))return!0}for(let o=0;o<n.length;o++)if(Yd(n[o],e,i))return!0;return!1}function Qr(n,e){if(n.length===0||e.length===0)return!1;for(let i=0;i<n.length-1;i++){const o=n[i],h=n[i+1];for(let p=0;p<e.length-1;p++)if(mm(o,h,e[p],e[p+1]))return!0}return!1}function mm(n,e,i,o){return Vr(n,i,o)!==Vr(e,i,o)&&Vr(n,e,i)!==Vr(n,e,o)}function Yd(n,e,i){const o=i*i;if(e.length===1)return n.distSqr(e[0])<o;for(let h=1;h<e.length;h++)if(tp(n,e[h-1],e[h])<o)return!0;return!1}function tp(n,e,i){const o=e.distSqr(i);if(o===0)return n.distSqr(e);const h=((n.x-e.x)*(i.x-e.x)+(n.y-e.y)*(i.y-e.y))/o;return n.distSqr(h<0?e:h>1?i:i.sub(e)._mult(h)._add(e))}function ip(n,e){let i,o,h,p=!1;for(let m=0;m<n.length;m++){i=n[m];for(let x=0,w=i.length-1;x<i.length;w=x++)o=i[x],h=i[w],o.y>e.y!=h.y>e.y&&e.x<(h.x-o.x)*(e.y-o.y)/(h.y-o.y)+o.x&&(p=!p)}return p}function ql(n,e){let i=!1;for(let o=0,h=n.length-1;o<n.length;h=o++){const p=n[o],m=n[h];p.y>e.y!=m.y>e.y&&e.x<(m.x-p.x)*(e.y-p.y)/(m.y-p.y)+p.x&&(i=!i)}return i}function gm(n,e,i){const o=i[0],h=i[2];if(n.x<o.x&&e.x<o.x||n.x>h.x&&e.x>h.x||n.y<o.y&&e.y<o.y||n.y>h.y&&e.y>h.y)return!1;const p=Vr(n,e,i[0]);return p!==Vr(n,e,i[1])||p!==Vr(n,e,i[2])||p!==Vr(n,e,i[3])}function bu(n,e,i){const o=e.paint.get(n).value;return o.kind==="constant"?o.value:i.programConfigurations.get(e.id).getMaxValue(n)}function ed(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function Wd(n,e,i,o,h){if(!e[0]&&!e[1])return n;const p=V.convert(e)._mult(h);i==="viewport"&&p._rotate(-o);const m=[];for(let x=0;x<n.length;x++)m.push(n[x].sub(p));return m}function Kd(n){const e=[];for(let i=0;i<n.length;i++){const o=n[i],h=e.at(-1);(i===0||h&&!o.equals(h))&&e.push(o)}return e}function np({queryGeometry:n,size:e},i){return $d(n,i,e)}function _m({queryGeometry:n,size:e,transform:i,unwrappedTileID:o,getElevation:h},p){return $d(n,p,e*(i.projectTileCoordinates(p.x,p.y,o,h).signedDistanceFromCamera/i.cameraToCenterDistance))}function ym({queryGeometry:n,size:e,transform:i,unwrappedTileID:o,getElevation:h},p){const m=i.projectTileCoordinates(p.x,p.y,o,h).signedDistanceFromCamera,x=e*(i.cameraToCenterDistance/m);return $d(n,td(p,i,o,h),x)}function vm({queryGeometry:n,size:e,transform:i,unwrappedTileID:o,getElevation:h},p){return $d(n,td(p,i,o,h),e)}function Qd({queryGeometry:n,size:e,transform:i,unwrappedTileID:o,getElevation:h,pitchAlignment:p="map",pitchScale:m="map"},x){const w=p==="map"?m==="map"?np:_m:m==="map"?ym:vm,A={queryGeometry:n,size:e,transform:i,unwrappedTileID:o,getElevation:h};for(const k of x)for(const F of k)if(w(A,F))return!0;return!1}function td(n,e,i,o){const h=e.projectTileCoordinates(n.x,n.y,i,o).point;return new V((.5*h.x+.5)*e.width,(.5*-h.y+.5)*e.height)}let Jd,rp;Nt("CircleBucket",Vc,{omit:["layers"]});var ap={get paint(){return rp=rp||new rr({"circle-radius":new $t(ke.paint_circle["circle-radius"]),"circle-color":new $t(ke.paint_circle["circle-color"]),"circle-blur":new $t(ke.paint_circle["circle-blur"]),"circle-opacity":new $t(ke.paint_circle["circle-opacity"]),"circle-translate":new Ut(ke.paint_circle["circle-translate"]),"circle-translate-anchor":new Ut(ke.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ut(ke.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ut(ke.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new $t(ke.paint_circle["circle-stroke-width"]),"circle-stroke-color":new $t(ke.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new $t(ke.paint_circle["circle-stroke-opacity"])})},get layout(){return Jd=Jd||new rr({"circle-sort-key":new $t(ke.layout_circle["circle-sort-key"])})}};class ef extends Gn{constructor(e,i){super(e,ap,i)}createBucket(e){return new Vc(e)}queryRadius(e){const i=e;return bu("circle-radius",this,i)+bu("circle-stroke-width",this,i)+ed(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:h,transform:p,pixelsToTileUnits:m,unwrappedTileID:x,getElevation:w}){const A=Wd(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-p.bearingInRadians,m),k=this.paint.get("circle-radius").evaluate(i,o)+this.paint.get("circle-stroke-width").evaluate(i,o),F=this.paint.get("circle-pitch-scale"),Z=this.paint.get("circle-pitch-alignment");let G,W;return Z==="map"?(G=A,W=k*m):(G=(function(K,J,se,ge){return K.map((le=>td(le,J,se,ge)))})(A,p,x,w),W=k),Qd({queryGeometry:G,size:W,transform:p,unwrappedTileID:x,getElevation:w,pitchAlignment:Z,pitchScale:F},h)}}class tf extends Vc{}let sp;Nt("HeatmapBucket",tf,{omit:["layers"]});var op={get paint(){return sp=sp||new rr({"heatmap-radius":new $t(ke.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $t(ke.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ut(ke.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Oc(ke.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ut(ke.paint_heatmap["heatmap-opacity"])})}};function nf(n,{width:e,height:i},o,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==e*i*o)throw new RangeError(`mismatched image size. expected: ${h.length} but got: ${e*i*o}`)}else h=new Uint8Array(e*i*o);return n.width=e,n.height=i,n.data=h,n}function Hl(n,{width:e,height:i},o){if(e===n.width&&i===n.height)return;const h=nf({},{width:e,height:i},o);id(n,h,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,e),height:Math.min(n.height,i)},o),n.width=e,n.height=i,n.data=h.data}function id(n,e,i,o,h,p){if(h.width===0||h.height===0)return e;if(h.width>n.width||h.height>n.height||i.x>n.width-h.width||i.y>n.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>e.width||h.height>e.height||o.x>e.width-h.width||o.y>e.height-h.height)throw new RangeError("out of range destination coordinates for image copy");const m=n.data,x=e.data;if(m===x)throw new Error("srcData equals dstData, so image is already copied");for(let w=0;w<h.height;w++){const A=((i.y+w)*n.width+i.x)*p,k=((o.y+w)*e.width+o.x)*p;for(let F=0;F<h.width*p;F++)x[k+F]=m[A+F]}return e}class nd{constructor(e,i){nf(this,e,1,i)}resize(e){Hl(this,e,1)}clone(){return new nd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,o,h,p){id(e,i,o,h,p,1)}}class Fa{constructor(e,i){nf(this,e,4,i)}resize(e){Hl(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Fa({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,o,h,p){id(e,i,o,h,p,4)}setPixel(e,i,o){const h=4*(e*this.width+i);this.data[h+0]=Math.round(255*o.r/o.a),this.data[h+1]=Math.round(255*o.g/o.a),this.data[h+2]=Math.round(255*o.b/o.a),this.data[h+3]=Math.round(255*o.a)}}function $l(n){const e={},i=n.resolution||256,o=n.clips?n.clips.length:1,h=n.image||new Fa({width:i,height:o});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const p=(m,x,w)=>{e[n.evaluationKey]=w;const A=n.expression.evaluate(e);h.setPixel(m/4/i,x/4,A)};if(n.clips)for(let m=0,x=0;m<o;++m,x+=4*i)for(let w=0,A=0;w<i;w++,A+=4){const k=w/(i-1),{start:F,end:Z}=n.clips[m];p(x,A,F*(1-k)+Z*k)}else for(let m=0,x=0;m<i;m++,x+=4)p(0,x,m/(i-1));return h}Nt("AlphaImage",nd),Nt("RGBAImage",Fa);const rd="big-fb";class xm extends Gn{createBucket(e){return new tf(e)}constructor(e,i){super(e,op,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=$l({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(rd)&&this.heatmapFbos.delete(rd)}queryRadius(e){return bu("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:h,transform:p,pixelsToTileUnits:m,unwrappedTileID:x,getElevation:w}){return Qd({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,o)*m,transform:p,unwrappedTileID:x,getElevation:w},h)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let ad;var sd={get paint(){return ad=ad||new rr({"hillshade-illumination-direction":new Ut(ke.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Ut(ke.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Ut(ke.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ut(ke.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ut(ke.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ut(ke.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ut(ke.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Ut(ke.paint_hillshade["hillshade-method"])})}};class Qn extends Gn{constructor(e,i){super(e,sd,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,o=this.paint.get("hillshade-highlight-color").values,h=this.paint.get("hillshade-shadow-color").values;const p=Math.max(e.length,i.length,o.length,h.length);e=e.concat(Array(p-e.length).fill(e.at(-1))),i=i.concat(Array(p-i.length).fill(i.at(-1))),o=o.concat(Array(p-o.length).fill(o.at(-1))),h=h.concat(Array(p-h.length).fill(h.at(-1)));const m=i.map(pr);return{directionRadians:e.map(pr),altitudeRadians:m,shadowColor:h,highlightColor:o}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let bm;var zg={get paint(){return bm=bm||new rr({"color-relief-opacity":new Ut(ke["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Oc(ke["paint_color-relief"]["color-relief-color"])})}};class rf{constructor(e,i,o,h){this.context=e,this.format=o,this.texture=e.gl.createTexture(),this.update(i,h)}update(e,i,o){const{width:h,height:p}=e,m=!(this.size&&this.size[0]===h&&this.size[1]===p||o),{context:x}=this,{gl:w}=x;if(this.useMipmap=!!(i&&i.useMipmap),w.bindTexture(w.TEXTURE_2D,this.texture),x.pixelStoreUnpackFlipY.set(!1),x.pixelStoreUnpack.set(1),x.pixelStoreUnpackPremultiplyAlpha.set(this.format===w.RGBA&&(!i||i.premultiply!==!1)),m)this.size=[h,p],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Ta(e)?w.texImage2D(w.TEXTURE_2D,0,this.format,this.format,w.UNSIGNED_BYTE,e):w.texImage2D(w.TEXTURE_2D,0,this.format,h,p,0,this.format,w.UNSIGNED_BYTE,e.data);else{const{x:A,y:k}=o||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Ta(e)?w.texSubImage2D(w.TEXTURE_2D,0,A,k,w.RGBA,w.UNSIGNED_BYTE,e):w.texSubImage2D(w.TEXTURE_2D,0,A,k,h,p,w.RGBA,w.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&w.generateMipmap(w.TEXTURE_2D),x.pixelStoreUnpackFlipY.setDefault(),x.pixelStoreUnpack.setDefault(),x.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,i,o){const{context:h}=this,{gl:p}=h;p.bindTexture(p.TEXTURE_2D,this.texture),o!==p.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(o=p.LINEAR),e!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,e),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,o||e),this.filter=e),i!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,i),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,i),this.wrap=i)}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}}class Sh{constructor(e,i,o,h=1,p=1,m=1,x=0){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(o&&!["mapbox","terrarium","custom"].includes(o))return void En(`"${o}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;const w=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),o){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=h,this.greenFactor=p,this.blueFactor=m,this.baseShift=x;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let A=0;A<w;A++)this.data[this._idx(-1,A)]=this.data[this._idx(0,A)],this.data[this._idx(w,A)]=this.data[this._idx(w-1,A)],this.data[this._idx(A,-1)]=this.data[this._idx(A,0)],this.data[this._idx(A,w)]=this.data[this._idx(A,w-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(w,-1)]=this.data[this._idx(w-1,0)],this.data[this._idx(-1,w)]=this.data[this._idx(0,w-1)],this.data[this._idx(w,w)]=this.data[this._idx(w-1,w-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let A=0;A<w;A++)for(let k=0;k<w;k++){const F=this.get(A,k);F>this.max&&(this.max=F),F<this.min&&(this.min=F)}}get(e,i){const o=new Uint8Array(this.data.buffer),h=4*this._idx(e,i);return this.unpack(o[h],o[h+1],o[h+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);return(i+1)*this.stride+(e+1)}unpack(e,i,o){return e*this.redFactor+i*this.greenFactor+o*this.blueFactor-this.baseShift}pack(e){return wu(e,this.getUnpackVector())}getPixels(){return new Fa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,i,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let h=i*this.dim,p=i*this.dim+this.dim,m=o*this.dim,x=o*this.dim+this.dim;switch(i){case-1:h=p-1;break;case 1:p=h+1}switch(o){case-1:m=x-1;break;case 1:x=m+1}const w=-i*this.dim,A=-o*this.dim;for(let k=m;k<x;k++)for(let F=h;F<p;F++)this.data[this._idx(F,k)]=e.data[this._idx(F+w,k+A)]}}function wu(n,e){const i=e[0],o=e[1],h=e[2],p=e[3],m=Math.min(i,o,h),x=Math.round((n+p)/m);return{r:Math.floor(x*m/i)%256,g:Math.floor(x*m/o)%256,b:Math.floor(x*m/h)%256}}Nt("DEMData",Sh);class wm extends Gn{constructor(e,i){super(e,zg,i)}_createColorRamp(e){const i={elevationStops:[],colorStops:[]},o=this._transitionablePaint._values["color-relief-color"].value.expression;if(o instanceof _&&o._styleExpression.expression instanceof Zn){this.colorRampExpression=o;const m=o._styleExpression.expression;i.elevationStops=m.labels,i.colorStops=[];for(const x of i.elevationStops)i.colorStops.push(m.evaluate({globals:{elevation:x}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[mi.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=e)return i;const h={elevationStops:[],colorStops:[]},p=(i.elevationStops.length-1)/(e-1);for(let m=0;m<i.elevationStops.length-.5;m+=p)h.elevationStops.push(i.elevationStops[Math.round(m)]),h.colorStops.push(i.colorStops[Math.round(m)]);return En(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${i.elevationStops.length}`),h}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,i,o){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const h=this._createColorRamp(i),p=new Fa({width:h.colorStops.length,height:1}),m=new Fa({width:h.colorStops.length,height:1});for(let x=0;x<h.elevationStops.length;x++){const w=wu(h.elevationStops[x],o);m.setPixel(0,x,new mi(w.r/255,w.g/255,w.b/255,1)),p.setPixel(0,x,h.colorStops[x])}return this.colorRampTextures={elevationTexture:new rf(e,m,e.gl.RGBA),colorTexture:new rf(e,p,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}const Tm=Fn([{name:"a_pos",components:2,type:"Int16"}],4),{members:od}=Tm;function lo(n,e,i){const o=i.patternDependencies;let h=!1;for(const p of e){const m=p.paint.get(`${n}-pattern`);m.isConstant()||(h=!0);const x=m.constantOr(null);x&&(h=!0,o[x.to]=!0,o[x.from]=!0)}return h}function af(n,e,i,o,h){const{zoom:p}=o,m=h.patternDependencies;for(const x of e){const w=x.paint.get(`${n}-pattern`).value;if(w.kind!=="constant"){let A=w.evaluate({zoom:p-1},i,{},h.availableImages),k=w.evaluate({zoom:p},i,{},h.availableImages),F=w.evaluate({zoom:p+1},i,{},h.availableImages);A=A&&A.name?A.name:A,k=k&&k.name?k.name:k,F=F&&F.name?F.name:F,m[A]=!0,m[k]=!0,m[F]=!0,i.patterns[x.id]={min:A,mid:k,max:F}}}return i}function sf(n,e,i,o,h){let p;if(h===(function(m,x,w,A){let k=0;for(let F=x,Z=w-A;F<w;F+=A)k+=(m[Z]-m[F])*(m[F+1]+m[Z+1]),Z=F;return k})(n,e,i,o)>0)for(let m=e;m<i;m+=o)p=us(m/o|0,n[m],n[m+1],p);else for(let m=i-o;m>=e;m-=o)p=us(m/o|0,n[m],n[m+1],p);return p&&Is(p,p.next)&&(cs(p),p=p.next),p}function ac(n,e){if(!n)return n;e||(e=n);let i,o=n;do if(i=!1,o.steiner||!Is(o,o.next)&&Xi(o.prev,o,o.next)!==0)o=o.next;else{if(cs(o),o=e=o.prev,o===o.next)break;i=!0}while(i||o!==e);return e}function Gc(n,e,i,o,h,p,m){if(!n)return;!m&&p&&(function(w,A,k,F){let Z=w;do Z.z===0&&(Z.z=Rr(Z.x,Z.y,A,k,F)),Z.prevZ=Z.prev,Z.nextZ=Z.next,Z=Z.next;while(Z!==w);Z.prevZ.nextZ=null,Z.prevZ=null,(function(G){let W,K=1;do{let J,se=G;G=null;let ge=null;for(W=0;se;){W++;let le=se,he=0;for(let Ae=0;Ae<K&&(he++,le=le.nextZ,le);Ae++);let xe=K;for(;he>0||xe>0&&le;)he!==0&&(xe===0||!le||se.z<=le.z)?(J=se,se=se.nextZ,he--):(J=le,le=le.nextZ,xe--),ge?ge.nextZ=J:G=J,J.prevZ=ge,ge=J;se=le}ge.nextZ=null,K*=2}while(W>1)})(Z)})(n,o,h,p);let x=n;for(;n.prev!==n.next;){const w=n.prev,A=n.next;if(p?of(n,o,h,p):lp(n))e.push(w.i,n.i,A.i),cs(n),n=A.next,x=A.next;else if((n=A)===x){m?m===1?Gc(n=Sm(ac(n),e),e,i,o,h,p,2):m===2&&Tu(n,e,i,o,h,p):Gc(ac(n),e,i,o,h,p,1);break}}}function lp(n){const e=n.prev,i=n,o=n.next;if(Xi(e,i,o)>=0)return!1;const h=e.x,p=i.x,m=o.x,x=e.y,w=i.y,A=o.y,k=Math.min(h,p,m),F=Math.min(x,w,A),Z=Math.max(h,p,m),G=Math.max(x,w,A);let W=o.next;for(;W!==e;){if(W.x>=k&&W.x<=Z&&W.y>=F&&W.y<=G&&Ch(h,x,p,w,m,A,W.x,W.y)&&Xi(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function of(n,e,i,o){const h=n.prev,p=n,m=n.next;if(Xi(h,p,m)>=0)return!1;const x=h.x,w=p.x,A=m.x,k=h.y,F=p.y,Z=m.y,G=Math.min(x,w,A),W=Math.min(k,F,Z),K=Math.max(x,w,A),J=Math.max(k,F,Z),se=Rr(G,W,e,i,o),ge=Rr(K,J,e,i,o);let le=n.prevZ,he=n.nextZ;for(;le&&le.z>=se&&he&&he.z<=ge;){if(le.x>=G&&le.x<=K&&le.y>=W&&le.y<=J&&le!==h&&le!==m&&Ch(x,k,w,F,A,Z,le.x,le.y)&&Xi(le.prev,le,le.next)>=0||(le=le.prevZ,he.x>=G&&he.x<=K&&he.y>=W&&he.y<=J&&he!==h&&he!==m&&Ch(x,k,w,F,A,Z,he.x,he.y)&&Xi(he.prev,he,he.next)>=0))return!1;he=he.nextZ}for(;le&&le.z>=se;){if(le.x>=G&&le.x<=K&&le.y>=W&&le.y<=J&&le!==h&&le!==m&&Ch(x,k,w,F,A,Z,le.x,le.y)&&Xi(le.prev,le,le.next)>=0)return!1;le=le.prevZ}for(;he&&he.z<=ge;){if(he.x>=G&&he.x<=K&&he.y>=W&&he.y<=J&&he!==h&&he!==m&&Ch(x,k,w,F,A,Z,he.x,he.y)&&Xi(he.prev,he,he.next)>=0)return!1;he=he.nextZ}return!0}function Sm(n,e){let i=n;do{const o=i.prev,h=i.next.next;!Is(o,h)&&hp(o,i,i.next,h)&&cd(o,h)&&cd(h,o)&&(e.push(o.i,i.i,h.i),cs(i),cs(i.next),i=n=h),i=i.next}while(i!==n);return ac(i)}function Tu(n,e,i,o,h,p){let m=n;do{let x=m.next.next;for(;x!==m.prev;){if(m.i!==x.i&&ar(m,x)){let w=hd(m,x);return m=ac(m,m.next),w=ac(w,w.next),Gc(m,e,i,o,h,p,0),void Gc(w,e,i,o,h,p,0)}x=x.next}m=m.next}while(m!==n)}function kr(n,e){let i=n.x-e.x;return i===0&&(i=n.y-e.y,i===0)&&(i=(n.next.y-n.y)/(n.next.x-n.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function up(n,e){const i=(function(h,p){let m=p;const x=h.x,w=h.y;let A,k=-1/0;if(Is(h,m))return m;do{if(Is(h,m.next))return m.next;if(w<=m.y&&w>=m.next.y&&m.next.y!==m.y){const K=m.x+(w-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(K<=x&&K>k&&(k=K,A=m.x<m.next.x?m:m.next,K===x))return A}m=m.next}while(m!==p);if(!A)return null;const F=A,Z=A.x,G=A.y;let W=1/0;m=A;do{if(x>=m.x&&m.x>=Z&&x!==m.x&&cp(w<G?x:k,w,Z,G,w<G?k:x,w,m.x,m.y)){const K=Math.abs(w-m.y)/(x-m.x);cd(m,h)&&(K<W||K===W&&(m.x>A.x||m.x===A.x&&Cm(A,m)))&&(A=m,W=K)}m=m.next}while(m!==F);return A})(n,e);if(!i)return e;const o=hd(i,n);return ac(o,o.next),ac(i,i.next)}function Cm(n,e){return Xi(n.prev,n,e.prev)<0&&Xi(e.next,n,n.next)<0}function Rr(n,e,i,o,h){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-i)*h|0)|n<<8))|n<<4))|n<<2))|n<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*h|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Lg(n){let e=n,i=n;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==n);return i}function cp(n,e,i,o,h,p,m,x){return(h-m)*(e-x)>=(n-m)*(p-x)&&(n-m)*(o-x)>=(i-m)*(e-x)&&(i-m)*(p-x)>=(h-m)*(o-x)}function Ch(n,e,i,o,h,p,m,x){return!(n===m&&e===x)&&cp(n,e,i,o,h,p,m,x)}function ar(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!(function(i,o){let h=i;do{if(h.i!==i.i&&h.next.i!==i.i&&h.i!==o.i&&h.next.i!==o.i&&hp(h,h.next,i,o))return!0;h=h.next}while(h!==i);return!1})(n,e)&&(cd(n,e)&&cd(e,n)&&(function(i,o){let h=i,p=!1;const m=(i.x+o.x)/2,x=(i.y+o.y)/2;do h.y>x!=h.next.y>x&&h.next.y!==h.y&&m<(h.next.x-h.x)*(x-h.y)/(h.next.y-h.y)+h.x&&(p=!p),h=h.next;while(h!==i);return p})(n,e)&&(Xi(n.prev,n,e.prev)||Xi(n,e.prev,e))||Is(n,e)&&Xi(n.prev,n,n.next)>0&&Xi(e.prev,e,e.next)>0)}function Xi(n,e,i){return(e.y-n.y)*(i.x-e.x)-(e.x-n.x)*(i.y-e.y)}function Is(n,e){return n.x===e.x&&n.y===e.y}function hp(n,e,i,o){const h=ud(Xi(n,e,i)),p=ud(Xi(n,e,o)),m=ud(Xi(i,o,n)),x=ud(Xi(i,o,e));return h!==p&&m!==x||!(h!==0||!ld(n,i,e))||!(p!==0||!ld(n,o,e))||!(m!==0||!ld(i,n,o))||!(x!==0||!ld(i,e,o))}function ld(n,e,i){return e.x<=Math.max(n.x,i.x)&&e.x>=Math.min(n.x,i.x)&&e.y<=Math.max(n.y,i.y)&&e.y>=Math.min(n.y,i.y)}function ud(n){return n>0?1:n<0?-1:0}function cd(n,e){return Xi(n.prev,n,n.next)<0?Xi(n,e,n.next)>=0&&Xi(n,n.prev,e)>=0:Xi(n,e,n.prev)<0||Xi(n,n.next,e)<0}function hd(n,e){const i=lf(n.i,n.x,n.y),o=lf(e.i,e.x,e.y),h=n.next,p=e.prev;return n.next=e,e.prev=n,i.next=h,h.prev=i,o.next=i,i.prev=o,p.next=o,o.prev=p,o}function us(n,e,i,o){const h=lf(n,e,i);return o?(h.next=o.next,h.prev=o,o.next.prev=h,o.next=h):(h.prev=h,h.next=h),h}function cs(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function lf(n,e,i){return{i:n,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class Jr{constructor(e,i){if(i>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=i}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class dd{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}dd.noSubdivision=new dd({fill:new Jr(0,0),line:new Jr(0,0),tile:new Jr(0,0),stencil:new Jr(0,0),circle:1}),Nt("SubdivisionGranularityExpression",Jr),Nt("SubdivisionGranularitySetting",dd);const ks=-32768,bl=32767;class Su{constructor(e,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=Yt/e,this._canonical=i}_getKey(e,i){return(e+=32768)<<16|i+32768}_vertexToIndex(e,i){if(e<-32768||i<-32768||e>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const o=0|Math.round(e),h=0|Math.round(i),p=this._getKey(o,h);if(this._vertexDictionary.has(p))return this._vertexDictionary.get(p);const m=this._vertexBuffer.length/2;return this._vertexDictionary.set(p,m),this._vertexBuffer.push(o,h),m}_subdivideTrianglesScanline(e){if(this._granularity<2)return(function(h,p){const m=[];for(let x=0;x<p.length;x+=3){const w=p[x],A=p[x+1],k=p[x+2],F=h[2*w],Z=h[2*w+1];(h[2*A]-F)*(h[2*k+1]-Z)-(h[2*A+1]-Z)*(h[2*k]-F)>0?(m.push(w),m.push(k),m.push(A)):(m.push(w),m.push(A),m.push(k))}return m})(this._vertexBuffer,e);const i=[],o=e.length;for(let h=0;h<o;h+=3){const p=[e[h+0],e[h+1],e[h+2]],m=[this._vertexBuffer[2*e[h+0]+0],this._vertexBuffer[2*e[h+0]+1],this._vertexBuffer[2*e[h+1]+0],this._vertexBuffer[2*e[h+1]+1],this._vertexBuffer[2*e[h+2]+0],this._vertexBuffer[2*e[h+2]+1]];let x=1/0,w=1/0,A=-1/0,k=-1/0;for(let K=0;K<3;K++){const J=m[2*K],se=m[2*K+1];x=Math.min(x,J),A=Math.max(A,J),w=Math.min(w,se),k=Math.max(k,se)}if(x===A||w===k)continue;const F=Math.floor(x/this._granularityCellSize),Z=Math.ceil(A/this._granularityCellSize),G=Math.floor(w/this._granularityCellSize),W=Math.ceil(k/this._granularityCellSize);if(F!==Z||G!==W)for(let K=G;K<W;K++){const J=this._scanlineGenerateVertexRingForCellRow(K,m,p);wl(this._vertexBuffer,J,i)}else i.push(...p)}return i}_scanlineGenerateVertexRingForCellRow(e,i,o){const h=e*this._granularityCellSize,p=h+this._granularityCellSize,m=[];for(let x=0;x<3;x++){const w=i[2*x],A=i[2*x+1],k=i[2*(x+1)%6],F=i[(2*(x+1)+1)%6],Z=i[2*(x+2)%6],G=i[(2*(x+2)+1)%6],W=k-w,K=F-A,J=W===0,se=K===0,ge=(h-A)/K,le=(p-A)/K,he=Math.min(ge,le),xe=Math.max(ge,le);if(!se&&(he>=1||xe<=0)||se&&(A<h||A>p)){F>=h&&F<=p&&m.push(o[(x+1)%3]);continue}!se&&he>0&&m.push(this._vertexToIndex(w+W*he,A+K*he));const Ae=w+W*Math.max(he,0),He=w+W*Math.min(xe,1);J||this._generateIntraEdgeVertices(m,w,A,k,F,Ae,He),!se&&xe<1&&m.push(this._vertexToIndex(w+W*xe,A+K*xe)),(se||F>=h&&F<=p)&&m.push(o[(x+1)%3]),!se&&(F<=h||F>=p)&&this._generateInterEdgeVertices(m,w,A,k,F,Z,G,He,h,p)}return m}_generateIntraEdgeVertices(e,i,o,h,p,m,x){const w=h-i,A=p-o,k=A===0,F=k?Math.min(i,h):Math.min(m,x),Z=k?Math.max(i,h):Math.max(m,x),G=Math.floor(F/this._granularityCellSize)+1,W=Math.ceil(Z/this._granularityCellSize)-1;if(k?i<h:m<x)for(let K=G;K<=W;K++){const J=K*this._granularityCellSize;e.push(this._vertexToIndex(J,o+A*(J-i)/w))}else for(let K=W;K>=G;K--){const J=K*this._granularityCellSize;e.push(this._vertexToIndex(J,o+A*(J-i)/w))}}_generateInterEdgeVertices(e,i,o,h,p,m,x,w,A,k){const F=p-o,Z=m-h,G=x-p,W=(A-p)/G,K=(k-p)/G,J=Math.min(W,K),se=Math.max(W,K),ge=h+Z*J;let le=Math.floor(Math.min(ge,w)/this._granularityCellSize)+1,he=Math.ceil(Math.max(ge,w)/this._granularityCellSize)-1,xe=w<ge;const Ae=G===0;if(Ae&&(x===A||x===k))return;if(Ae||J>=1||se<=0){const ut=o-x,st=m+(i-m)*Math.min((A-x)/ut,(k-x)/ut);le=Math.floor(Math.min(st,w)/this._granularityCellSize)+1,he=Math.ceil(Math.max(st,w)/this._granularityCellSize)-1,xe=w<st}const He=F>0?k:A;if(xe)for(let ut=le;ut<=he;ut++)e.push(this._vertexToIndex(ut*this._granularityCellSize,He));else for(let ut=he;ut>=le;ut--)e.push(this._vertexToIndex(ut*this._granularityCellSize,He))}_generateOutline(e){const i=[];for(const o of e){const h=Cu(o,this._granularity,!0),p=this._pointArrayToIndices(h),m=[];for(let x=1;x<p.length;x++)m.push(p[x-1]),m.push(p[x]);i.push(m)}return i}_handlePoles(e){let i=!1,o=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(o=!0)),(i||o)&&this._fillPoles(e,i,o)}_ensureNoPoleVertices(){const e=this._vertexBuffer;for(let i=0;i<e.length;i+=2){const o=e[i+1];o===ks&&(e[i+1]=-32767),o===bl&&(e[i+1]=32766)}}_generatePoleQuad(e,i,o,h,p,m){h>p!=(m===ks)?(e.push(i),e.push(o),e.push(this._vertexToIndex(h,m)),e.push(o),e.push(this._vertexToIndex(p,m)),e.push(this._vertexToIndex(h,m))):(e.push(o),e.push(i),e.push(this._vertexToIndex(h,m)),e.push(this._vertexToIndex(p,m)),e.push(o),e.push(this._vertexToIndex(h,m)))}_fillPoles(e,i,o){const h=this._vertexBuffer,p=Yt,m=e.length;for(let x=2;x<m;x+=3){const w=e[x-2],A=e[x-1],k=e[x],F=h[2*w],Z=h[2*w+1],G=h[2*A],W=h[2*A+1],K=h[2*k],J=h[2*k+1];i&&(Z===0&&W===0&&this._generatePoleQuad(e,w,A,F,G,ks),W===0&&J===0&&this._generatePoleQuad(e,A,k,G,K,ks),J===0&&Z===0&&this._generatePoleQuad(e,k,w,K,F,ks)),o&&(Z===p&&W===p&&this._generatePoleQuad(e,w,A,F,G,bl),W===p&&J===p&&this._generatePoleQuad(e,A,k,G,K,bl),J===p&&Z===p&&this._generatePoleQuad(e,k,w,K,F,bl))}}_initializeVertices(e){for(let i=0;i<e.length;i+=2)this._vertexToIndex(e[i],e[i+1])}subdividePolygonInternal(e,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:o,holeIndices:h}=(function(x){const w=[],A=[];for(const k of x)if(k.length!==0){k!==x[0]&&w.push(A.length/2);for(let F=0;F<k.length;F++)A.push(k[F].x),A.push(k[F].y)}return{flattened:A,holeIndices:w}})(e);let p;this._initializeVertices(o);try{const x=(function(A,k,F=2){const Z=k&&k.length,G=Z?k[0]*F:A.length;let W=sf(A,0,G,F,!0);const K=[];if(!W||W.next===W.prev)return K;let J,se,ge;if(Z&&(W=(function(le,he,xe,Ae){const He=[];for(let ut=0,st=he.length;ut<st;ut++){const ft=sf(le,he[ut]*Ae,ut<st-1?he[ut+1]*Ae:le.length,Ae,!1);ft===ft.next&&(ft.steiner=!0),He.push(Lg(ft))}He.sort(kr);for(let ut=0;ut<He.length;ut++)xe=up(He[ut],xe);return xe})(A,k,W,F)),A.length>80*F){J=A[0],se=A[1];let le=J,he=se;for(let xe=F;xe<G;xe+=F){const Ae=A[xe],He=A[xe+1];Ae<J&&(J=Ae),He<se&&(se=He),Ae>le&&(le=Ae),He>he&&(he=He)}ge=Math.max(le-J,he-se),ge=ge!==0?32767/ge:0}return Gc(W,K,F,J,se,ge,0),K})(o,h),w=this._convertIndices(o,x);p=this._subdivideTrianglesScanline(w)}catch(x){console.error(x)}let m=[];return i&&(m=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(p),{verticesFlattened:this._vertexBuffer,indicesTriangles:p,indicesLineList:m}}_convertIndices(e,i){const o=[];for(let h=0;h<i.length;h++)o.push(this._vertexToIndex(e[2*i[h]],e[2*i[h]+1]));return o}_pointArrayToIndices(e){const i=[];for(let o=0;o<e.length;o++){const h=e[o];i.push(this._vertexToIndex(h.x,h.y))}return i}}function uf(n,e,i,o=!0){return new Su(i,e).subdividePolygonInternal(n,o)}function Cu(n,e,i=!1){if(!n||n.length<1)return[];if(n.length<2)return[];const o=n[0],h=n[n.length-1],p=i&&(o.x!==h.x||o.y!==h.y);if(e<2)return p?[...n,n[0]]:[...n];const m=Math.floor(Yt/e),x=[];x.push(new V(n[0].x,n[0].y));const w=n.length,A=p?w:w-1;for(let k=0;k<A;k++){const F=n[k],Z=k<w-1?n[k+1]:n[0],G=F.x,W=F.y,K=Z.x,J=Z.y,se=G!==K,ge=W!==J;if(!se&&!ge)continue;const le=K-G,he=J-W,xe=Math.abs(le),Ae=Math.abs(he);let He=G,ut=W;for(;;){const ft=le>0?(Math.floor(He/m)+1)*m:(Math.ceil(He/m)-1)*m,zt=he>0?(Math.floor(ut/m)+1)*m:(Math.ceil(ut/m)-1)*m,wt=Math.abs(He-ft),at=Math.abs(ut-zt),et=Math.abs(He-K),Ot=Math.abs(ut-J),Dt=se?wt/xe:Number.POSITIVE_INFINITY,Zt=ge?at/Ae:Number.POSITIVE_INFINITY;if((et<=wt||!se)&&(Ot<=at||!ge))break;if(Dt<Zt&&se||!ge){He=ft,ut+=he*Dt;const kt=new V(He,Math.round(ut));x[x.length-1].x===kt.x&&x[x.length-1].y===kt.y||x.push(kt)}else{He+=le*Zt,ut=zt;const kt=new V(Math.round(He),ut);x[x.length-1].x===kt.x&&x[x.length-1].y===kt.y||x.push(kt)}}const st=new V(K,J);x[x.length-1].x===st.x&&x[x.length-1].y===st.y||x.push(st)}return x}function wl(n,e,i){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let o=0,h=n[2*e[0]];for(let w=1;w<e.length;w++){const A=n[2*e[w]];A<h&&(h=A,o=w)}const p=e.length;let m=o,x=(m+1)%p;for(;;){const w=m-1>=0?m-1:p-1,A=(x+1)%p,k=n[2*e[w]],F=n[2*e[A]],Z=n[2*e[m]],G=n[2*e[m]+1],W=n[2*e[x]+1];let K=!1;if(k<F)K=!0;else if(k>F)K=!1;else{const J=W-G,se=-(n[2*e[x]]-Z),ge=G<W?1:-1;((k-Z)*J+(n[2*e[w]+1]-G)*se)*ge>((F-Z)*J+(n[2*e[A]+1]-G)*se)*ge&&(K=!0)}if(K){const J=e[w],se=e[m],ge=e[x];J!==se&&J!==ge&&se!==ge&&i.push(ge,se,J),m--,m<0&&(m=p-1)}else{const J=e[A],se=e[m],ge=e[x];J!==se&&J!==ge&&se!==ge&&i.push(ge,se,J),x++,x>=p&&(x=0)}if(w===A)break}}function dp(n,e,i,o,h,p,m,x,w){const A=h.length/2,k=m&&x&&w;if(A<Lt.MAX_VERTEX_ARRAY_LENGTH){const F=e.prepareSegment(A,i,o),Z=F.vertexLength;for(let K=0;K<p.length;K+=3)o.emplaceBack(Z+p[K],Z+p[K+1],Z+p[K+2]);let G,W;F.vertexLength+=A,F.primitiveLength+=p.length/3,k&&(W=m.prepareSegment(A,i,x),G=W.vertexLength,W.vertexLength+=A);for(let K=0;K<h.length;K+=2)n(h[K],h[K+1]);if(k)for(let K=0;K<w.length;K++){const J=w[K];for(let se=1;se<J.length;se+=2)x.emplaceBack(G+J[se-1],G+J[se]);W.primitiveLength+=J.length/2}}else(function(F,Z,G,W,K,J){const se=[];for(let Ae=0;Ae<W.length/2;Ae++)se.push(-1);const ge={count:0};let le=0,he=F.getOrCreateLatestSegment(Z,G),xe=he.vertexLength;for(let Ae=2;Ae<K.length;Ae+=3){const He=K[Ae-2],ut=K[Ae-1],st=K[Ae];let ft=se[He]<le,zt=se[ut]<le,wt=se[st]<le;he.vertexLength+((ft?1:0)+(zt?1:0)+(wt?1:0))>Lt.MAX_VERTEX_ARRAY_LENGTH&&(he=F.createNewSegment(Z,G),le=ge.count,ft=!0,zt=!0,wt=!0,xe=0);const at=Xl(se,W,J,ge,He,ft,he),et=Xl(se,W,J,ge,ut,zt,he),Ot=Xl(se,W,J,ge,st,wt,he);G.emplaceBack(xe+at-le,xe+et-le,xe+Ot-le),he.primitiveLength++}})(e,i,o,h,p,n),k&&(function(F,Z,G,W,K,J){const se=[];for(let Ae=0;Ae<W.length/2;Ae++)se.push(-1);const ge={count:0};let le=0,he=F.getOrCreateLatestSegment(Z,G),xe=he.vertexLength;for(let Ae=0;Ae<K.length;Ae++){const He=K[Ae];for(let ut=1;ut<K[Ae].length;ut+=2){const st=He[ut-1],ft=He[ut];let zt=se[st]<le,wt=se[ft]<le;he.vertexLength+((zt?1:0)+(wt?1:0))>Lt.MAX_VERTEX_ARRAY_LENGTH&&(he=F.createNewSegment(Z,G),le=ge.count,zt=!0,wt=!0,xe=0);const at=Xl(se,W,J,ge,st,zt,he),et=Xl(se,W,J,ge,ft,wt,he);G.emplaceBack(xe+at-le,xe+et-le),he.primitiveLength++}}})(m,i,x,h,w,n),e.forceNewSegmentOnNextPrepare(),m?.forceNewSegmentOnNextPrepare()}function Xl(n,e,i,o,h,p,m){if(p){const x=o.count;return i(e[2*h],e[2*h+1]),n[h]=o.count,o.count++,m.vertexLength++,x}return n[h]}class qc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new fe,this.indexArray=new Xe,this.indexArray2=new Mt,this.programConfigurations=new Zl(e.layers,e.zoom),this.segments=new Lt,this.segments2=new Lt,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.hasDependencies=lo("fill",this.layers,i);const h=this.layers[0].layout.get("fill-sort-key"),p=!h.isConstant(),m=[];for(const{feature:x,id:w,index:A,sourceLayerIndex:k}of e){const F=this.layers[0]._featureFilter.needGeometry,Z=oo(x,F);if(!this.layers[0]._featureFilter.filter(new an(this.zoom),Z,o))continue;const G=p?h.evaluate(Z,{},o,i.availableImages):void 0,W={id:w,properties:x.properties,type:x.type,sourceLayerIndex:k,index:A,geometry:F?Z.geometry:xl(x),patterns:{},sortKey:G};m.push(W)}p&&m.sort(((x,w)=>x.sortKey-w.sortKey));for(const x of m){const{geometry:w,index:A,sourceLayerIndex:k}=x;if(this.hasDependencies){const F=af("fill",this.layers,x,{zoom:this.zoom},i);this.patternFeatures.push(F)}else this.addFeature(x,w,A,o,{},i.subdivisionGranularity);i.featureIndex.insert(e[A].feature,w,A,k,this.index)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}addFeatures(e,i,o){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,o,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,od),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,i,o,h,p,m){for(const x of nl(i,500)){const w=uf(x,h,m.fill.getGranularityForZoomLevel(h.z)),A=this.layoutVertexArray;dp(((k,F)=>{A.emplaceBack(k,F)}),this.segments,this.layoutVertexArray,this.indexArray,w.verticesFlattened,w.indicesTriangles,this.segments2,this.indexArray2,w.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:p,canonical:h})}}let Mh,Hc;Nt("FillBucket",qc,{omit:["layers","patternFeatures"]});var Mm={get paint(){return Hc=Hc||new rr({"fill-antialias":new Ut(ke.paint_fill["fill-antialias"]),"fill-opacity":new $t(ke.paint_fill["fill-opacity"]),"fill-color":new $t(ke.paint_fill["fill-color"]),"fill-outline-color":new $t(ke.paint_fill["fill-outline-color"]),"fill-translate":new Ut(ke.paint_fill["fill-translate"]),"fill-translate-anchor":new Ut(ke.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ps(ke.paint_fill["fill-pattern"])})},get layout(){return Mh=Mh||new rr({"fill-sort-key":new $t(ke.layout_fill["fill-sort-key"])})}};class Em extends Gn{constructor(e,i){super(e,Mm,i)}recalculate(e,i){super.recalculate(e,i);const o=this.paint._values["fill-outline-color"];o.value.kind==="constant"&&o.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new qc(e)}queryRadius(){return ed(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:i,transform:o,pixelsToTileUnits:h}){return Xd(Wd(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-o.bearingInRadians,h),i)}isTileClipped(){return!0}}const fd=Fn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Am=Fn([{name:"a_centroid",components:2,type:"Int16"}],4),{members:cf}=fd;class Eh{constructor(e,i,o,h,p){this.properties={},this.extent=o,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=h,this._values=p,e.readFields(Dg,this,i)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const i=e.readVarint()+e.pos,o=[];let h,p=1,m=0,x=0,w=0;for(;e.pos<i;){if(m<=0){const A=e.readVarint();p=7&A,m=A>>3}if(m--,p===1||p===2)x+=e.readSVarint(),w+=e.readSVarint(),p===1&&(h&&o.push(h),h=[]),h&&h.push(new V(x,w));else{if(p!==7)throw new Error(`unknown command ${p}`);h&&h.push(h[0].clone())}}return h&&o.push(h),o}bbox(){const e=this._pbf;e.pos=this._geometry;const i=e.readVarint()+e.pos;let o=1,h=0,p=0,m=0,x=1/0,w=-1/0,A=1/0,k=-1/0;for(;e.pos<i;){if(h<=0){const F=e.readVarint();o=7&F,h=F>>3}if(h--,o===1||o===2)p+=e.readSVarint(),m+=e.readSVarint(),p<x&&(x=p),p>w&&(w=p),m<A&&(A=m),m>k&&(k=m);else if(o!==7)throw new Error(`unknown command ${o}`)}return[x,A,w,k]}toGeoJSON(e,i,o){const h=this.extent*Math.pow(2,o),p=this.extent*e,m=this.extent*i,x=this.loadGeometry();function w(Z){return[360*(Z.x+p)/h-180,360/Math.PI*Math.atan(Math.exp((1-2*(Z.y+m)/h)*Math.PI))-90]}function A(Z){return Z.map(w)}let k;if(this.type===1){const Z=[];for(const W of x)Z.push(W[0]);const G=A(Z);k=Z.length===1?{type:"Point",coordinates:G[0]}:{type:"MultiPoint",coordinates:G}}else if(this.type===2){const Z=x.map(A);k=Z.length===1?{type:"LineString",coordinates:Z[0]}:{type:"MultiLineString",coordinates:Z}}else{if(this.type!==3)throw new Error("unknown feature type");{const Z=Pm(x),G=[];for(const W of Z)G.push(W.map(A));k=G.length===1?{type:"Polygon",coordinates:G[0]}:{type:"MultiPolygon",coordinates:G}}}const F={type:"Feature",geometry:k,properties:this.properties};return this.id!=null&&(F.id=this.id),F}}function Dg(n,e,i){n===1?e.id=i.readVarint():n===2?(function(o,h){const p=o.readVarint()+o.pos;for(;o.pos<p;){const m=h._keys[o.readVarint()],x=h._values[o.readVarint()];h.properties[m]=x}})(i,e):n===3?e.type=i.readVarint():n===4&&(e._geometry=i.pos)}function Pm(n){const e=n.length;if(e<=1)return[n];const i=[];let o,h;for(let p=0;p<e;p++){const m=gn(n[p]);m!==0&&(h===void 0&&(h=m<0),h===m<0?(o&&i.push(o),o=[n[p]]):o&&o.push(n[p]))}return o&&i.push(o),i}function gn(n){let e=0;for(let i,o,h=0,p=n.length,m=p-1;h<p;m=h++)i=n[h],o=n[m],e+=(o.x-i.x)*(i.y+o.y);return e}Eh.types=["Unknown","Point","LineString","Polygon"];class Un{constructor(e,i){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Zi,this,i),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const i=this._pbf.readVarint()+this._pbf.pos;return new Eh(this._pbf,i,this.extent,this._keys,this._values)}}function Zi(n,e,i){n===15?e.version=i.readVarint():n===1?e.name=i.readString():n===5?e.extent=i.readVarint():n===2?e._features.push(i.pos):n===3?e._keys.push(i.readString()):n===4&&e._values.push((function(o){let h=null;const p=o.readVarint()+o.pos;for(;o.pos<p;){const m=o.readVarint()>>3;h=m===1?o.readString():m===2?o.readFloat():m===3?o.readDouble():m===4?o.readVarint64():m===5?o.readVarint():m===6?o.readSVarint():m===7?o.readBoolean():null}if(h==null)throw new Error("unknown feature value");return h})(i))}class Gi{constructor(e,i){this.layers=e.readFields(Cn,{},i)}}function Cn(n,e,i){if(n===3){const o=new Un(i,i.readVarint()+i.pos);o.length&&(e[o.name]=o)}}const hs=Math.pow(2,13);function Zo(n,e,i,o,h,p,m,x){n.emplaceBack(e,i,2*Math.floor(o*hs)+m,h*hs*2,p*hs*2,Math.round(x))}class sc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new _e,this.centroidVertexArray=new de,this.indexArray=new Xe,this.programConfigurations=new Zl(e.layers,e.zoom),this.segments=new Lt,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.features=[],this.hasDependencies=lo("fill-extrusion",this.layers,i);for(const{feature:h,id:p,index:m,sourceLayerIndex:x}of e){const w=this.layers[0]._featureFilter.needGeometry,A=oo(h,w);if(!this.layers[0]._featureFilter.filter(new an(this.zoom),A,o))continue;const k={id:p,sourceLayerIndex:x,index:m,geometry:w?A.geometry:xl(h),properties:h.properties,type:h.type,patterns:{}};this.hasDependencies?this.features.push(af("fill-extrusion",this.layers,k,{zoom:this.zoom},i)):this.addFeature(k,k.geometry,m,o,{},i.subdivisionGranularity),i.featureIndex.insert(h,k.geometry,m,x,this.index,!0)}}addFeatures(e,i,o){for(const h of this.features){const{geometry:p}=h;this.addFeature(h,p,h.index,i,o,e.subdivisionGranularity)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cf),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Am.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,i,o,h,p,m){for(const x of nl(i,500)){const w={x:0,y:0,sampleCount:0},A=this.layoutVertexArray.length;this.processPolygon(w,h,e,x,m);const k=this.layoutVertexArray.length-A,F=Math.floor(w.x/w.sampleCount),Z=Math.floor(w.y/w.sampleCount);for(let G=0;G<k;G++)this.centroidVertexArray.emplaceBack(F,Z)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:p,canonical:h})}processPolygon(e,i,o,h,p){if(h.length<1||hr(h[0]))return;for(const F of h)F.length!==0&&fp(e,F);const m={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},x=p.fill.getGranularityForZoomLevel(i.z),w=Eh.types[o.type]==="Polygon";for(const F of h){if(F.length===0||hr(F))continue;const Z=Cu(F,x,w);this._generateSideFaces(Z,m)}if(!w)return;const A=uf(h,i,x,!1),k=this.layoutVertexArray;dp(((F,Z)=>{Zo(k,F,Z,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,A.verticesFlattened,A.indicesTriangles)}_generateSideFaces(e,i){let o=0;for(let h=1;h<e.length;h++){const p=e[h],m=e[h-1];if(Mu(p,m))continue;i.segment.vertexLength+4>Lt.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const x=p.sub(m)._perp()._unit(),w=m.dist(p);o+w>32768&&(o=0),Zo(this.layoutVertexArray,p.x,p.y,x.x,x.y,0,0,o),Zo(this.layoutVertexArray,p.x,p.y,x.x,x.y,0,1,o),o+=w,Zo(this.layoutVertexArray,m.x,m.y,x.x,x.y,0,0,o),Zo(this.layoutVertexArray,m.x,m.y,x.x,x.y,0,1,o);const A=i.segment.vertexLength;this.indexArray.emplaceBack(A,A+2,A+1),this.indexArray.emplaceBack(A+1,A+2,A+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function fp(n,e){for(let i=0;i<e.length;i++){const o=e[i];i===e.length-1&&e[0].x===o.x&&e[0].y===o.y||(n.x+=o.x,n.y+=o.y,n.sampleCount++)}}function Mu(n,e){return n.x===e.x&&(n.x<0||n.x>Yt)||n.y===e.y&&(n.y<0||n.y>Yt)}function hr(n){return n.every((e=>e.x<0))||n.every((e=>e.x>Yt))||n.every((e=>e.y<0))||n.every((e=>e.y>Yt))}let Eu;Nt("FillExtrusionBucket",sc,{omit:["layers","features"]});var $c={get paint(){return Eu=Eu||new rr({"fill-extrusion-opacity":new Ut(ke["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $t(ke["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ut(ke["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ut(ke["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ps(ke["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $t(ke["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $t(ke["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ut(ke["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class pp extends Gn{constructor(e,i){super(e,$c,i)}createBucket(e){return new sc(e)}queryRadius(){return ed(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:h,transform:p,pixelsToTileUnits:m,pixelPosMatrix:x}){const w=Wd(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-p.bearingInRadians,m),A=this.paint.get("fill-extrusion-height").evaluate(i,o),k=this.paint.get("fill-extrusion-base").evaluate(i,o),F=(function(G,W){const K=[];for(const J of G){const se=[J.x,J.y,0,1];ii(se,se,W),K.push(new V(se[0]/se[3],se[1]/se[3]))}return K})(w,x),Z=(function(G,W,K,J){const se=[],ge=[],le=J[8]*W,he=J[9]*W,xe=J[10]*W,Ae=J[11]*W,He=J[8]*K,ut=J[9]*K,st=J[10]*K,ft=J[11]*K;for(const zt of G){const wt=[],at=[];for(const et of zt){const Ot=et.x,Dt=et.y,Zt=J[0]*Ot+J[4]*Dt+J[12],kt=J[1]*Ot+J[5]*Dt+J[13],ti=J[2]*Ot+J[6]*Dt+J[14],Yi=J[3]*Ot+J[7]*Dt+J[15],Ri=ti+xe,Jn=Yi+Ae,Za=Zt+He,Fr=kt+ut,er=ti+st,Hn=Yi+ft,hn=new V((Zt+le)/Jn,(kt+he)/Jn);hn.z=Ri/Jn,wt.push(hn);const dr=new V(Za/Hn,Fr/Hn);dr.z=er/Hn,at.push(dr)}se.push(wt),ge.push(at)}return[se,ge]})(h,k,A,x);return(function(G,W,K){let J=1/0;Xd(K,W)&&(J=Xc(K,W[0]));for(let se=0;se<W.length;se++){const ge=W[se],le=G[se];for(let he=0;he<ge.length-1;he++){const xe=ge[he],Ae=[xe,ge[he+1],le[he+1],le[he],xe];Zc(K,Ae)&&(J=Math.min(J,Xc(K,Ae)))}}return J!==1/0&&J})(Z[0],Z[1],F)}}function La(n,e){return n.x*e.x+n.y*e.y}function Xc(n,e){if(n.length===1){let i=0;const o=e[i++];let h;for(;!h||o.equals(h);)if(h=e[i++],!h)return 1/0;for(;i<e.length;i++){const p=e[i],m=n[0],x=h.sub(o),w=p.sub(o),A=m.sub(o),k=La(x,x),F=La(x,w),Z=La(w,w),G=La(A,x),W=La(A,w),K=k*Z-F*F,J=(Z*G-F*W)/K,se=(k*W-F*G)/K,ge=o.z*(1-J-se)+h.z*J+p.z*se;if(isFinite(ge))return ge}return 1/0}{let i=1/0;for(const o of e)i=Math.min(i,o.z);return i}}const pd=Fn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Rs}=pd,mp=Fn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:hf}=mp,zm=Math.cos(Math.PI/180*37.5),md=Math.pow(2,14)/.5;class Ah{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((i=>{this.gradients[i.id]={}})),this.layoutVertexArray=new Me,this.layoutVertexArray2=new me,this.indexArray=new Xe,this.programConfigurations=new Zl(e.layers,e.zoom),this.segments=new Lt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.hasDependencies=lo("line",this.layers,i)||this.hasLineDasharray(this.layers);const h=this.layers[0].layout.get("line-sort-key"),p=!h.isConstant(),m=[];for(const{feature:x,id:w,index:A,sourceLayerIndex:k}of e){const F=this.layers[0]._featureFilter.needGeometry,Z=oo(x,F);if(!this.layers[0]._featureFilter.filter(new an(this.zoom),Z,o))continue;const G=p?h.evaluate(Z,{},o):void 0,W={id:w,properties:x.properties,type:x.type,sourceLayerIndex:k,index:A,geometry:F?Z.geometry:xl(x),patterns:{},dashes:{},sortKey:G};m.push(W)}p&&m.sort(((x,w)=>x.sortKey-w.sortKey));for(const x of m){const{geometry:w,index:A,sourceLayerIndex:k}=x;this.hasDependencies?(lo("line",this.layers,i)?af("line",this.layers,x,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,x,this.zoom,i),this.patternFeatures.push(x)):this.addFeature(x,w,A,o,{},{},i.subdivisionGranularity),i.featureIndex.insert(e[A].feature,w,A,k,this.index)}}update(e,i,o,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o,dashPositions:h})}addFeatures(e,i,o,h){for(const p of this.patternFeatures)this.addFeature(p,p.geometry,p.index,i,o,h,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,hf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Rs),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,o,h,p,m,x){const w=this.layers[0].layout,A=w.get("line-join").evaluate(e,{}),k=w.get("line-cap"),F=w.get("line-miter-limit"),Z=w.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const G of i)this.addLine(G,e,A,k,F,Z,h,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:p,dashPositions:m,canonical:h})}addLine(e,i,o,h,p,m,x,w){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=Cu(e,x?w.line.getGranularityForZoomLevel(x.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let le=0;le<e.length-1;le++)this.totalDistance+=e[le].dist(e[le+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const A=Eh.types[i.type]==="Polygon";let k=e.length;for(;k>=2&&e[k-1].equals(e[k-2]);)k--;let F=0;for(;F<k-1&&e[F].equals(e[F+1]);)F++;if(k<(A?3:2))return;o==="bevel"&&(p=1.05);const Z=this.overscaling<=16?122880/(512*this.overscaling):0,G=this.segments.prepareSegment(10*k,this.layoutVertexArray,this.indexArray);let W,K,J,se,ge;this.e1=this.e2=-1,A&&(W=e[k-2],ge=e[F].sub(W)._unit()._perp());for(let le=F;le<k;le++){if(J=le===k-1?A?e[F+1]:void 0:e[le+1],J&&e[le].equals(J))continue;ge&&(se=ge),W&&(K=W),W=e[le],ge=J?J.sub(W)._unit()._perp():se,se=se||ge;let he=se.add(ge);he.x===0&&he.y===0||he._unit();const xe=se.x*ge.x+se.y*ge.y,Ae=he.x*ge.x+he.y*ge.y,He=Ae!==0?1/Ae:1/0,ut=2*Math.sqrt(2-2*Ae),st=Ae<zm&&K&&J,ft=se.x*ge.y-se.y*ge.x>0;if(st&&le>F){const at=W.dist(K);if(at>2*Z){const et=W.sub(W.sub(K)._mult(Z/at)._round());this.updateDistance(K,et),this.addCurrentVertex(et,se,0,0,G),K=et}}const zt=K&&J;let wt=zt?o:A?"butt":h;if(zt&&wt==="round"&&(He<m?wt="miter":He<=2&&(wt="fakeround")),wt==="miter"&&He>p&&(wt="bevel"),wt==="bevel"&&(He>2&&(wt="flipbevel"),He<p&&(wt="miter")),K&&this.updateDistance(K,W),wt==="miter")he._mult(He),this.addCurrentVertex(W,he,0,0,G);else if(wt==="flipbevel"){if(He>100)he=ge.mult(-1);else{const at=He*se.add(ge).mag()/se.sub(ge).mag();he._perp()._mult(at*(ft?-1:1))}this.addCurrentVertex(W,he,0,0,G),this.addCurrentVertex(W,he.mult(-1),0,0,G)}else if(wt==="bevel"||wt==="fakeround"){const at=-Math.sqrt(He*He-1),et=ft?at:0,Ot=ft?0:at;if(K&&this.addCurrentVertex(W,se,et,Ot,G),wt==="fakeround"){const Dt=Math.round(180*ut/Math.PI/20);for(let Zt=1;Zt<Dt;Zt++){let kt=Zt/Dt;if(kt!==.5){const Yi=kt-.5;kt+=kt*Yi*(kt-1)*((1.0904+xe*(xe*(3.55645-1.43519*xe)-3.2452))*Yi*Yi+(.848013+xe*(.215638*xe-1.06021)))}const ti=ge.sub(se)._mult(kt)._add(se)._unit()._mult(ft?-1:1);this.addHalfVertex(W,ti.x,ti.y,!1,ft,0,G)}}J&&this.addCurrentVertex(W,ge,-et,-Ot,G)}else if(wt==="butt")this.addCurrentVertex(W,he,0,0,G);else if(wt==="square"){const at=K?1:-1;this.addCurrentVertex(W,he,at,at,G)}else wt==="round"&&(K&&(this.addCurrentVertex(W,se,0,0,G),this.addCurrentVertex(W,se,1,1,G,!0)),J&&(this.addCurrentVertex(W,ge,-1,-1,G,!0),this.addCurrentVertex(W,ge,0,0,G)));if(st&&le<k-1){const at=W.dist(J);if(at>
232*Z){const et=W.add(J.sub(W)._mult(Z/at)._round());this.updateDistance(W,et),this.addCurrentVertex(et,ge,0,0,G),W=et}}}}addCurrentVertex(e,i,o,h,p,m=!1){const x=i.y*h-i.x,w=-i.y-i.x*h;this.addHalfVertex(e,i.x+i.y*o,i.y-i.x*o,m,!1,o,p),this.addHalfVertex(e,x,w,m,!0,-h,p),this.distance>md/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,i,o,h,p,m))}addHalfVertex({x:e,y:i},o,h,p,m,x,w){const A=.5*(this.lineClips?this.scaledDistance*(md-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(i<<1)+(m?1:0),Math.round(63*o)+128,Math.round(63*h)+128,1+(x===0?0:x<0?-1:1)|(63&A)<<2,A>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const k=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,k,this.e2),w.primitiveLength++),m?this.e2=k:this.e1=k}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}hasLineDasharray(e){for(const i of e){const o=i.paint.get("line-dasharray");if(o&&!o.isConstant())return!0}return!1}addLineDashDependencies(e,i,o,h){for(const p of e){const m=p.paint.get("line-dasharray");if(!m||m.value.kind==="constant")continue;const x=p.layout.get("line-cap")==="round",w={dasharray:m.value.evaluate({zoom:o-1},i,{}),round:x},A={dasharray:m.value.evaluate({zoom:o},i,{}),round:x},k={dasharray:m.value.evaluate({zoom:o+1},i,{}),round:x},F=`${w.dasharray.join(",")},${w.round}`,Z=`${A.dasharray.join(",")},${A.round}`,G=`${k.dasharray.join(",")},${k.round}`;h.dashDependencies[F]=w,h.dashDependencies[Z]=A,h.dashDependencies[G]=k,i.dashes[p.id]={min:F,mid:Z,max:G}}}}let Au,Or;Nt("LineBucket",Ah,{omit:["layers","patternFeatures"]});var Pu={get paint(){return Or=Or||new rr({"line-opacity":new $t(ke.paint_line["line-opacity"]),"line-color":new $t(ke.paint_line["line-color"]),"line-translate":new Ut(ke.paint_line["line-translate"]),"line-translate-anchor":new Ut(ke.paint_line["line-translate-anchor"]),"line-width":new $t(ke.paint_line["line-width"]),"line-gap-width":new $t(ke.paint_line["line-gap-width"]),"line-offset":new $t(ke.paint_line["line-offset"]),"line-blur":new $t(ke.paint_line["line-blur"]),"line-dasharray":new Ps(ke.paint_line["line-dasharray"]),"line-pattern":new Ps(ke.paint_line["line-pattern"]),"line-gradient":new Oc(ke.paint_line["line-gradient"])})},get layout(){return Au=Au||new rr({"line-cap":new Ut(ke.layout_line["line-cap"]),"line-join":new $t(ke.layout_line["line-join"]),"line-miter-limit":new Ut(ke.layout_line["line-miter-limit"]),"line-round-limit":new Ut(ke.layout_line["line-round-limit"]),"line-sort-key":new $t(ke.layout_line["line-sort-key"])})}};class Ph extends $t{possiblyEvaluate(e,i){return i=new an(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,o,h){return i=wi({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,o,h)}}let Go;class gp extends Gn{constructor(e,i){super(e,Pu,i),this.gradientVersion=0,Go||(Go=new Ph(Pu.paint.properties["line-width"].specification),Go.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const i=this.gradientExpression();this.stepInterpolant=!!(function(o){return o._styleExpression!==void 0})(i)&&i._styleExpression.expression instanceof To,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,i){super.recalculate(e,i),this.paint._values["line-floorwidth"]=Go.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Ah(e)}queryRadius(e){const i=e,o=df(bu("line-width",this,i),bu("line-gap-width",this,i)),h=bu("line-offset",this,i);return o/2+Math.abs(h)+ed(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:h,transform:p,pixelsToTileUnits:m}){const x=Wd(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-p.bearingInRadians,m),w=m/2*df(this.paint.get("line-width").evaluate(i,o),this.paint.get("line-gap-width").evaluate(i,o)),A=this.paint.get("line-offset").evaluate(i,o);return A&&(h=(function(k,F){const Z=[];for(let G=0;G<k.length;G++){const W=Kd(k[G]),K=[];for(let J=0;J<W.length;J++){const se=W[J],ge=W[J-1],le=W[J+1],he=J===0?new V(0,0):se.sub(ge)._unit()._perp(),xe=J===W.length-1?new V(0,0):le.sub(se)._unit()._perp(),Ae=he._add(xe)._unit(),He=Ae.x*xe.x+Ae.y*xe.y;He!==0&&Ae._mult(1/He),K.push(Ae._mult(F)._add(se))}Z.push(K)}return Z})(h,A*m)),(function(k,F,Z){for(let G=0;G<F.length;G++){const W=F[G];if(k.length>=3){for(let K=0;K<W.length;K++)if(ql(k,W[K]))return!0}if(Ir(k,W,Z))return!0}return!1})(x,h,w)}isTileClipped(){return!0}}function df(n,e){return e>0?e+2*n:n}const Lm=Fn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gd=Fn([{name:"a_projected_pos",components:3,type:"Float32"}],4);Fn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const _p=Fn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Fn([{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 Os=Fn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Dm=Fn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Bs(n,e,i){return n.sections.forEach((o=>{o.text=(function(h,p,m){const x=p.layout.get("text-transform").evaluate(m,{});return x==="uppercase"?h=h.toLocaleUpperCase():x==="lowercase"&&(h=h.toLocaleLowerCase()),As.applyArabicShaping&&(h=As.applyArabicShaping(h)),h})(o.text,e,i)})),n}Fn([{name:"triangle",components:3,type:"Uint16"}]),Fn([{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"}]),Fn([{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"}]),Fn([{type:"Float32",name:"offsetX"}]),Fn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Fn([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Ar=24;const zh={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ig={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},oc={40:!0};function _d(n,e,i,o,h,p){if("fontStack"in e){const m=i[e.fontStack],x=m&&m[n];return x?x.metrics.advance*e.scale+h:0}{const m=o[e.imageName];return m?m.displaySize[0]*e.scale*Ar/p+h:0}}function ff(n,e,i,o){const h=Math.pow(n-e,2);return o?n<e?h/2:2*h:h+Math.abs(i)*i}function Lh(n,e,i){let o=0;return n===10&&(o-=1e4),i&&(o+=150),n!==40&&n!==65288||(o+=50),e!==41&&e!==65289||(o+=50),o}function yp(n,e,i,o,h,p){let m=null,x=ff(e,i,h,p);for(const w of o){const A=ff(e-w.x,i,h,p)+w.badness;A<=x&&(m=w,x=A)}return{index:n,x:e,priorBreak:m,badness:x}}function vp(n){return n?vp(n.priorBreak).concat(n.index):[]}class Yc{constructor(e="",i=[],o=[]){this.text=e,this.sections=i,this.sectionIndex=o,this.imageSectionID=null}static fromFeature(e,i){const o=new Yc;for(let h=0;h<e.sections.length;h++){const p=e.sections[h];p.image?o.addImageSection(p):o.addTextSection(p,i)}return o}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=(function(e){let i="",o={premature:!0,value:void 0};const h=e[Symbol.iterator]();let p=h.next();const m=e[Symbol.iterator]();m.next();let x=m.next();for(;!p.done;)i+=!x.done&&No(x.value.codePointAt(0))&&!zh[x.value]||!o.premature&&No(o.value.codePointAt(0))&&!zh[o.value]||!zh[p.value]?p.value:zh[p.value],o={value:p.value,premature:!1},p=h.next(),x=m.next();return i})(this.text)}hasZeroWidthSpaces(){return this.text.includes("​")}trim(){const e=this.text.match(/^\s*/),i=e?e[0].length:0,o=this.text.match(/\S\s*$/),h=o?o[0].length-1:0;this.text=this.text.substring(i,this.text.length-h),this.sectionIndex=this.sectionIndex.slice(i,this.sectionIndex.length-h)}substring(e,i){const o=[...this.text].slice(e,i).join(""),h=this.sectionIndex.slice(e,i);return new Yc(o,this.sections,h)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,i)=>Math.max(e,this.sections[i].scale)),0)}getMaxImageSize(e){let i=0,o=0;for(let h=0;h<this.length();h++){const p=this.getSection(h);if("imageName"in p){const m=e[p.imageName];if(!m)continue;const x=m.displaySize;i=Math.max(i,x[0]),o=Math.max(o,x[1])}}return{maxImageWidth:i,maxImageHeight:o}}addTextSection(e,i){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i});const o=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>o)))}addImageSection(e){const i=e.image?e.image.name:"";if(i.length===0)return void En("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this.sectionIndex.push(this.sections.length-1)):En("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,o,h,p){const m=[],x=this.determineAverageLineWidth(e,i,o,h,p),w=this.hasZeroWidthSpaces();let A=0,k=0;const F=this.text[Symbol.iterator]();let Z=F.next();const G=this.text[Symbol.iterator]();G.next();let W=G.next();const K=this.text[Symbol.iterator]();K.next(),K.next();let J=K.next();for(;!Z.done;){const se=this.getSection(k),ge=Z.value.codePointAt(0);if(Lc(ge)||(A+=_d(ge,se,o,h,e,p)),!W.done){const le=Ro(ge),he=W.value.codePointAt(0);(Ig[ge]||le||"imageName"in se||!J.done&&oc[he])&&m.push(yp(k+1,A,x,m,Lh(ge,he,le&&w),!1))}k++,Z=F.next(),W=G.next(),J=K.next()}return vp(yp(this.length(),A,x,m,0,!0))}determineAverageLineWidth(e,i,o,h,p){let m=0,x=0;for(const w of this.text){const A=this.getSection(x);m+=_d(w.codePointAt(0),A,o,h,e,p),x++}return m/Math.max(1,Math.ceil(m/i))}}const pf=4294967296,yd=1/pf,mf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class gf{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,i,o=this.length){for(;this.pos<o;
vendor: 12,007 bytes, line 23
23){const h=this.readVarint(),p=h>>3,m=this.pos;this.type=7&h,e(p,i,this),this.pos===m&&this.skip(h)}return i}readMessage(e,i){return this.readFields(e,i,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*pf;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*pf;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const i=this.buf;let o,h;return h=i[this.pos++],o=127&h,h<128?o:(h=i[this.pos++],o|=(127&h)<<7,h<128?o:(h=i[this.pos++],o|=(127&h)<<14,h<128?o:(h=i[this.pos++],o|=(127&h)<<21,h<128?o:(h=i[this.pos],o|=(15&h)<<28,(function(p,m,x){const w=x.buf;let A,k;if(k=w[x.pos++],A=(112&k)>>4,k<128||(k=w[x.pos++],A|=(127&k)<<3,k<128)||(k=w[x.pos++],A|=(127&k)<<10,k<128)||(k=w[x.pos++],A|=(127&k)<<17,k<128)||(k=w[x.pos++],A|=(127&k)<<24,k<128)||(k=w[x.pos++],A|=(1&k)<<31,k<128))return Dh(p,A,m);throw new Error("Expected varint not more than 10 bytes")})(o,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,i=this.pos;return this.pos=e,e-i>=12&&mf?mf.decode(this.buf.subarray(i,e)):(function(o,h,p){let m="",x=h;for(;x<p;){const w=o[x];let A,k,F,Z=null,G=w>239?4:w>223?3:w>191?2:1;if(x+G>p)break;G===1?w<128&&(Z=w):G===2?(A=o[x+1],(192&A)==128&&(Z=(31&w)<<6|63&A,Z<=127&&(Z=null))):G===3?(A=o[x+1],k=o[x+2],(192&A)==128&&(192&k)==128&&(Z=(15&w)<<12|(63&A)<<6|63&k,(Z<=2047||Z>=55296&&Z<=57343)&&(Z=null))):G===4&&(A=o[x+1],k=o[x+2],F=o[x+3],(192&A)==128&&(192&k)==128&&(192&F)==128&&(Z=(15&w)<<18|(63&A)<<12|(63&k)<<6|63&F,(Z<=65535||Z>=1114112)&&(Z=null))),Z===null?(Z=65533,G=1):Z>65535&&(Z-=65536,m+=String.fromCharCode(Z>>>10&1023|55296),Z=56320|1023&Z),m+=String.fromCharCode(Z),x+=G}return m})(this.buf,i,e)}readBytes(){const e=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,e);return this.pos=e,i}readPackedVarint(e=[],i){const o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(i));return e}readPackedSVarint(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){const i=7&e;if(i===0)for(;this.buf[this.pos++]>127;);else if(i===2)this.pos=this.readVarint()+this.pos;else if(i===5)this.pos+=4;else{if(i!==1)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}writeTag(e,i){this.writeVarint(e<<3|i)}realloc(e){let i=this.length||16;for(;i<this.pos+e;)i*=2;if(i!==this.length){const o=new Uint8Array(i);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=i}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*yd),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*yd),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?(function(i,o){let h,p;if(i>=0?(h=i%4294967296|0,p=i/4294967296|0):(h=~(-i%4294967296),p=~(-i/4294967296),4294967295^h?h=h+1|0:(h=0,p=p+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");o.realloc(10),(function(m,x,w){w.buf[w.pos++]=127&m|128,m>>>=7,w.buf[w.pos++]=127&m|128,m>>>=7,w.buf[w.pos++]=127&m|128,m>>>=7,w.buf[w.pos++]=127&m|128,w.buf[w.pos]=127&(m>>>=7)})(h,0,o),(function(m,x){const w=(7&m)<<4;x.buf[x.pos++]|=w|((m>>>=3)?128:0),m&&(x.buf[x.pos++]=127&m|((m>>>=7)?128:0),m&&(x.buf[x.pos++]=127&m|((m>>>=7)?128:0),m&&(x.buf[x.pos++]=127&m|((m>>>=7)?128:0),m&&(x.buf[x.pos++]=127&m|((m>>>=7)?128:0),m&&(x.buf[x.pos++]=127&m)))))})(p,o)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const i=this.pos;this.pos=(function(h,p,m){for(let x,w,A=0;A<p.length;A++){if(x=p.charCodeAt(A),x>55295&&x<57344){if(!w){x>56319||A+1===p.length?(h[m++]=239,h[m++]=191,h[m++]=189):w=x;continue}if(x<56320){h[m++]=239,h[m++]=191,h[m++]=189,w=x;continue}x=w-55296<<10|x-56320|65536,w=null}else w&&(h[m++]=239,h[m++]=191,h[m++]=189,w=null);x<128?h[m++]=x:(x<2048?h[m++]=x>>6|192:(x<65536?h[m++]=x>>12|224:(h[m++]=x>>18|240,h[m++]=x>>12&63|128),h[m++]=x>>6&63|128),h[m++]=63&x|128)}return m})(this.buf,e,this.pos);const o=this.pos-i;o>=128&&Im(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const i=e.length;this.writeVarint(i),this.realloc(i);for(let o=0;o<i;o++)this.buf[this.pos++]=e[o]}writeRawMessage(e,i){this.pos++;const o=this.pos;e(i,this);const h=this.pos-o;h>=128&&Im(o,h,this),this.pos=o-1,this.writeVarint(h),this.pos+=h}writeMessage(e,i,o){this.writeTag(e,2),this.writeRawMessage(i,o)}writePackedVarint(e,i){i.length&&this.writeMessage(e,km,i)}writePackedSVarint(e,i){i.length&&this.writeMessage(e,Rm,i)}writePackedBoolean(e,i){i.length&&this.writeMessage(e,Om,i)}writePackedFloat(e,i){i.length&&this.writeMessage(e,Ih,i)}writePackedDouble(e,i){i.length&&this.writeMessage(e,_f,i)}writePackedFixed32(e,i){i.length&&this.writeMessage(e,Bm,i)}writePackedSFixed32(e,i){i.length&&this.writeMessage(e,Nm,i)}writePackedFixed64(e,i){i.length&&this.writeMessage(e,Fm,i)}writePackedSFixed64(e,i){i.length&&this.writeMessage(e,jm,i)}writeBytesField(e,i){this.writeTag(e,2),this.writeBytes(i)}writeFixed32Field(e,i){this.writeTag(e,5),this.writeFixed32(i)}writeSFixed32Field(e,i){this.writeTag(e,5),this.writeSFixed32(i)}writeFixed64Field(e,i){this.writeTag(e,1),this.writeFixed64(i)}writeSFixed64Field(e,i){this.writeTag(e,1),this.writeSFixed64(i)}writeVarintField(e,i){this.writeTag(e,0),this.writeVarint(i)}writeSVarintField(e,i){this.writeTag(e,0),this.writeSVarint(i)}writeStringField(e,i){this.writeTag(e,2),this.writeString(i)}writeFloatField(e,i){this.writeTag(e,5),this.writeFloat(i)}writeDoubleField(e,i){this.writeTag(e,1),this.writeDouble(i)}writeBooleanField(e,i){this.writeVarintField(e,+i)}}function Dh(n,e,i){return i?4294967296*e+(n>>>0):4294967296*(e>>>0)+(n>>>0)}function Im(n,e,i){const o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(let h=i.pos-1;h>=n;h--)i.buf[h+o]=i.buf[h]}function km(n,e){for(let i=0;i<n.length;i++)e.writeVarint(n[i])}function Rm(n,e){for(let i=0;i<n.length;i++)e.writeSVarint(n[i])}function Ih(n,e){for(let i=0;i<n.length;i++)e.writeFloat(n[i])}function _f(n,e){for(let i=0;i<n.length;i++)e.writeDouble(n[i])}function Om(n,e){for(let i=0;i<n.length;i++)e.writeBoolean(n[i])}function Bm(n,e){for(let i=0;i<n.length;i++)e.writeFixed32(n[i])}function Nm(n,e){for(let i=0;i<n.length;i++)e.writeSFixed32(n[i])}function Fm(n,e){for(let i=0;i<n.length;i++)e.writeFixed64(n[i])}function jm(n,e){for(let i=0;i<n.length;i++)e.writeSFixed64(n[i])}function Um(n,e,i){n===1&&i.readMessage(yf,e)}function yf(n,e,i){if(n===3){const{id:o,bitmap:h,width:p,height:m,left:x,top:w,advance:A}=i.readMessage(Vm,{});e.push({id:o,bitmap:new nd({width:p+6,height:m+6},h),metrics:{width:p,height:m,left:x,top:w,advance:A}})}}function Vm(n,e,i){n===1?e.id=i.readVarint():n===2?e.bitmap=i.readBytes():n===3?e.width=i.readVarint():n===4?e.height=i.readVarint():n===5?e.left=i.readSVarint():n===6?e.top=i.readSVarint():n===7&&(e.advance=i.readVarint())}function xp(n){let e=0,i=0;for(const m of n)e+=m.w*m.h,i=Math.max(i,m.w);n.sort(((m,x)=>x.h-m.h));const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let h=0,p=0;for(const m of n)for(let x=o.length-1;x>=0;x--){const w=o[x];if(!(m.w>w.w||m.h>w.h)){if(m.x=w.x,m.y=w.y,p=Math.max(p,m.y+m.h),h=Math.max(h,m.x+m.w),m.w===w.w&&m.h===w.h){const A=o.pop();A&&x<o.length&&(o[x]=A)}else m.h===w.h?(w.x+=m.w,w.w-=m.w):m.w===w.w?(w.y+=m.h,w.h-=m.h):(o.push({x:w.x+m.w,y:w.y,w:w.w-m.w,h:m.h}),w.y+=m.h,w.h-=m.h);break}}return{w:h,h:p,fill:e/(h*p)||0}}class _n{constructor(e,{pixelRatio:i,version:o,stretchX:h,stretchY:p,content:m,textFitWidth:x,textFitHeight:w}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=h,this.stretchY=p,this.content=m,this.version=o,this.textFitWidth=x,this.textFitHeight=w}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class vf{constructor(e,i){const o={},h={};this.haveRenderCallbacks=[];const p=[];this.addImages(e,o,p),this.addImages(i,h,p);const{w:m,h:x}=xp(p),w=new Fa({width:m||1,height:x||1});for(const A in e){const k=e[A],F=o[A].paddedRect;Fa.copy(k.data,w,{x:0,y:0},{x:F.x+1,y:F.y+1},k.data)}for(const A in i){const k=i[A],F=h[A].paddedRect,Z=F.x+1,G=F.y+1,W=k.data.width,K=k.data.height;Fa.copy(k.data,w,{x:0,y:0},{x:Z,y:G},k.data),Fa.copy(k.data,w,{x:0,y:K-1},{x:Z,y:G-1},{width:W,height:1}),Fa.copy(k.data,w,{x:0,y:0},{x:Z,y:G+K},{width:W,height:1}),Fa.copy(k.data,w,{x:W-1,y:0},{x:Z-1,y:G},{width:1,height:K}),Fa.copy(k.data,w,{x:0,y:0},{x:Z+W,y:G},{width:1,height:K})}this.image=w,this.iconPositions=o,this.patternPositions=h}addImages(e,i,o){for(const h in e){const p=e[h],m={x:0,y:0,w:p.data.width+2,h:p.data.height+2};o.push(m),i[h]=new _n(m,p),p.hasRenderCallback&&this.haveRenderCallbacks.push(h)}}patchUpdatedImages(e,i){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),i),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),i)}patchUpdatedImage(e,i,o){if(!e||!i||e.version===i.version)return;e.version=i.version;const[h,p]=e.tl;o.update(i.data,void 0,{x:h,y:p})}}var lc;function vd(n,e,i,o,h,p,m,x,w,A,k,F,Z,G,W){const K=Yc.fromFeature(n,h);let J;F===T.az.vertical&&K.verticalizePunctuation();let se=K.determineLineBreaks(A,p,e,o,G);const{processBidirectionalText:ge,processStyledBidirectionalText:le}=As;if(ge&&K.sections.length===1){J=[],se=se.map((He=>K.toCodeUnitIndex(He)));const Ae=ge(K.toString(),se);for(const He of Ae){const ut=[...He].map((()=>0));J.push(new Yc(He,K.sections,ut))}}else if(le){J=[],se=se.map((st=>K.toCodeUnitIndex(st)));let Ae=0;const He=[];for(const st of K.text)He.push(...Array(st.length).fill(K.sectionIndex[Ae])),Ae++;const ut=le(K.text,He,se);
23for(const st of ut){const ft=[];let zt="";for(const wt of st[0])ft.push(st[1][zt.length]),zt+=wt;J.push(new Yc(st[0],K.sections,ft))}}else J=(function(Ae,He){const ut=[];let st=0;for(const ft of He)ut.push(Ae.substring(st,ft)),st=ft;return st<Ae.length()&&ut.push(Ae.substring(st,Ae.length())),ut})(K,se);const he=[],xe={positionedLines:he,text:K.toString(),top:k[1],bottom:k[1],left:k[0],right:k[0],writingMode:F,iconsInText:!1,verticalizable:!1};return(function(Ae,He,ut,st,ft,zt,wt,at,et,Ot,Dt,Zt){let kt=0,ti=0,Yi=0,Ri=0;const Jn=at==="right"?1:at==="left"?0:.5,Za=Ar/Zt;let Fr=0;for(const hn of ft){hn.trim();const dr=hn.getMaxScale(),yr={positionedGlyphs:[],lineOffset:0};Ae.positionedLines[Fr]=yr;const Vn=yr.positionedGlyphs;let ho=0;if(!hn.length()){ti+=zt,++Fr;continue}const Ga=kg(st,hn,Za);let fo=0;for(const ba of hn.text){const sr=hn.getSection(fo),jr=ba.codePointAt(0),fr=xf(et,Dt,jr),wa={glyph:jr,imageName:null,x:kt,y:ti+-17,vertical:fr,scale:1,fontStack:"",sectionIndex:hn.getSectionIndex(fo),metrics:null,rect:null};let Jc;if("fontStack"in sr){if(Jc=kh(sr,jr,fr,Ga,He,ut),!Jc)continue;wa.fontStack=sr.fontStack}else{if(Ae.iconsInText=!0,sr.scale*=Za,Jc=wp(sr,fr,dr,Ga,st),!Jc)continue;ho=Math.max(ho,Jc.imageOffset),wa.imageName=sr.imageName}const{rect:Ru,metrics:im,baselineOffset:Gh}=Jc;wa.y+=Gh,wa.scale=sr.scale,wa.metrics=im,wa.rect=Ru,Vn.push(wa),fr?(Ae.verticalizable=!0,kt+=("imageName"in sr?im.advance:Ar)*sr.scale+Ot):kt+=im.advance*sr.scale+Ot,fo++}Vn.length!==0&&(Yi=Math.max(kt-Ot,Yi),bf(Vn,0,Vn.length-1,Jn)),kt=0,yr.lineOffset=Math.max(ho,(dr-1)*Ar);const Kl=zt*dr+ho;ti+=Kl,Ri=Math.max(Kl,Ri),++Fr}const{horizontalAlign:er,verticalAlign:Hn}=bp(wt);(function(hn,dr,yr,Vn,ho,Ga,fo,Kl,ba){const sr=(dr-yr)*ho;let jr=0;jr=Ga!==fo?-Kl*Vn- -17:-Vn*ba*fo+.5*fo;for(const fr of hn)for(const wa of fr.positionedGlyphs)wa.x+=sr,wa.y+=jr})(Ae.positionedLines,Jn,er,Hn,Yi,Ri,zt,ti,ft.length),Ae.top+=-Hn*ti,Ae.bottom=Ae.top+ti,Ae.left+=-er*Yi,Ae.right=Ae.left+Yi})(xe,e,i,o,J,m,x,w,F,A,Z,W),!(function(Ae){for(const He of Ae)if(He.positionedGlyphs.length!==0)return!1;return!0})(he)&&xe}function bp(n){let e=.5,i=.5;switch(n){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(n){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function kg(n,e,i){const o=e.getMaxScale()*Ar,{maxImageWidth:h,maxImageHeight:p}=e.getMaxImageSize(n),m=Math.max(o,p*i);return{verticalLineContentWidth:Math.max(o,h*i),horizontalLineContentHeight:m}}function Zm(n){switch(n){case"top":return 0;case"center":return .5;default:return 1}}function xf(n,e,i){return!(n===T.az.horizontal||!e&&!fu(i)||e&&(Lc(i)||(o=i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(o)))));var o}function kh(n,e,i,o,h,p){const m=p[n.fontStack],x=(function(A,k,F,Z){if(A&&A.rect)return A;const G=k[F.fontStack],W=G&&G[Z];return W?{rect:null,metrics:W.metrics}:null})(m&&m[e],h,n,e);if(x===null)return null;let w;if(i)w=o.verticalLineContentWidth-n.scale*Ar;else{const A=Zm(n.verticalAlign);w=(o.horizontalLineContentHeight-n.scale*Ar)*A}return{rect:x.rect,metrics:x.metrics,baselineOffset:w}}function wp(n,e,i,o,h){const p=h[n.imageName];if(!p)return null;const m=p.paddedRect,x=p.displaySize,w={width:x[0],height:x[1],left:1,top:-3,advance:e?x[1]:x[0]};let A;if(e)A=o.verticalLineContentWidth-x[1]*n.scale;else{const k=Zm(n.verticalAlign);A=(o.horizontalLineContentHeight-x[1]*n.scale)*k}return{rect:m,metrics:w,baselineOffset:A,imageOffset:(e?x[0]:x[1])*n.scale-Ar*i}}function bf(n,e,i,o){if(o===0)return;const h=n[i],p=(n[i].x+h.metrics.advance*h.scale)*o;for(let m=e;m<=i;m++)n[m].x-=p}function Tp(n,e,i){const{horizontalAlign:o,verticalAlign:h}=bp(i),p=e[0]-n.displaySize[0]*o,m=e[1]-n.displaySize[1]*h;return{image:n,top:m,bottom:m+n.displaySize[1],left:p,right:p+n.displaySize[0]}}function zu(n){var e,i;let o=n.left,h=n.top,p=n.right-o,m=n.bottom-h;const x=(e=n.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",w=(i=n.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",A=(n.image.content[2]-n.image.content[0])/(n.image.content[3]-n.image.content[1]);if(w==="proportional"){if(x==="stretchOnly"&&p/m<A||x==="proportional"){const k=Math.ceil(m*A);o*=k/p,p=k}}else if(x==="proportional"&&w==="stretchOnly"&&A!==0&&p/m>A){const k=Math.ceil(p/A);h*=k/m,m=k}return{x1:o,y1:h,x2:o+p,y2:h+m}}function Tl(n,e,i,o,h,p){const m=n.image;let x;if(m.content){const J=m.content,se=m.pixelRatio||1;x=[J[0]/se,J[1]/se,m.displaySize[0]-J[2]/se,m.displaySize[1]-J[3]/se]}const w=e.left*p,A=e.right*p;let k,F,Z,G;i==="width"||i==="both"?(G=h[0]+w-o[3],F=h[0]+A+o[1]):(G=h[0]+(w+A-m.displaySize[0])/2,F=G+m.displaySize[0]);const W=e.top*p,K=e.bottom*p;return i==="height"||i==="both"?(k=h[1]+W-o[0],Z=h[1]+K+o[2]):(k=h[1]+(W+K-m.displaySize[1])/2,Z=k+m.displaySize[1]),{image:m,top:k,right:F,bottom:Z,left:G,collisionPadding:x}}Nt("ImagePosition",_n),Nt("ImageAtlas",vf),T.az=void 0,(lc=T.az||(T.az={}))[lc.none=0]="none",lc[lc.horizontal=1]="horizontal",lc[lc.vertical=2]="vertical",lc[lc.horizontalOnly=3]="horizontalOnly";const uo=128,uc=32640;function Sp(n,e){const{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new an(n+1))};if(i.kind==="source")return{kind:"source"};{const{zoomStops:o,interpolationType:h}=i;let p=0;for(;p<o.length&&o[p]<=n;)p++;p=Math.max(0,p-1);let m=p;for(;m<o.length&&o[m]<n+1;)m++;m=Math.min(o.length-1,m);const x=o[p],w=o[m];return i.kind==="composite"?{kind:"composite",minZoom:x,maxZoom:w,interpolationType:h}:{kind:"camera",minZoom:x,maxZoom:w,minSize:i.evaluate(new an(x)),maxSize:i.evaluate(new an(w)),interpolationType:h}}}function wf(n,e,i){let o="never";const h=n.get(e);return h?o=h:n.get(i)&&(o="always"),o}
vendor: 27,351 bytes, line 23
23const Gm=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function xd(n,e,i,o,h,p,m,x,w,A,k,F,Z){const G=x?Math.min(uc,Math.round(x[0])):0,W=x?Math.min(uc,Math.round(x[1])):0;n.emplaceBack(e,i,Math.round(32*o),Math.round(32*h),p,m,(G<<1)+(w?1:0),W,16*A,16*k,256*F,256*Z)}function Cp(n,e,i){n.emplaceBack(e.x,e.y,i),n.emplaceBack(e.x,e.y,i),n.emplaceBack(e.x,e.y,i),n.emplaceBack(e.x,e.y,i)}function Mp(n){for(const e of n.sections)if(pl(e.text))return!0;return!1}class Tf{constructor(e){this.layoutVertexArray=new we,this.indexArray=new Xe,this.programConfigurations=e,this.segments=new Lt,this.dynamicLayoutVertexArray=new Re,this.opacityVertexArray=new Ye,this.hasVisibleVertices=!1,this.placedSymbolArray=new b}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,o,h){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Lm.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,gd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Gm,!0),this.opacityVertexBuffer.itemSize=1),(o||h)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Nt("SymbolBuffers",Tf);class Sf{constructor(e,i,o){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new o,this.segments=new Lt,this.collisionVertexArray=new $e}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,_p.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Nt("CollisionBuffers",Sf);class Rh{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((m=>m.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Sp(this.zoom,i["text-size"]),this.iconSizeData=Sp(this.zoom,i["icon-size"]);const o=this.layers[0].layout,h=o.get("symbol-sort-key"),p=o.get("symbol-z-order");this.canOverlap=wf(o,"text-overlap","text-allow-overlap")!=="never"||wf(o,"icon-overlap","icon-allow-overlap")!=="never"||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&!h.isConstant(),this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,o.get("symbol-placement")==="point"&&(this.writingModes=o.get("text-writing-mode").map((m=>T.az[m]))),this.stateDependentLayerIds=this.layers.filter((m=>m.isStateDependent())).map((m=>m.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Tf(new Zl(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new Tf(new Zl(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new O,this.lineVertexArray=new U,this.symbolInstances=new z,this.textAnchorOffsets=new q}calculateGlyphDependencies(e,i,o,h,p){for(const m of e)if(i[m.codePointAt(0)]=!0,(o||h)&&p){const x=zh[m];x&&(i[x.codePointAt(0)]=!0)}}populate(e,i,o){const h=this.layers[0],p=h.layout,m=p.get("text-font"),x=p.get("text-field"),w=p.get("icon-image"),A=(x.value.kind!=="constant"||x.value.value instanceof or&&!x.value.value.isEmpty()||x.value.value.toString().length>0)&&(m.value.kind!=="constant"||m.value.value.length>0),k=w.value.kind!=="constant"||!!w.value.value||Object.keys(w.parameters).length>0,F=p.get("symbol-sort-key");if(this.features=[],!A&&!k)return;const Z=i.iconDependencies,G=i.glyphDependencies,W=i.availableImages,K=new an(this.zoom);for(const{feature:J,id:se,index:ge,sourceLayerIndex:le}of e){const he=h._featureFilter.needGeometry,xe=oo(J,he);if(!h._featureFilter.filter(K,xe,o))continue;let Ae,He;if(he||(xe.geometry=xl(J)),A){const st=h.getValueAndResolveTokens("text-field",xe,o,W),ft=or.factory(st),zt=this.hasRTLText=this.hasRTLText||Mp(ft);(!zt||As.getRTLTextPluginStatus()==="unavailable"||zt&&As.isParsed())&&(Ae=Bs(ft,h,xe))}if(k){const st=h.getValueAndResolveTokens("icon-image",xe,o,W);He=st instanceof br?st:br.fromString(st)}if(!Ae&&!He)continue;const ut=this.sortFeaturesByKey?F.evaluate(xe,{},o):void 0;if(this.features.push({id:se,text:Ae,icon:He,index:ge,sourceLayerIndex:le,geometry:xe.geometry,properties:J.properties,type:Eh.types[J.type],sortKey:ut}),He&&(Z[He.name]=!0),Ae){const st=m.evaluate(xe,{},o).join(","),ft=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(T.az.vertical)>=0;for(const zt of Ae.sections)if(zt.image)Z[zt.image.name]=!0;else{const wt=Oo(Ae.toString()),at=zt.fontStack||st,et=G[at]=G[at]||{};this.calculateGlyphDependencies(zt.text,et,ft,this.allowVerticalPlacement,wt)}}}p.get("symbol-placement")==="line"&&(this.features=(function(J){const se={},ge={},le=[];let he=0;function xe(st){le.push(J[st]),he++}function Ae(st,ft,zt){const wt=ge[st];return delete ge[st],ge[ft]=wt,le[wt].geometry[0].pop(),le[wt].geometry[0]=le[wt].geometry[0].concat(zt[0]),wt}function He(st,ft,zt){const wt=se[ft];return delete se[ft],se[st]=wt,le[wt].geometry[0].shift(),le[wt].geometry[0]=zt[0].concat(le[wt].geometry[0]),wt}function ut(st,ft,zt){const wt=zt?ft[0][ft[0].length-1]:ft[0][0];return`${st}:${wt.x}:${wt.y}`}for(let st=0;st<J.length;st++){const ft=J[st],zt=ft.geometry,wt=ft.text?ft.text.toString():null;if(!wt){xe(st);continue}const at=ut(wt,zt),et=ut(wt,zt,!0);if(at in ge&&et in se&&ge[at]!==se[et]){const Ot=He(at,et,zt),Dt=Ae(at,et,le[Ot].geometry);delete se[at],delete ge[et],ge[ut(wt,le[Dt].geometry,!0)]=Dt,le[Ot].geometry=null}else at in ge?Ae(at,et,zt):et in se?He(at,et,zt):(xe(st),se[at]=he-1,ge[et]=he-1)}return le.filter((st=>st.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((J,se)=>J.sortKey-se.sortKey))}update(e,i,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:o}),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:o}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,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(e,i){const o=this.lineVertexArray.length;if(e.segment!==void 0){let h=e.dist(i[e.segment+1]),p=e.dist(i[e.segment]);const m={};for(let x=e.segment+1;x<i.length;x++)m[x]={x:i[x].x,y:i[x].y,tileUnitDistanceFromAnchor:h},x<i.length-1&&(h+=i[x+1].dist(i[x]));for(let x=e.segment||0;x>=0;x--)m[x]={x:i[x].x,y:i[x].y,tileUnitDistanceFromAnchor:p},x>0&&(p+=i[x-1].dist(i[x]));for(let x=0;x<i.length;x++){const w=m[x];this.lineVertexArray.emplaceBack(w.x,w.y,w.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,i,o,h,p,m,x,w,A,k,F,Z){const G=e.indexArray,W=e.layoutVertexArray,K=e.segments.prepareSegment(4*i.length,W,G,this.canOverlap?m.sortKey:void 0),J=this.glyphOffsetArray.length,se=K.vertexLength,ge=this.allowVerticalPlacement&&x===T.az.vertical?Math.PI/2:0,le=m.text&&m.text.sections;for(let he=0;he<i.length;he++){const{tl:xe,tr:Ae,bl:He,br:ut,tex:st,pixelOffsetTL:ft,pixelOffsetBR:zt,minFontScaleX:wt,minFontScaleY:at,glyphOffset:et,isSDF:Ot,sectionIndex:Dt}=i[he],Zt=K.vertexLength,kt=et[1];xd(W,w.x,w.y,xe.x,kt+xe.y,st.x,st.y,o,Ot,ft.x,ft.y,wt,at),xd(W,w.x,w.y,Ae.x,kt+Ae.y,st.x+st.w,st.y,o,Ot,zt.x,ft.y,wt,at),xd(W,w.x,w.y,He.x,kt+He.y,st.x,st.y+st.h,o,Ot,ft.x,zt.y,wt,at),xd(W,w.x,w.y,ut.x,kt+ut.y,st.x+st.w,st.y+st.h,o,Ot,zt.x,zt.y,wt,at),Cp(e.dynamicLayoutVertexArray,w,ge),G.emplaceBack(Zt,Zt+2,Zt+1),G.emplaceBack(Zt+1,Zt+2,Zt+3),K.vertexLength+=4,K.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(et[0]),he!==i.length-1&&Dt===i[he+1].sectionIndex||e.programConfigurations.populatePaintArrays(W.length,m,m.index,{imagePositions:{},canonical:Z,formattedSection:le&&le[Dt]})}e.placedSymbolArray.emplaceBack(w.x,w.y,J,this.glyphOffsetArray.length-J,se,A,k,w.segment,o?o[0]:0,o?o[1]:0,h[0],h[1],x,0,!1,0,F)}_addCollisionDebugVertex(e,i,o,h,p,m){return i.emplaceBack(0,0),e.emplaceBack(o.x,o.y,h,p,Math.round(m.x),Math.round(m.y))}addCollisionDebugVertices(e,i,o,h,p,m,x){const w=p.segments.prepareSegment(4,p.layoutVertexArray,p.indexArray),A=w.vertexLength,k=p.layoutVertexArray,F=p.collisionVertexArray,Z=x.anchorX,G=x.anchorY;this._addCollisionDebugVertex(k,F,m,Z,G,new V(e,i)),this._addCollisionDebugVertex(k,F,m,Z,G,new V(o,i)),this._addCollisionDebugVertex(k,F,m,Z,G,new V(o,h)),this._addCollisionDebugVertex(k,F,m,Z,G,new V(e,h)),w.vertexLength+=4;const W=p.indexArray;W.emplaceBack(A,A+1),W.emplaceBack(A+1,A+2),W.emplaceBack(A+2,A+3),W.emplaceBack(A+3,A),w.primitiveLength+=4}addDebugCollisionBoxes(e,i,o,h){for(let p=e;p<i;p++){const m=this.collisionBoxArray.get(p);this.addCollisionDebugVertices(m.x1,m.y1,m.x2,m.y2,h?this.textCollisionBox:this.iconCollisionBox,m.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Sf(qe,Os.members,Mt),this.iconCollisionBox=new Sf(qe,Os.members,Mt);for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);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(e,i,o,h,p,m,x,w,A){const k={};for(let F=i;F<o;F++){const Z=e.get(F);k.textBox={x1:Z.x1,y1:Z.y1,x2:Z.x2,y2:Z.y2,anchorPointX:Z.anchorPointX,anchorPointY:Z.anchorPointY},k.textFeatureIndex=Z.featureIndex;break}for(let F=h;F<p;F++){const Z=e.get(F);k.verticalTextBox={x1:Z.x1,y1:Z.y1,x2:Z.x2,y2:Z.y2,anchorPointX:Z.anchorPointX,anchorPointY:Z.anchorPointY},k.verticalTextFeatureIndex=Z.featureIndex;break}for(let F=m;F<x;F++){const Z=e.get(F);k.iconBox={x1:Z.x1,y1:Z.y1,x2:Z.x2,y2:Z.y2,anchorPointX:Z.anchorPointX,anchorPointY:Z.anchorPointY},k.iconFeatureIndex=Z.featureIndex;break}for(let F=w;F<A;F++){const Z=e.get(F);k.verticalIconBox={x1:Z.x1,y1:Z.y1,x2:Z.x2,y2:Z.y2,anchorPointX:Z.anchorPointX,anchorPointY:Z.anchorPointY},k.verticalIconFeatureIndex=Z.featureIndex;break}return k}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){const o=e.placedSymbolArray.get(i),h=o.vertexStartIndex+4*o.numGlyphs;for(let p=o.vertexStartIndex;p<h;p+=4)e.indexArray.emplaceBack(p,p+2,p+1),e.indexArray.emplaceBack(p+1,p+2,p+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const i=Math.sin(e),o=Math.cos(e),h=[],p=[],m=[];for(let x=0;x<this.symbolInstances.length;++x){m.push(x);const w=this.symbolInstances.get(x);h.push(0|Math.round(i*w.anchorX+o*w.anchorY)),p.push(w.featureIndex)}return m.sort(((x,w)=>h[x]-h[w]||p[w]-p[x])),m}addToSortKeyRanges(e,i){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===i?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const i of this.symbolInstanceIndexes){const o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach(((h,p,m)=>{h>=0&&m.indexOf(h)===p&&this.addIndicesForPlacedSymbol(this.text,h)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Cf,Mf;Nt("SymbolBucket",Rh,{omit:["layers","collisionBoxArray","features","compareText"]}),Rh.MAX_GLYPHS=65535,Rh.addDynamicAttributes=Cp;var Ep={get paint(){return Mf=Mf||new rr({"icon-opacity":new $t(ke.paint_symbol["icon-opacity"]),"icon-color":new $t(ke.paint_symbol["icon-color"]),"icon-halo-color":new $t(ke.paint_symbol["icon-halo-color"]),"icon-halo-width":new $t(ke.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $t(ke.paint_symbol["icon-halo-blur"]),"icon-translate":new Ut(ke.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ut(ke.paint_symbol["icon-translate-anchor"]),"text-opacity":new $t(ke.paint_symbol["text-opacity"]),"text-color":new $t(ke.paint_symbol["text-color"],{runtimeType:na,getOverride:n=>n.textColor,hasOverride:n=>!!n.textColor}),"text-halo-color":new $t(ke.paint_symbol["text-halo-color"]),"text-halo-width":new $t(ke.paint_symbol["text-halo-width"]),"text-halo-blur":new $t(ke.paint_symbol["text-halo-blur"]),"text-translate":new Ut(ke.paint_symbol["text-translate"]),"text-translate-anchor":new Ut(ke.paint_symbol["text-translate-anchor"])})},get layout(){return Cf=Cf||new rr({"symbol-placement":new Ut(ke.layout_symbol["symbol-placement"]),"symbol-spacing":new Ut(ke.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ut(ke.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $t(ke.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ut(ke.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ut(ke.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ut(ke.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ut(ke.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ut(ke.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ut(ke.layout_symbol["icon-rotation-alignment"]),"icon-size":new $t(ke.layout_symbol["icon-size"]),"icon-text-fit":new Ut(ke.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ut(ke.layout_symbol["icon-text-fit-padding"]),"icon-image":new $t(ke.layout_symbol["icon-image"]),"icon-rotate":new $t(ke.layout_symbol["icon-rotate"]),"icon-padding":new $t(ke.layout_symbol["icon-padding"]),"icon-keep-upright":new Ut(ke.layout_symbol["icon-keep-upright"]),"icon-offset":new $t(ke.layout_symbol["icon-offset"]),"icon-anchor":new $t(ke.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ut(ke.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ut(ke.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ut(ke.layout_symbol["text-rotation-alignment"]),"text-field":new $t(ke.layout_symbol["text-field"]),"text-font":new $t(ke.layout_symbol["text-font"]),"text-size":new $t(ke.layout_symbol["text-size"]),"text-max-width":new $t(ke.layout_symbol["text-max-width"]),"text-line-height":new Ut(ke.layout_symbol["text-line-height"]),"text-letter-spacing":new $t(ke.layout_symbol["text-letter-spacing"]),"text-justify":new $t(ke.layout_symbol["text-justify"]),"text-radial-offset":new $t(ke.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ut(ke.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new $t(ke.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new $t(ke.layout_symbol["text-anchor"]),"text-max-angle":new Ut(ke.layout_symbol["text-max-angle"]),"text-writing-mode":new Ut(ke.layout_symbol["text-writing-mode"]),"text-rotate":new $t(ke.layout_symbol["text-rotate"]),"text-padding":new Ut(ke.layout_symbol["text-padding"]),"text-keep-upright":new Ut(ke.layout_symbol["text-keep-upright"]),"text-transform":new $t(ke.layout_symbol["text-transform"]),"text-offset":new $t(ke.layout_symbol["text-offset"]),"text-allow-overlap":new Ut(ke.layout_symbol["text-allow-overlap"]),"text-overlap":new Ut(ke.layout_symbol["text-overlap"]),"text-ignore-placement":new Ut(ke.layout_symbol["text-ignore-placement"]),"text-optional":new Ut(ke.layout_symbol["text-optional"])})}};class qm{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Pi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const i=this.defaultValue.property.overrides;if(i&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Nt("FormatSectionOverride",qm,{omit:["defaultValue"]});class cc extends Gn{constructor(e,i){super(e,Ep,i)}recalculate(e,i){if(super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const o=this.layout.get("text-writing-mode");if(o){const h=[];for(const p of o)h.indexOf(p)<0&&h.push(p);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,o,h){const p=this.layout.get(e).evaluate(i,{},o,h),m=this._unevaluatedLayout._values[e];return m.isDataDriven()||Do(m.value)||!p?p:(function(x,w){return w.replace(/{([^{}]+)}/g,((A,k)=>x&&k in x?String(x[k]):""))})(i.properties,p)}createBucket(e){return new Rh(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Ep.paint.overridableProperties){if(!cc.hasPaintOverride(this.layout,e))continue;const i=this.paint.get(e),o=new qm(i),h=new hu(o,i.property.specification);let p=null;p=i.value.kind==="constant"||i.value.kind==="source"?new _("source",h):new S("composite",h,i.value.zoomStops),this.paint._values[e]=new os(i.property,p,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,o){return!(!this.layout||i.isDataDriven()||o.isDataDriven())&&cc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){const o=e.get("text-field"),h=Ep.paint.properties[i];let p=!1;const m=x=>{for(const w of x)if(h.overrides&&h.overrides.hasOverride(w))return void(p=!0)};if(o.value.kind==="constant"&&o.value.value instanceof or)m(o.value.value.sections);else if(o.value.kind==="source"||o.value.kind==="composite"){const x=A=>{p||(A instanceof la&&Ti(A.value)===$a?m(A.value.sections):A instanceof au?m(A.sections):A.eachChild(x))},w=o.value;w._styleExpression&&x(w._styleExpression.expression)}return p}}let Hm;var $m={get paint(){return Hm=Hm||new rr({"background-color":new Ut(ke.paint_background["background-color"]),"background-pattern":new ec(ke.paint_background["background-pattern"]),"background-opacity":new Ut(ke.paint_background["background-opacity"])})}};class qi extends Gn{constructor(e,i){super(e,$m,i)}}class Ap extends Gn{constructor(e,i){super(e,{},i),this.onAdd=o=>{this.implementation.onAdd&&this.implementation.onAdd(o,o.painter.context.gl)},this.onRemove=o=>{this.implementation.onRemove&&this.implementation.onRemove(o,o.painter.context.gl)},this.implementation=e}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 Ef{constructor(e){this._methodToThrottle=e,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 Pp={once:!0},Af=63710088e-1;class Yl{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,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 Yl(ri(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const i=Math.PI/180,o=this.lat*i,h=e.lat*i,p=Math.sin(o)*Math.sin(h)+Math.cos(o)*Math.cos(h)*Math.cos((e.lng-this.lng)*i);return Af*Math.acos(Math.min(p,1))}static convert(e){if(e instanceof Yl)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Yl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Yl(Number("lng"in e?e.lng:e.lon),Number(e.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 Oh=2*Math.PI*Af;function bd(n){return Oh*Math.cos(n*Math.PI/180)}function Xm(n){return(180+n)/360}function zp(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function Ym(n,e){return n/bd(e)}function Wm(n){return 360*n-180}function wd(n){return 360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90}function Lp(n,e){return n*bd(wd(e))}class un{constructor(e,i,o=0){this.x=+e,this.y=+i,this.z=+o}static fromLngLat(e,i=0){const o=Yl.convert(e);return new un(Xm(o.lng),zp(o.lat),Ym(i,o.lat))}toLngLat(){return new Yl(Wm(this.x),wd(this.y))}toAltitude(){return Lp(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Oh*(e=wd(this.y),1/Math.cos(e*Math.PI/180));var e}}function Pf(n,e,i){var o=2*Math.PI*6378137/256/Math.pow(2,i);return[n*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class ea{constructor(e,i,o){if(!(function(h,p,m){return!(h<0||h>25||m<0||m>=Math.pow(2,h)||p<0||p>=Math.pow(2,h))})(e,i,o))throw new Error(`x=${i}, y=${o}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=i,this.y=o,this.key=Bh(0,e,e,i,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i,o){const h=(m=this.y,x=this.z,w=Pf(256*(p=this.x),256*(m=Math.pow(2,x)-m-1),x),A=Pf(256*(p+1),256*(m+1),x),w[0]+","+w[1]+","+A[0]+","+A[1]);var p,m,x,w,A;const k=(function(F,Z,G){let W,K="";for(let J=F;J>0;J--)W=1<<J-1,K+=(Z&W?1:0)+(G&W?2:0);return K})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(o==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,k).replace(/{bbox-epsg-3857}/g,h)}isChildOf(e){const i=this.z-e.z;return i>0&&e.x===this.x>>i&&e.y===this.y>>i}getTilePoint(e){const i=Math.pow(2,this.z);return new V((e.x*i-this.x)*Yt,(e.y*i-this.y)*Yt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Km{constructor(e,i){this.wrap=e,this.canonical=i,this.key=Bh(e,i.z,i.z,i.x,i.y)}}class Ns{constructor(e,i,o,h,p){if(this.terrainRttPosMatrix32f=null,e<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${o}`);this.overscaledZ=e,this.wrap=i,this.canonical=new ea(o,+h,+p),this.key=Bh(i,e,o,h,p)}clone(){return new Ns(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-e;return e>this.canonical.z?new Ns(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ns(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,i){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const o=this.canonical.z-e;return e>this.canonical.z?Bh(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):Bh(this.wrap*+i,e,e,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;const i=this.canonical.z-e.canonical.z;return!(i<0)&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new Ns(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const i=this.canonical.z+1,o=2*this.canonical.x,h=2*this.canonical.y;return[new Ns(i,this.wrap,i,o,h),new Ns(i,this.wrap,i,o+1,h),new Ns(i,this.wrap,i,o,h+1),new Ns(i,this.wrap,i,o+1,h+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
23e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Ns(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Ns(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Km(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new un(e.x-this.wrap,e.y))}}function Bh(n,e,i,o,h){(n*=2)<0&&(n=-1*n-1);const p=1<<i;return(p*p*n+p*h+o).toString(36)+i.toString(36)+e.toString(36)}function Td(n,e){return e?n.properties[e]:n.id}function Dp(n,e){const i={id:n.id};if(e.removeAllProperties&&(delete n.removeProperties,delete n.addOrUpdateProperties,delete e.removeProperties),e.removeProperties)for(const o of e.removeProperties){const h=n.addOrUpdateProperties.findIndex((p=>p.key===o));h>-1&&n.addOrUpdateProperties.splice(h,1)}return(n.removeAllProperties||e.removeAllProperties)&&(i.removeAllProperties=!0),(n.removeProperties||e.removeProperties)&&(i.removeProperties=[...n.removeProperties||[],...e.removeProperties||[]]),(n.addOrUpdateProperties||e.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...n.addOrUpdateProperties||[],...e.addOrUpdateProperties||[]]),(n.newGeometry||e.newGeometry)&&(i.newGeometry=e.newGeometry||n.newGeometry),i}function Sd(n){var e,i;if(!n)return{};const o={};return o.removeAll=n.removeAll,o.remove=new Set(n.remove||[]),o.add=new Map((e=n.add)===null||e===void 0?void 0:e.map((h=>[h.id,h]))),o.update=new Map((i=n.update)===null||i===void 0?void 0:i.map((h=>[h.id,h]))),o}Nt("CanonicalTileID",ea),Nt("OverscaledTileID",Ns,{omit:["terrainRttPosMatrix32f"]});class hc{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){const i=new hc;return i.extend(e(new V(this.minX,this.minY))),i.extend(e(new V(this.maxX,this.minY))),i.extend(e(new V(this.minX,this.maxY))),i.extend(e(new V(this.maxX,this.maxY))),i}static fromPoints(e){const i=new hc;for(const o of e)i.extend(o);return i}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class Ip{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){const o=e[i];this._stringToNumber[o]=i,this._numberToString[i]=o}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class zf{constructor(e,i,o,h,p){this.type="Feature",this._vectorTileFeature=e,this._x=o,this._y=h,this._z=i,this.properties=e.properties,this.id=p}projectPoint(e,i,o,h){return[360*(e.x+i)/h-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/h)*Math.PI))-90]}projectLine(e,i,o,h){return e.map((p=>this.projectPoint(p,i,o,h)))}get geometry(){if(this._geometry)return this._geometry;const e=this._vectorTileFeature,i=e.extent*Math.pow(2,this._z),o=e.extent*this._x,h=e.extent*this._y,p=e.loadGeometry();switch(e.type){case 1:{const m=[];for(const w of p)m.push(w[0]);const x=this.projectLine(m,o,h,i);this._geometry=m.length===1?{type:"Point",coordinates:x[0]}:{type:"MultiPoint",coordinates:x};break}case 2:{const m=p.map((x=>this.projectLine(x,o,h,i)));this._geometry=m.length===1?{type:"LineString",coordinates:m[0]}:{type:"MultiLineString",coordinates:m};break}case 3:{const m=Pm(p),x=[];for(const w of m)x.push(w.map((A=>this.projectLine(A,o,h,i))));this._geometry=x.length===1?{type:"Polygon",coordinates:x[0]}:{type:"MultiPolygon",coordinates:x};break}default:throw new Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&i!=="_x"&&i!=="_y"&&i!=="_z"&&(e[i]=this[i]);return e}}class dc{_name;dataBuffer;nullabilityBuffer;_size;constructor(e,i,o){this._name=e,this.dataBuffer=i,typeof o=="number"?this._size=o:(this.nullabilityBuffer=o,this._size=o.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer&&this.nullabilityBuffer.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class Lf extends dc{}class Df extends Lf{getValueFromBuffer(e){return this.dataBuffer[e]}}class kp extends Lf{getValueFromBuffer(e){return this.dataBuffer[e]}}class Rp extends dc{delta;constructor(e,i,o,h){super(e,i,h),this.delta=o}}class Op extends Rp{constructor(e,i,o,h){super(e,Int32Array.of(i),o,h)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class Bp extends dc{constructor(e,i,o){super(e,Int32Array.of(i),o)}getValueFromBuffer(e){return this.dataBuffer[0]}}class fc{_name;_geometryVector;_idVector;_propertyVectors;_extent;propertyVectorsMap;constructor(e,i,o,h,p=4096){this._name=e,this._geometryVector=i,this._idVector=o,this._propertyVectors=h,this._extent=p}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((i=>[i.name,i])))),this.propertyVectorsMap.get(e)}*[Symbol.iterator](){const e=this.geometryVector[Symbol.iterator]();let i=0;for(;i<this.numFeatures;){let o;this.idVector&&(o=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(i)):this.idVector.getValue(i));const h=e?.next().value,p={};
vendor: 3,250 bytes, line 23
23for(const m of this.propertyVectors){if(!m)continue;const x=m.name,w=m.getValue(i);w!==null&&(p[x]=w)}i++,yield{id:o,geometry:h,properties:p}}}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){const e=[],i=this.geometryVector.getGeometries();for(let o=0;o<this.numFeatures;o++){let h;this.idVector&&(h=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(o)):this.idVector.getValue(o));const p={coordinates:i[o],type:this.geometryVector.geometryType(o)},m={};for(const x of this.propertyVectors){if(!x)continue;const w=x.name,A=x.getValue(o);A!==null&&(m[w]=A)}e.push({id:h,geometry:p,properties:m})}return e}containsMaxSaveIntegerValues(e){return e instanceof Df||e instanceof Bp&&e instanceof Op||e instanceof kp}}class Qm{value;constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var Li,Sl,va,Cl,pc,ja,_r,Br,co,ds;function Nr(n,e,i){const o=new Int32Array(i);let h=0,p=e.get();for(let m=0;m<o.length;m++){let x=n[p++],w=127&x;x<128||(x=n[p++],w|=(127&x)<<7,x<128||(x=n[p++],w|=(127&x)<<14,x<128||(x=n[p++],w|=(127&x)<<21,x<128||(x=n[p++],w|=(15&x)<<28)))),o[h++]=w}return e.set(p),o}function Cd(n,e,i){const o=new BigInt64Array(i);for(let h=0;h<o.length;h++)o[h]=If(n,e);return o}function Jm(n,e){let i,o;return o=n[e.get()],e.increment(),i=127&o,o<128?i:(o=n[e.get()],e.increment(),i|=(127&o)<<7,o<128?i:(o=n[e.get()],e.increment(),i|=(127&o)<<14,o<128?i:(o=n[e.get()],e.increment(),i|=(127&o)<<21,o<128?i:(o=n[e.get()],i|=(15&o)<<28,(function(h,p,m){let x,w;if(w=p[m.get()],m.increment(),x=(112&w)>>4,w<128||(w=p[m.get()],m.increment(),x|=(127&w)<<3,w<128)||(w=p[m.get()],m.increment(),x|=(127&w)<<10,w<128)||(w=p[m.get()],m.increment(),x|=(127&w)<<17,w<128)||(w=p[m.get()],m.increment(),x|=(127&w)<<24,w<128)||(w=p[m.get()],m.increment(),x|=(1&w)<<31,w<128))return 4294967296*x+(h>>>0);throw new Error("Expected varint not more than 10 bytes")})(i,n,e)))))}function Nh(n,e,i,o){throw new Error("FastPFor is not implemented yet.")}function xa(n){return n>>>1^-(1&n)}function Wc(n){return n>>1n^-(1n&n)}function If(n,e){let i=0n,o=0,h=e.get();for(;h<n.length;){const p=n[h++];if(i|=BigInt(127&p)<<BigInt(o),!(128&p))break;if(o+=7,o>=64)throw new Error("Varint too long")}return e.set(h),i}function Wl(n,e,i){const o=new Int32Array(i);let h=0;for(let p=0;p<e;p++){const m=n[p];o.fill(n[p+e],h,h+m),h+=m}return o}function eg(n,e,i){const o=new BigInt64Array(i);let h=0;for(let p=0;p<e;p++){const m=Number(n[p]);o.fill(n[p+e],h,h+m),h+=m}return o}function tg(n,e,i){const o=new Float64Array(i);let h=0;for(let p=0;p<e;p++){const m=n[p];o.fill(n[p+e],h,h+m),h+=m}return o}function mc(n){const e=n.length/4*4;let i=1;if(e>=4)for(let o=n[0];i<e-4;i+=4)o=n[i]+=o,o=n[i+1]+=o,o=n[i+2]+=o,o=n[i+3]+=o;for(;i!=n.length;)n[i]+=n[i-1],++i}function Np(n){n[0]=n[0]>>>1^-(1&n[0]),n[1]=n[1]>>>1^-(1&n[1]);const e=n.length/4*4;let i=2;if(e>=4)for(;i<e-4;i+=4){const o=n[i],h=n[i+1],p=n[i+2],m=n[i+3];n[i]=(o>>>1^-(1&o))+n[i-2],n[i+1]=(h>>>1^-(1&h))+n[i-1],n[i+2]=(p>>>1^-(1&p))+n[i],n[i+3]=(m>>>1^-(1&m))+n[i+1]}for(;i!=n.length;i+=2)n[i]=(n[i]>>>1^-(1&n[i]))+n[i-2],n[i+1]=(n[i+1]>>>1^-(1&n[i+1]))+n[i-1]}
23(function(n){n.NONE="NONE",n.DELTA="DELTA",n.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",n.RLE="RLE",n.MORTON="MORTON",n.PDE="PDE"})(Li||(Li={})),(function(n){n.NONE="NONE",n.FAST_PFOR="FAST_PFOR",n.VARINT="VARINT",n.ALP="ALP"})(Sl||(Sl={})),(function(n){n.PRESENT="PRESENT",n.DATA="DATA",n.OFFSET="OFFSET",n.LENGTH="LENGTH"})(va||(va={}));class Fp{_dictionaryType;_offsetType;_lengthType;constructor(e,i,o){this._dictionaryType=e,this._offsetType=i,this._lengthType=o}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function Ua(n,e){const i=(function(o,h){const p=o[h.get()],m=Object.values(va)[p>>4];let x=null;switch(m){case va.DATA:x=new Fp(Object.values(Cl)[15&p]);break;case va.OFFSET:x=new Fp(null,Object.values(pc)[15&p]);break;case va.LENGTH:x=new Fp(null,null,Object.values(ja)[15&p])}h.increment();const w=o[h.get()],A=Object.values(Li)[w>>5],k=Object.values(Li)[w>>2&7],F=Object.values(Sl)[3&w];h.increment();const Z=Nr(o,h,2),G=Z[0];return{physicalStreamType:m,logicalStreamType:x,logicalLevelTechnique1:A,logicalLevelTechnique2:k,physicalLevelTechnique:F,numValues:G,byteLength:Z[1],decompressedCount:G}})(n,e);return i.logicalLevelTechnique1===Li.MORTON?(function(o,h,p){const m=Nr(h,p,2);return{physicalStreamType:o.physicalStreamType,logicalStreamType:o.logicalStreamType,logicalLevelTechnique1:o.logicalLevelTechnique1,logicalLevelTechnique2:o.logicalLevelTechnique2,physicalLevelTechnique:o.physicalLevelTechnique,numValues:o.numValues,byteLength:o.byteLength,decompressedCount:o.decompressedCount,numBits:m[0],coordinateShift:m[1]}})(i,n,e):Li.RLE!==i.logicalLevelTechnique1&&Li.RLE!==i.logicalLevelTechnique2||Sl.NONE===i.physicalLevelTechnique?i:(function(o,h,p){const m=Nr(h,p,2);return{physicalStreamType:o.physicalStreamType,logicalStreamType:o.logicalStreamType,logicalLevelTechnique1:o.logicalLevelTechnique1,logicalLevelTechnique2:o.logicalLevelTechnique2,physicalLevelTechnique:o.physicalLevelTechnique,numValues:o.numValues,byteLength:o.byteLength,decompressedCount:m[1],runs:m[0],numRleValues:m[1]}})(i,n,e)}
vendor: 11,165 bytes, line 23
23(function(n){n.NONE="NONE",n.SINGLE="SINGLE",n.SHARED="SHARED",n.VERTEX="VERTEX",n.MORTON="MORTON",n.FSST="FSST"})(Cl||(Cl={})),(function(n){n.VERTEX="VERTEX",n.INDEX="INDEX",n.STRING="STRING",n.KEY="KEY"})(pc||(pc={})),(function(n){n.VAR_BINARY="VAR_BINARY",n.GEOMETRIES="GEOMETRIES",n.PARTS="PARTS",n.RINGS="RINGS",n.TRIANGLES="TRIANGLES",n.SYMBOL="SYMBOL",n.DICTIONARY="DICTIONARY"})(ja||(ja={})),(function(n){n[n.FLAT=0]="FLAT",n[n.CONST=1]="CONST",n[n.SEQUENCE=2]="SEQUENCE",n[n.DICTIONARY=3]="DICTIONARY",n[n.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(_r||(_r={}));class Ml{values;_size;constructor(e,i){this.values=e,this._size=i}get(e){const i=Math.floor(e/8);return(this.values[i]>>e%8&1)==1}set(e,i){const o=Math.floor(e/8);this.values[o]=this.values[o]|(i?1:0)<<e%8}getInt(e){const i=Math.floor(e/8);return this.values[i]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function Va(n,e,i,o,h){return(function(p,m,x){switch(m.logicalLevelTechnique1){case Li.DELTA:return m.logicalLevelTechnique2===Li.RLE?(function(w,A,k){const F=new Int32Array(k);let Z=0,G=0;for(let W=0;W<A;W++){const K=w[W],J=xa(w[W+A]);for(let se=0;se<K;se++)G+=J,F[Z++]=G}return F})(p,m.runs,m.numRleValues):((function(w){w[0]=w[0]>>>1^-(1&w[0]);const A=w.length/4*4;let k=1;if(A>=4)for(;k<A-4;k+=4){const F=w[k],Z=w[k+1],G=w[k+2],W=w[k+3];w[k]=(F>>>1^-(1&F))+w[k-1],w[k+1]=(Z>>>1^-(1&Z))+w[k],w[k+2]=(G>>>1^-(1&G))+w[k+1],w[k+3]=(W>>>1^-(1&W))+w[k+2]}for(;k!=w.length;++k)w[k]=(w[k]>>>1^-(1&w[k]))+w[k-1]})(p),p);case Li.RLE:return(function(w,A,k){return k?(function(F,Z,G){const W=new Int32Array(G);let K=0;for(let J=0;J<Z;J++){const se=F[J];let ge=F[J+Z];ge=ge>>>1^-(1&ge),W.fill(ge,K,K+se),K+=se}return W})(w,A.runs,A.numRleValues):Wl(w,A.runs,A.numRleValues)})(p,m,x);case Li.MORTON:return mc(p),p;case Li.COMPONENTWISE_DELTA:return Np(p),p;case Li.NONE:return x&&(function(w){for(let A=0;A<w.length;A++){const k=w[A];w[A]=k>>>1^-(1&k)}})(p),p;default:throw new Error(`The specified Logical level technique is not supported: ${m.logicalLevelTechnique1}`)}})(kf(n,e,i),i,o)}function gc(n,e,i){return(function(o,h){if(h.logicalLevelTechnique1===Li.DELTA&&h.logicalLevelTechnique2===Li.NONE)return(function(m){const x=new Int32Array(m.length+1);x[0]=0,x[1]=xa(m[0]);let w=x[1],A=2;for(;A!=x.length;++A){const k=m[A-1];w+=k>>>1^-(1&k),x[A]=x[A-1]+w}return x})(o);if(h.logicalLevelTechnique1===Li.RLE&&h.logicalLevelTechnique2===Li.NONE)return(function(m,x,w){const A=new Int32Array(w+1);A[0]=0;let k=1,F=A[0];for(let Z=0;Z<x;Z++){const G=m[Z],W=m[Z+x];for(let K=k;K<k+G;K++)A[K]=W+F,F=A[K];k+=G}return A})(o,h.runs,h.numRleValues);if(h.logicalLevelTechnique1===Li.NONE&&h.logicalLevelTechnique2===Li.NONE){(function(m){let x=0;for(let w=0;w<m.length;w++)m[w]+=x,x=m[w]})(o);const p=new Int32Array(h.numValues+1);return p[0]=0,p.set(o,1),p}if(h.logicalLevelTechnique1===Li.DELTA&&h.logicalLevelTechnique2===Li.RLE){const p=(function(m,x,w){const A=new Int32Array(w+1);A[0]=0;let k=1,F=A[0];for(let Z=0;Z<x;Z++){const G=m[Z];let W=m[Z+x];W=W>>>1^-(1&W);for(let K=k;K<k+G;K++)A[K]=W+F,F=A[K];k+=G}return A})(o,h.runs,h.numRleValues);return mc(p),p}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")})(kf(n,e,i),i)}function kf(n,e,i){const o=i.physicalLevelTechnique;if(o===Sl.FAST_PFOR)return Nh();if(o===Sl.VARINT)return Nr(n,e,i.numValues);if(o===Sl.NONE){const h=e.get();e.add(i.byteLength);const p=n.subarray(h,e.get());return new Int32Array(p)}throw new Error("Specified physicalLevelTechnique is not supported (yet).")}function jp(n,e,i,o){const h=kf(n,e,i);if(h.length===1){const p=h[0];return o?xa(p):p}return o?(function(p){return xa(p[1])})(h):(function(p){return p[1]})(h)}function Up(n,e,i){return(function(o){if(o.length==2){const h=xa(o[1]);return[h,h]}return[xa(o[2]),xa(o[3])]})(kf(n,e,i))}function Kc(n,e,i){return(function(o){if(o.length==2){const h=Wc(o[1]);return[h,h]}return[Wc(o[2]),Wc(o[3])]})(Cd(n,e,i.numValues))}function Fh(n,e,i,o){return(function(h,p,m){switch(p.logicalLevelTechnique1){case Li.DELTA:return p.logicalLevelTechnique2===Li.RLE?(function(x,w,A){const k=new BigInt64Array(A);let F=0,Z=0n;for(let G=0;G<w;G++){const W=Number(x[G]),K=Wc(x[G+w]);for(let J=0;J<W;J++)Z+=K,k[F++]=Z}return k})(h,p.runs,p.numRleValues):((function(x){x[0]=x[0]>>1n^-(1n&x[0]);const w=x.length/4*4;let A=1;if(w>=4)for(;A<w-4;A+=4){const k=x[A],F=x[A+1],Z=x[A+2],G=x[A+3];x[A]=(k>>1n^-(1n&k))+x[A-1],x[A+1]=(F>>1n^-(1n&F))+x[A],x[A+2]=(Z>>1n^-(1n&Z))+x[A+1],x[A+3]=(G>>1n^-(1n&G))+x[A+2]}for(;A!=x.length;++A)x[A]=(x[A]>>1n^-(1n&x[A]))+x[A-1]})(h),h);case Li.RLE:return(function(x,w,A){return A?(function(k,F,Z){const G=new BigInt64Array(Z);let W=0;for(let K=0;K<F;K++){const J=Number(k[K]);let se=k[K+F];se=se>>1n^-(1n&se),G.fill(se,W,W+J),W+=J}return G})(x,w.runs,w.numRleValues):eg(x,w.runs,w.numRleValues)})(h,p,m);case Li.NONE:return m&&(function(x){for(let w=0;w<x.length;w++){const A=x[w];x[w]=A>>1n^-(1n&A)}})(h),h;default:throw new Error(`The specified Logical level technique is not supported: ${p.logicalLevelTechnique1}`)}})(Cd(n,e,i.numValues),i,o)}function Vp(n,e,i,o){const h=Cd(n,e,i.numValues);if(h.length===1){const p=h[0];return o?Wc(p):p}return o?(function(p){return Wc(p[1])})(h):(function(p){return p[1]})(h)}function Zp(n,e,i,o,h){return(function(p,m,x,w){switch(m.logicalLevelTechnique1){case Li.DELTA:return m.logicalLevelTechnique2===Li.RLE&&(p=Wl(p,m.runs,m.numRleValues)),(function(A,k){const F=new Int32Array(A.size());let Z=0;A.get(0)?(F[0]=A.get(0)?k[0]>>>1^-(1&k[0]):0,Z=1):F[0]=0;let G=1;for(;G!=F.length;++G)F[G]=A.get(G)?F[G-1]+(k[Z]>>>1^-(1&k[Z++])):F[G-1];return F})(w,p);case Li.RLE:return(function(A,k,F,Z){const G=k;return F?(function(W,K,J){const se=new Int32Array(W.size());let ge=0;for(let le=0;le<J;le++){const he=K[le];let xe=K[le+J];xe=xe>>>1^-(1&xe);for(let Ae=ge;Ae<ge+he;Ae++)W.get(Ae)?se[Ae]=xe:(se[Ae]=0,ge++);ge+=he}return se})(Z,A,G.runs):(function(W,K,J){const se=new Int32Array(W.size());let ge=0;for(let le=0;le<J;le++){const he=K[le],xe=K[le+J];for(let Ae=ge;Ae<ge+he;Ae++)W.get(Ae)?se[Ae]=xe:(se[Ae]=0,ge++);ge+=he}return se})(Z,A,G.runs)})(p,m,x,w);case Li.MORTON:return mc(p),p;case Li.COMPONENTWISE_DELTA:return Np(p),p;case Li.NONE:return p=x?(function(A,k){const F=new Int32Array(A.size());let Z=0,G=0;for(;G!=F.length;++G)if(A.get(G)){const W=k[Z++];F[G]=W>>>1^-(1&W)}else F[G]=0;return F})(w,p):(function(A,k){const F=new Int32Array(A.size());let Z=0,G=0;for(;G!=F.length;++G)F[G]=A.get(G)?k[Z++]:0;return F})(w,p),p;default:throw new Error("The specified Logical level technique is not supported")}})(i.physicalLevelTechnique===Sl.FAST_PFOR?Nh():Nr(n,e,i.numValues),i,o,h)}function Lu(n,e,i,o){const h=n.logicalLevelTechnique1;if(h===Li.RLE)return n.runs===1?_r.CONST:_r.FLAT;const p=e instanceof Ml?e.size():e;if(h===Li.DELTA&&n.logicalLevelTechnique2===Li.RLE){const m=n.runs,x=2;if(n.numRleValues!==p)return _r.FLAT;if(m===1)return _r.SEQUENCE;if(m===2){const w=o.get();let A;if(n.physicalLevelTechnique===Sl.VARINT)A=Nr(i,o,4);else{const k=o.get();A=new Int32Array(i.buffer,i.byteOffset+k,4)}if(o.set(w),A[2]===x&&A[3]===x)return _r.SEQUENCE}}return n.numValues===1?_r.CONST:_r.FLAT}class jh extends Lf{getValueFromBuffer(e){return this.dataBuffer[e]}}class Gp extends Rp{constructor(e,i,o,h){super(e,BigInt64Array.of(i),o,h)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}class Du{_geometryOffsets;_partOffsets;_ringOffsets;constructor(e,i,o){this._geometryOffsets=e,this._partOffsets=i,this._ringOffsets=o}get geometryOffsets(){return this._geometryOffsets}get partOffsets(){return this._partOffsets}get ringOffsets(){return this._ringOffsets}}function Md(n,e,i){return{x:Rf(n,e)-i,y:Rf(n>>1,e)-i}}function Rf(n,e){let i=0;for(let o=0;o<e;o++)i|=(n&1<<2*o)>>o;return i}(function(n){n[n.POINT=0]="POINT",n[n.LINESTRING=1]="LINESTRING",n[n.POLYGON=2]="POLYGON",n[n.MULTIPOINT=3]="MULTIPOINT",n[n.MULTILINESTRING=4]="MULTILINESTRING",n[n.MULTIPOLYGON=5]="MULTIPOLYGON"})(Br||(Br={})),(function(n){n[n.POINT=0]="POINT",n[n.LINESTRING=1]="LINESTRING",n[n.POLYGON=2]="POLYGON"})(co||(co={})),(function(n){n[n.MORTON=0]="MORTON",n[n.VEC_2=1]="VEC_2",n[n.VEC_3=2]="VEC_3"})(ds||(ds={}));class Of{createPoint(e){return[[e]]}createMultiPoint(e){return e.map((i=>[i]))}createLineString(e){return[e]}createMultiLineString(e){return e}createPolygon(e,i){return[e].concat(i)}createMultiPolygon(e){return e.flat()}}function qp(n){const e=new Array(n.numGeometries);let i=1,o=1,h=1,p=0;const m=new Of;let x=0,w=0;const A=n.mortonSettings,k=n.topologyVector,F=k.geometryOffsets,Z=k.partOffsets,G=k.ringOffsets,W=n.vertexOffsets,K=n.containsPolygonGeometry(),J=n.vertexBuffer;for(let se=0;se<n.numGeometries;se++){const ge=n.geometryType(se);if(ge===Br.POINT){if(W&&W.length!==0)if(n.vertexBufferType===ds.VEC_2){const le=2*W[w++],he=new V(J[le],J[le+1]);e[p++]=m.createPoint(he)}else{const le=Md(J[W[w++]],A.numBits,A.coordinateShift),he=new V(le.x,le.y);e[p++]=m.createPoint(he)}else{const le=new V(J[x++],J[x++]);e[p++]=m.createPoint(le)}F&&h++,Z&&i++,G&&o++}else if(ge===Br.MULTIPOINT){const le=F[h]-F[h-1];h++;const he=new Array(le);if(W&&W.length!==0){for(let xe=0;xe<le;xe++){const Ae=2*W[w++];he[xe]=new V(J[Ae],J[Ae+1])}e[p++]=m.createMultiPoint(he)}else{for(let xe=0;xe<le;xe++){const Ae=J[x++],He=J[x++];he[xe]=new V(Ae,He)}e[p++]=m.createMultiPoint(he)}}else if(ge===Br.LINESTRING){let le,he=0;K?(he=G[o]-G[o-1],o++):he=Z[i]-Z[i-1],i++,W&&W.length!==0?(le=n.vertexBufferType===ds.VEC_2?Pd(J,W,w,he,!1):$p(J,W,w,he,!1,A),w+=he):(le=Hp(J,x,he,!1),x+=2*he),e[p++]=m.createLineString(le),F&&h++}else if(ge===Br.POLYGON){const le=Z[i]-Z[i-1];i++;const he=new Array(le-1);let xe=G[o]-G[o-1];if(o++,W&&W.length!==0){const Ae=n.vertexBufferType===ds.VEC_2?Bf(J,W,w,xe):Ad(J,W,w,xe,0,A);w+=xe;for(let He=0;He<he.length;He++)xe=G[o]-G[o-1],o++,he[He]=n.vertexBufferType===ds.VEC_2?Bf(J,W,w,xe):Ad(J,W,w,xe,0,A),w+=xe;e[p++]=m.createPolygon(Ae,he)}else{const Ae=Ed(J,x,xe);x+=2*xe;for(let He=0;He<he.length;He++)xe=G[o]-G[o-1],o++,he[He]=Ed(J,x,xe),x+=2*xe;e[p++]=m.createPolygon(Ae,he)}F&&h++}else if(ge===Br.MULTILINESTRING){const le=F[h]-F[h-1];h++;const he=new Array(le);if(W&&W.length!==0){for(let xe=0;xe<le;xe++){let Ae=0;K?(Ae=G[o]-G[o-1],o++):Ae=Z[i]-Z[i-1],i++;const He=n.vertexBufferType===ds.VEC_2?Pd(J,W,w,Ae,!1):$p(J,W,w,Ae,!1,A);he[xe]=He,w+=Ae}e[p++]=m.createMultiLineString(he)}else{for(let xe=0;xe<le;xe++){let Ae=0;K?(Ae=G[o]-G[o-1],o++):Ae=Z[i]-Z[i-1],i++,he[xe]=Hp(J,x,Ae,!1),x+=2*Ae}e[p++]=m.createMultiLineString(he)}}else{if(ge!==Br.MULTIPOLYGON)throw new Error("The specified geometry type is currently not supported.");{const le=F[h]-F[h-1];h++;const he=new Array(le);let xe=0;if(W&&W.length!==0){for(let Ae=0;Ae<le;Ae++){const He=Z[i]-Z[i-1];i++;const ut=new Array(He-1);xe=G[o]-G[o-1],o++;const st=n.vertexBufferType===ds.VEC_2?Bf(J,W,w,xe):Ad(J,W,w,xe,0,A);w+=xe;for(let ft=0;ft<ut.length;ft++)xe=G[o]-G[o-1],o++,ut[ft]=n.vertexBufferType===ds.VEC_2?Bf(J,W,w,xe):Ad(J,W,w,xe,0,A),w+=xe;he[Ae]=m.createPolygon(st,ut)}e[p++]=m.createMultiPolygon(he)}else{for(let Ae=0;Ae<le;Ae++){const He=Z[i]-Z[i-1];i++;
23const ut=new Array(He-1);xe=G[o]-G[o-1],o++;const st=Ed(J,x,xe);x+=2*xe;for(let ft=0;ft<ut.length;ft++){const zt=G[o]-G[o-1];o++,ut[ft]=Ed(J,x,zt),x+=2*zt}he[Ae]=m.createPolygon(st,ut)}e[p++]=m.createMultiPolygon(he)}}}}return e}function Ed(n,e,i){return Hp(n,e,i,!0)}function Bf(n,e,i,o){return Pd(n,e,i,o,!0)}function Ad(n,e,i,o,h,p){return $p(n,e,i,o,!0,p)}function Hp(n,e,i,o){const h=new Array(o?i+1:i);for(let p=0;p<2*i;p+=2)h[p/2]=new V(n[e+p],n[e+p+1]);return o&&(h[h.length-1]=h[0]),h}function Pd(n,e,i,o,h){const p=new Array(h?o+1:o);for(let m=0;m<2*o;m+=2){const x=2*e[i+m/2];p[m/2]=new V(n[x],n[x+1])}return h&&(p[p.length-1]=p[0]),p}function $p(n,e,i,o,h,p){const m=new Array(h?o+1:o);for(let x=0;x<o;x++){const w=Md(n[e[i+x]],p.numBits,p.coordinateShift);m[x]=new V(w.x,w.y)}return h&&(m[m.length-1]=m[0]),m}class zd{_vertexBufferType;_topologyVector;_vertexOffsets;_vertexBuffer;_mortonSettings;constructor(e,i,o,h,p){this._vertexBufferType=e,this._topologyVector=i,this._vertexOffsets=o,this._vertexBuffer=h,this._mortonSettings=p}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}*[Symbol.iterator](){const e=qp(this);let i=0;for(;i<this.numGeometries;)yield{coordinates:e[i],type:this.geometryType(i)},i++}getSimpleEncodedVertex(e){const i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){const o=Md(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[o.x,o.y]}const i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getGeometries(){return qp(this)}get mortonSettings(){return this._mortonSettings}}class Ld extends zd{_numGeometries;_geometryType;constructor(e,i,o,h,p,m,x){super(o,h,p,m,x),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Br.POLYGON||this._geometryType===Br.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class Dd extends zd{_geometryTypes;constructor(e,i,o,h,p,m){super(e,o,h,p,m),this._geometryTypes=i}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Br.POLYGON||this.geometryType(e)===Br.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class ig{_triangleOffsets;_indexBuffer;_vertexBuffer;_topologyVector;constructor(e,i,o,h){this._triangleOffsets=e,this._indexBuffer=i,this._vertexBuffer=o,this._topologyVector=h}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");const e=new Array(this.numGeometries),i=this._topologyVector,o=i.partOffsets,h=i.ringOffsets,p=i.geometryOffsets;let m=0,x=1,w=1,A=1;for(let k=0;k<this.numGeometries;k++)switch(this.geometryType(k)){case Br.POLYGON:{const F=o[x]-o[x-1];x++;const Z=[];for(let G=0;G<F;G++){const W=h[w]-h[w-1];w++;const K=[];for(let J=0;J<W;J++){const se=this._vertexBuffer[m++],ge=this._vertexBuffer[m++];K.push(new V(se,ge))}K.length>0&&K.push(K[0]),Z.push(K)}e[k]=Z,p&&A++}break;case Br.MULTIPOLYGON:{const F=p[A]-p[A-1];A++;const Z=[];for(let G=0;G<F;G++){const W=o[x]-o[x-1];x++;for(let K=0;K<W;K++){const J=h[w]-h[w-1];w++;const se=[];for(let ge=0;ge<J;ge++){const le=this._vertexBuffer[m++],he=this._vertexBuffer[m++];se.push(new V(le,he))}se.length>0&&se.push(se[0]),Z.push(se)}}e[k]=Z}}return e}[Symbol.iterator](){return null}}function Uh(n,e,i,o,h,p){return new Rg(n,e,i,o,h,p)}class Rg extends ig{_numGeometries;_geometryType;constructor(e,i,o,h,p,m){super(o,h,p,m),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function Xp(n,e,i,o,h){return new ng(n,e,i,o,h)}class ng extends ig{_geometryTypes;constructor(e,i,o,h,p){super(i,o,h,p),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function rg(n,e,i,o,h){const p=Ua(n,i);let m=null,x=null,w=null,A=null,k=null,F=null,Z=null,G=null;if(Lu(p,o,n,i)===_r.CONST){const K=jp(n,i,p,!1);for(let J=0;J<e-1;J++){const se=Ua(n,i);switch(se.physicalStreamType){case va.LENGTH:switch(se.logicalStreamType.lengthType){case ja.GEOMETRIES:m=gc(n,i,se);break;case ja.PARTS:x=gc(n,i,se);break;case ja.RINGS:w=gc(n,i,se);break;case ja.TRIANGLES:Z=gc(n,i,se)}break;case va.OFFSET:switch(se.logicalStreamType.offsetType){case pc.VERTEX:A=Va(n,i,se,!1);break;case pc.INDEX:G=Va(n,i,se,!1)}break;case va.DATA:Cl.VERTEX===se.logicalStreamType.dictionaryType?k=Va(n,i,se,!0):(F={numBits:se.numBits,coordinateShift:se.coordinateShift},k=Va(n,i,se,!1))}}return G!==null?m!=null||x!=null?Uh(o,K,Z,G,k,new Du(m,x,w)):Uh(o,K,Z,G,k):F===null?(function(J,se,ge,le,he){return new Ld(J,se,ds.VEC_2,ge,le,he)})(o,K,new Du(m,x,w),A,k):(function(J,se,ge,le,he,xe){return new Ld(J,se,ds.MORTON,ge,le,he,xe)})(o,K,new Du(m,x,w),A,k,F)}const W=Va(n,i,p,!1);for(let K=0;K<e-1;K++){const J=Ua(n,i);switch(J.physicalStreamType){case va.LENGTH:switch(J.logicalStreamType.lengthType){case ja.GEOMETRIES:m=Va(n,i,J,!1);break;case ja.PARTS:x=Va(n,i,J,!1);break;case ja.RINGS:w=Va(n,i,J,!1);break;case ja.TRIANGLES:Z=gc(n,i,J)}break;case va.OFFSET:switch(J.logicalStreamType.offsetType){case pc.VERTEX:A=Va(n,i,J,!1);break;case pc.INDEX:G=Va(n,i,J,!1)}break;case va.DATA:Cl.VERTEX===J.logicalStreamType.dictionaryType?k=Va(n,i,J,!0):(F={numBits:J.numBits,coordinateShift:J.coordinateShift},k=Va(n,i,J,!1))}}return G!==null&&x===null?Xp(W,Z,G,k):(m!==null?(m=Nf(W,m,2),x!==null&&w!==null?(x=Ff(W,m,x,!1),w=(function(K,J,se,ge){const le=new Int32Array(se[se.length-1]+1);let he=0;le[0]=he;let xe=1,Ae=1,He=0;for(let ut=0;ut<K.length;ut++){const st=K[ut],ft=J[ut+1]-J[ut];if(st!==0&&st!==3)for(let zt=0;zt<ft;zt++){const wt=se[xe]-se[xe-1];xe++;for(let at=0;at<wt;at++)he=le[Ae++]=he+ge[He++]}else for(let zt=0;zt<ft;zt++)le[Ae++]=++he,xe++}return le})(W,m,x,w)):x!==null&&(x=(function(K,J,se){const ge=new Int32Array(J[J.length-1]+1);let le=0;ge[0]=le;let he=1,xe=0;for(let Ae=0;Ae<K.length;Ae++){const He=K[Ae],ut=J[Ae+1]-J[Ae];if(He===4||He===1)for(let st=0;st<ut;st++)le=ge[he++]=le+se[xe++];else for(let st=0;st<ut;st++)ge[he++]=++le}return ge}
vendor: 10,415 bytes, line 23
23)(W,m,x))):x!==null&&w!==null?(x=Nf(W,x,1),w=Ff(W,x,w,!0)):x!==null&&(x=Nf(W,x,0)),G!==null?Xp(W,Z,G,k,new Du(m,x,w)):F===null?(function(K,J,se,ge){return new Dd(ds.VEC_2,K,J,se,ge)})(W,new Du(m,x,w),A,k):(function(K,J,se,ge,le){return new Dd(ds.MORTON,K,J,se,ge,le)})(W,new Du(m,x,w),A,k,F))}function Nf(n,e,i){const o=new Int32Array(n.length+1);let h=0;o[0]=h;let p=0;for(let m=0;m<n.length;m++)h=o[m+1]=h+(n[m]>i?e[p++]:1);return o}function Ff(n,e,i,o){const h=new Int32Array(e[e.length-1]+1);let p=0;h[0]=p;let m=1,x=0;for(let w=0;w<n.length;w++){const A=n[w],k=e[w+1]-e[w];if(A===5||A===2||o&&(A===4||A===1))for(let F=0;F<k;F++)p=h[m++]=p+i[x++];else for(let F=0;F<k;F++)h[m++]=++p}return h}class ag extends dc{dataVector;constructor(e,i,o){super(e,i.getBuffer(),o),this.dataVector=i}getValueFromBuffer(e){return this.dataVector.get(e)}}class sg extends Lf{getValueFromBuffer(e){return this.dataBuffer[e]}}class Id extends dc{constructor(e,i,o){super(e,BigInt64Array.of(i),o)}getValueFromBuffer(e){return this.dataBuffer[0]}}function kd(n,e,i){return og(n,Math.ceil(e/8),i)}function og(n,e,i){const o=new Uint8Array(e);let h=0;for(;h<e;){const p=n[i.increment()];if(p<=127){const m=p+3,x=n[i.increment()],w=h+m;o.fill(x,h,w),h=w}else{const m=256-p;for(let x=0;x<m;x++)o[h++]=n[i.increment()]}}return o}const Yp=new TextDecoder;function Rd(n,e,i){return i-e>=12?Yp.decode(n.subarray(e,i)):(function(o,h,p){let m="",x=h;for(;x<p;){const w=o[x];let A,k,F,Z=null,G=w>239?4:w>223?3:w>191?2:1;if(x+G>p)break;G===1?w<128&&(Z=w):G===2?(A=o[x+1],(192&A)==128&&(Z=(31&w)<<6|63&A,Z<=127&&(Z=null))):G===3?(A=o[x+1],k=o[x+2],(192&A)==128&&(192&k)==128&&(Z=(15&w)<<12|(63&A)<<6|63&k,(Z<=2047||Z>=55296&&Z<=57343)&&(Z=null))):G===4&&(A=o[x+1],k=o[x+2],F=o[x+3],(192&A)==128&&(192&k)==128&&(192&F)==128&&(Z=(15&w)<<18|(63&A)<<12|(63&k)<<6|63&F,(Z<=65535||Z>=1114112)&&(Z=null))),Z===null?(Z=65533,G=1):Z>65535&&(Z-=65536,m+=String.fromCharCode(Z>>>10&1023|55296),Z=56320|1023&Z),m+=String.fromCharCode(Z),x+=G}return m})(n,e,i)}class Vh extends dc{offsetBuffer;constructor(e,i,o,h){super(e,o,h),this.offsetBuffer=i}}class jf extends Vh{textEncoder;constructor(e,i,o,h){super(e,i,o,h??i.length-1),this.textEncoder=new TextEncoder}getValueFromBuffer(e){return Rd(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class Qc extends Vh{indexBuffer;textEncoder;constructor(e,i,o,h,p){super(e,o,h,p??i.length),this.indexBuffer=i,this.indexBuffer=i,this.textEncoder=new TextEncoder}getValueFromBuffer(e){const i=this.indexBuffer[e];return Rd(this.dataBuffer,this.offsetBuffer[i],this.offsetBuffer[i+1])}}class Uf extends Vh{indexBuffer;symbolOffsetBuffer;symbolTableBuffer;textEncoder;symbolLengthBuffer;lengthBuffer;decodedDictionary;constructor(e,i,o,h,p,m,x){super(e,o,h,x),this.indexBuffer=i,this.symbolOffsetBuffer=p,this.symbolTableBuffer=m,this.textEncoder=new TextEncoder}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer),this.lengthBuffer=this.offsetToLengthBuffer(this.offsetBuffer)),this.decodedDictionary=(function(o,h,p){const m=[],x=new Array(h.length).fill(0);for(let w=1;w<h.length;w++)x[w]=x[w-1]+h[w-1];for(let w=0;w<p.length;w++)if(p[w]===255)m.push(p[++w]);else{const A=h[p[w]],k=x[p[w]];for(let F=0;F<A;F++)m.push(o[k+F])}return new Uint8Array(m)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));const i=this.indexBuffer[e];return Rd(this.decodedDictionary,this.offsetBuffer[i],this.offsetBuffer[i+1])}offsetToLengthBuffer(e){const i=new Uint32Array(e.length-1);let o=e[0];for(let h=1;h<e.length;h++){const p=e[h];i[h-1]=p-o,o=p}return i}}function _c(n,e,i,o,h,p){return i.type==="scalarType"?(function(m,x,w,A,k,F){let Z=null,G=0;if(m===0)return null;if(F.nullable){const K=Ua(x,w);G=K.numValues;const J=w.get(),se=kd(x,G,w);w.set(J+K.byteLength),Z=new Ml(se,K.numValues)}const W=Z??A;switch(k.physicalType){case 4:case 3:return(function(K,J,se,ge,le){const he=Ua(K,J),xe=Lu(he,le,K,J),Ae=ge.physicalType===3;if(xe===_r.FLAT){const He=qo(le)?Zp(K,J,he,Ae,le):Va(K,J,he,Ae);return new Df(se.name,He,le)}if(xe===_r.SEQUENCE){const He=Up(K,J,he);return new Op(se.name,He[0],He[1],he.numRleValues)}{const He=jp(K,J,he,Ae);return new Bp(se.name,He,le)}})(x,w,F,k,W);case 9:return(function(K,J,se,ge,le){let he=null,xe=null,Ae=null,He=null,ut=null,st=null,ft=null,zt=null;for(let wt=0;wt<ge;wt++){const at=Ua(J,se);if(at.byteLength!==0)switch(at.physicalStreamType){case va.PRESENT:{const et=kd(J,at.numValues,se);st=new Ml(et,at.numValues);break}case va.OFFSET:xe=le!=null||st!=null?Zp(J,se,at,!1,le??st):Va(J,se,at,!1);break;case va.LENGTH:{const et=gc(J,se,at);ja.DICTIONARY===at.logicalStreamType.lengthType?he=et:ja.SYMBOL===at.logicalStreamType.lengthType?He=et:ft=et;break}case va.DATA:{const et=J.subarray(se.get(),se.get()+at.byteLength);se.add(at.byteLength);const Ot=at.logicalStreamType.dictionaryType;Cl.FSST===Ot?ut=et:Cl.SINGLE===Ot||Cl.SHARED===Ot?Ae=et:Cl.NONE===Ot&&(zt=et);break}}}return(function(wt,at,et,Ot,Dt,Zt,kt){return at?new Uf(wt,et,Ot,Dt,Zt,at,kt):null})(K,ut,xe,he,Ae,He,le??st)??(function(wt,at,et,Ot,Dt){return at?Dt?new Qc(wt,et,Ot,at,Dt):new Qc(wt,et,Ot,at):null})(K,Ae,xe,he,le??st)??(function(wt,at,et,Ot,Dt){if(!at||!et)return null;if(Ot)return Dt?new Qc(wt,Ot,at,et,Dt):new Qc(wt,Ot,at,et);if(Dt&&Dt.size()!==at.length-1){const Zt=new Int32Array(Dt.size());let kt=0;for(let ti=0;ti<Dt.size();ti++)Zt[ti]=Dt.get(ti)?kt++:0;return new Qc(wt,Zt,at,et,Dt)}return Dt?new jf(wt,at,et,Dt):new jf(wt,at,et)})(K,ft,zt,xe,le??st)})(F.name,x,w,F.nullable?m-1:m,Z);case 0:return(function(K,J,se,ge,le){const he=Ua(K,J),xe=he.numValues,Ae=J.get(),He=qo(le)?(function(st,ft,zt,wt){const at=og(st,Math.ceil(ft/8),zt),et=new Ml(at,ft),Ot=wt.size(),Dt=new Ml(new Uint8Array(Ot),Ot);let Zt=0;for(let kt=0;kt<wt.size();kt++){const ti=!!wt.get(kt)&&et.get(Zt++);Dt.set(kt,ti)}return Dt.getBuffer()})(K,xe,J,le):kd(K,xe,J);J.set(Ae+he.byteLength);const ut=new Ml(He,xe);return new ag(se.name,ut,le)})(x,w,F,0,W);case 6:case 5:return(function(K,J,se,ge,le){const he=Ua(K,J),xe=Lu(he,ge,K,J),Ae=le.physicalType===5;if(xe===_r.FLAT){const He=qo(ge)?(function(ut,st,ft,zt,wt){return(function(at,et,Ot,Dt){switch(et.logicalLevelTechnique1){case Li.DELTA:return et.logicalLevelTechnique2===Li.RLE&&(at=eg(at,et.runs,et.numRleValues)),(function(Zt,kt){const ti=new BigInt64Array(Zt.size());let Yi=0;Zt.get(0)?(ti[0]=Zt.get(0)?kt[0]>>1n^-(1n&kt[0]):0n,Yi=1):ti[0]=0n;let Ri=1;for(;Ri!=ti.length;++Ri)ti[Ri]=Zt.get(Ri)?ti[Ri-1]+(kt[Yi]>>1n^-(1n&kt[Yi++])):ti[Ri-1];return ti})(Dt,at);case Li.RLE:return(function(Zt,kt,ti,Yi){const Ri=kt;return ti?(function(Jn,Za,Fr){const er=new BigInt64Array(Jn.size());let Hn=0;for(let hn=0;hn<Fr;hn++){const dr=Number(Za[hn]);let yr=Za[hn+Fr];yr=yr>>1n^-(1n&yr);for(let Vn=Hn;Vn<Hn+dr;Vn++)Jn.get(Vn)?er[Vn]=yr:(er[Vn]=0n,Hn++);Hn+=dr}return er})(Yi,Zt,Ri.runs):(function(Jn,Za,Fr){const er=new BigInt64Array(Jn.size());let Hn=0;for(let hn=0;hn<Fr;hn++){const dr=Number(Za[hn]),yr=Za[hn+Fr];for(let Vn=Hn;Vn<Hn+dr;Vn++)Jn.get(Vn)?er[Vn]=yr:(er[Vn]=0n,Hn++);Hn+=dr}return er})(Yi,Zt,Ri.runs)})(at,et,Ot,Dt);case Li.NONE:return at=Ot?(function(Zt,kt){const ti=new BigInt64Array(Zt.size());let Yi=0,Ri=0;for(;Ri!=ti.length;++Ri)if(Zt.get(Ri)){const Jn=kt[Yi++];ti[Ri]=Jn>>1n^-(1n&Jn)}else ti[Ri]=0n;return ti})(Dt,at):(function(Zt,kt){const ti=new BigInt64Array(Zt.size());let Yi=0,Ri=0;for(;Ri!=ti.length;++Ri)ti[Ri]=Zt.get(Ri)?kt[Yi++]:0n;return ti})(Dt,at),at;default:throw new Error("The specified Logical level technique is not supported")}})(Cd(ut,st,ft.numValues),ft,zt,wt)})(K,J,he,Ae,ge):Fh(K,J,he,Ae);return new jh(se.name,He,ge)}if(xe===_r.SEQUENCE){const He=Kc(K,J,he);return new Gp(se.name,He[0],He[1],he.numRleValues)}{const He=Vp(K,J,he,Ae);return new Id(se.name,He,ge)}})(x,w,F,W,k);case 7:return(function(K,J,se,ge){const le=Ua(K,J),he=qo(ge)?(function(xe,Ae,He,ut){const st=Ae.get(),ft=st+ut*Float32Array.BYTES_PER_ELEMENT,zt=new Uint8Array(xe.subarray(st,ft)).buffer,wt=new Float32Array(zt);Ae.set(ft);const at=He.size(),et=new Float32Array(at);let Ot=0;for(let Dt=0;Dt<at;Dt++)et[Dt]=He.get(Dt)?wt[Ot++]:0;return et})(K,J,ge,le.numValues):(function(xe,Ae,He){const ut=Ae.get(),st=ut+He*Float32Array.BYTES_PER_ELEMENT,ft=new Uint8Array(xe.subarray(ut,st)).buffer,zt=new Float32Array(ft);return Ae.set(st),zt})(K,J,le.numValues);return new sg(se.name,he,ge)})(x,w,F,W);case 8:return(function(K,J,se,ge){const le=Ua(K,J),he=qo(ge)?(function(xe,Ae,He,ut){const st=Ae.get(),ft=st+ut*Float64Array.BYTES_PER_ELEMENT,zt=new Uint8Array(xe.subarray(st,ft)).buffer,wt=new Float64Array(zt);Ae.set(ft);const at=He.size(),et=new Float64Array(at);let Ot=0;for(let Dt=0;Dt<at;Dt++)et[Dt]=He.get(Dt)?wt[Ot++]:0;return et})(K,J,ge,le.numValues):(function(xe,Ae,He){const ut=Ae.get(),st=ut+He*Float64Array.BYTES_PER_ELEMENT,ft=new Uint8Array(xe.subarray(ut,st)).buffer,zt=new Float64Array(ft);return Ae.set(st),zt})(K,J,le.numValues);return new kp(se.name,he,ge)})(x,w,F,W);default:throw new Error(`The specified data type for the field is currently not supported: ${k}`)}})(o,n,e,h,i.scalarType,i):o!=1?null:(function(m,x,w,A){let k=null,F=null,Z=null,G=null,W=!1;for(;!W;){const ge=Ua(m,x);switch(ge.physicalStreamType){case va.LENGTH:ja.DICTIONARY===ge.logicalStreamType.lengthType?k=gc(m,x,ge):Z=gc(m,x,ge);break;case va.DATA:Cl.SINGLE===ge.logicalStreamType.dictionaryType||Cl.SHARED===ge.logicalStreamType.dictionaryType?(F=m.subarray(x.get(),x.get()+ge.byteLength),W=!0):G=m.subarray(x.get(),x.get()+ge.byteLength),x.add(ge.byteLength)}}const K=w.complexType.children,J=[];let se=0;for(const ge of K){const le=Nr(m,x,1)[0];if(le==0)continue;const he=`${w.name}${ge.name==="default"?"":":"+ge.name}`;if(le!==2||ge.type!=="scalarField"||ge.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");const xe=Ua(m,x),Ae=kd(m,xe.numValues,x),He=Ua(m,x),ut=He.decompressedCount!==A?Zp(m,x,He,!1,new Ml(Ae,xe.numValues)):Va(m,x,He,!1);J[se++]=G?new Uf(he,ut,k,F,Z,G,new Ml(Ae,xe.numValues)):new Qc(he,ut,k,F,new Ml(Ae,xe.numValues))}return J})(n,e,i,h)}function qo(n){return n instanceof Ml}function yc(n){if(n.name==="id")return!1;if(n.type==="scalarType"){const e=n.scalarType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 
236:case 7:case 8:default:return!1;case 9:return!0}else if(e.type==="logicalType")return!1}else if(n.type==="complexType"){const e=n.complexType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",n),!1}const Od=new TextDecoder;function Zh(n,e){const i=Nr(n,e,1)[0];if(i===0)return"";const o=e.get(),h=n.subarray(o,o+i);return e.add(i),Od.decode(h)}function Iu(n,e){const i=Nr(n,e,1)[0]>>>0,o=!!(4&i),h=!!(2&i),p=Nr(n,e,1)[0]>>>0,m={};if(1&i&&(m.nullable=!0),h){const x={};if(o?(x.type="logicalType",x.logicalType=p):(x.type="physicalType",x.physicalType=p),8&i){const w=Nr(n,e,1)[0]>>>0;x.children=new Array(w);for(let A=0;A<w;A++)x.children[A]=Iu(n,e)}m.type="complexField",m.complexField=x}else{const x={};o?(x.type="logicalType",x.logicalType=p):(x.type="physicalType",x.physicalType=p),m.type="scalarField",m.scalarField=x}return m}function Og(n,e){const i=Nr(n,e,1)[0]>>>0,o=(function(h){switch(h){case 0:case 1:case 2:case 3:{const p={};p.nullable=!!(1&h),p.columnScope=0;const m={};return m.physicalType=h>1?6:4,m.type="physicalType",p.scalarType=m,p.type="scalarType",p}case 4:{const p={nullable:!1,columnScope:0},m={type:"physicalType",physicalType:0};return p.type="complexType",p.complexType=m,p}case 30:{const p={nullable:!1,columnScope:0},m={type:"physicalType",physicalType:1};return p.type="complexType",p.complexType=m,p}default:return(function(p){let m=null;switch(p){case 10:case 11:m=0;break;case 12:case 13:m=1;break;case 14:case 15:m=2;break;case 16:case 17:m=3;break;case 18:case 19:m=4;break;case 20:case 21:m=5;break;case 22:case 23:m=6;break;case 24:case 25:m=7;break;case 26:case 27:m=8;break;case 28:case 29:m=9;break;default:return null}const x={};x.nullable=!!(1&p),x.columnScope=0;const w={type:"physicalType"};return w.physicalType=m,x.type="scalarType",x.scalarType=w,x})(h)}})(i);if(!o)throw new Error(`Unsupported column type code: ${i}`);if((function(h){return h>=10})(i)?o.name=Zh(n,e):i>=0&&i<=3?o.name="id":i===4&&(o.name="geometry"),(function(h){return h===30})(i)){const h=Nr(n,e,1)[0]>>>0,p=o.complexType;p.children=new Array(h);for(let m=0;m<h;m++)p.children[m]=Iu(n,e)}return o}function lg(n,e){const i={featureTables:[]},o={};o.name=Zh(n,e);const h=Nr(n,e,1)[0]>>>0,p=Nr(n,e,1)[0]>>>0;o.columns=new Array(p);for(let m=0;m<p;m++)o.columns[m]=Og(n,e);return i.featureTables.push(o),[i,h]}function Bd(n,e,i,o,h,p,m=!1){const x=e.scalarType.physicalType,w=Lu(h,p,n,i);if(x===4)switch(w){case _r.FLAT:{const A=Va(n,i,h,!1);return new Df(o,A,p)}case _r.SEQUENCE:{const A=Up(n,i,h);return new Op(o,A[0],A[1],h.numRleValues)}case _r.CONST:{const A=jp(n,i,h,!1);return new Bp(o,A,p)}}else switch(w){case _r.FLAT:{if(m){const k=(function(F,Z,G,W){const K=(function(J,se,ge){const le=new Float64Array(se);for(let he=0;he<se;he++)le[he]=Jm(J,ge);return le})(F,G.numValues,Z);return(function(J,se,ge){switch(se.logicalLevelTechnique1){case Li.DELTA:return se.logicalLevelTechnique2===Li.RLE&&(J=tg(J,se.runs,se.numRleValues)),(function(le){le[0]=le[0]%2==1?(le[0]+1)/-2:le[0]/2;const he=le.length/4*4;let xe=1;if(he>=4)for(;xe<he-4;xe+=4){const Ae=le[xe],He=le[xe+1],ut=le[xe+2],st=le[xe+3];le[xe]=(Ae%2==1?(Ae+1)/-2:Ae/2)+le[xe-1],le[xe+1]=(He%2==1?(He+1)/-2:He/2)+le[xe],le[xe+2]=(ut%2==1?(ut+1)/-2:ut/2)+le[xe+1],le[xe+3]=(st%2==1?(st+1)/-2:st/2)+le[xe+2]}for(;xe!=le.length;++xe)le[xe]=(le[xe]%2==1?(le[xe]+1)/-2:le[xe]/2)+le[xe-1]})(J),J;case Li.RLE:return(function(le,he,xe){return tg(le,he.runs,he.numRleValues)})(J,se);case Li.NONE:return J;default:throw new Error(`The specified Logical level technique is not supported: ${se.logicalLevelTechnique1}`)}})(K,G)})(n,i,h);return new kp(o,k,p)}const A=Fh(n,i,h,!1);return new jh(o,A,p)}case _r.SEQUENCE:{const A=Kc(n,i,h);return new Gp(o,A[0],A[1],h.numRleValues)}case _r.CONST:{const A=Vp(n,i,h,!1);return new Id(o,A,p)}}throw new Error("Vector type not supported for id column.")}class Bg{constructor(e,i){var o;switch(this._featureData=e,this.properties=this._featureData.properties||{},(o=this._featureData.geometry)===null||o===void 0?void 0:o.type){case Br.POINT:case Br.MULTIPOINT:this.t
23ype=1;break;case Br.LINESTRING:case Br.MULTILINESTRING:this.type=2;break;case Br.POLYGON:case Br.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=i,this.id=Number(this._featureData.id)}loadGeometry(){const e=[];for(const i of this._featureData.geometry.coordinates){const o=[];for(const h of i)o.push(new V(h.x,h.y));e.push(o)}return e}}class ug{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new Bg(this.features[e],this.extent)}}class Nd{constructor(e){this.layers={};const i=(function(o,h,p=!0){const m=new Qm(0),x=[];for(;m.get()<o.length;){const w=Nr(o,m,1)[0]>>>0,A=m.get()+w;if(A>o.length)throw new Error(`Block overruns tile: ${A} > ${o.length}`);if(Nr(o,m,1)[0]>>>0!=1){m.set(A);continue}const k=lg(o,m),F=k[1],Z=k[0].featureTables[0];let G=null,W=null;const K=[];let J=0;for(const ge of Z.columns){const le=ge.name;if(le==="id"){let he=null;if(ge.nullable){const Ae=Ua(o,m),He=m.get(),ut=kd(o,Ae.numValues,m);m.set(He+Ae.byteLength),he=new Ml(ut,Ae.numValues)}const xe=Ua(o,m);J=xe.decompressedCount,G=Bd(o,ge,m,le,xe,he??J,p)}else if(le==="geometry"){const he=Nr(o,m,1)[0];if(J===0){const xe=m.get();J=Ua(o,m).decompressedCount,m.set(xe)}W=rg(o,he,m,J)}else{const he=yc(ge)?Nr(o,m,1)[0]:1;if(he===0&&ge.type==="scalarType")continue;const xe=_c(o,m,ge,he,J);if(xe)if(Array.isArray(xe))for(const Ae of xe)K.push(Ae);else K.push(xe)}}const se=new fc(Z.name,W,G,K,F);x.push(se),m.set(A)}return x})(new Uint8Array(e));this.layers=i.reduce(((o,h)=>Object.assign(Object.assign({},o),{[h.name]:new ug(h)})),{})}}class cg{constructor(e,i){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{}
vendor: 31,752 bytes, line 23
23,this.extent=i,"id"in e&&(typeof e.id=="string"?this.id=parseInt(e.id,10):typeof e.id!="number"||isNaN(e.id)||(this.id=e.id))}loadGeometry(){const e=[],i=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(const o of i){const h=[];for(const p of o)h.push(new V(p[0],p[1]));e.push(h)}return e}}const Fd="_geojsonTileLayer";function Vf(n,e){e.writeVarintField(15,n.version||1),e.writeStringField(1,n.name||""),e.writeVarintField(5,n.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(let p=0;p<n.length;p++)i.feature=n.feature(p),e.writeMessage(2,Zf,i);const o=i.keys;for(const p of o)e.writeStringField(3,p);const h=i.values;for(const p of h)e.writeMessage(4,Gf,p)}function Zf(n,e){if(!n.feature)return;const i=n.feature;i.id!==void 0&&e.writeVarintField(1,i.id),e.writeMessage(2,hg,n),e.writeVarintField(3,i.type),e.writeMessage(4,Kp,i)}function hg(n,e){for(const i in n.feature?.properties){let o=n.feature.properties[i],h=n.keycache[i];if(o==null)continue;h===void 0&&(n.keys.push(i),h=n.keys.length-1,n.keycache[i]=h),e.writeVarint(h),typeof o!="string"&&typeof o!="boolean"&&typeof o!="number"&&(o=JSON.stringify(o));const p=typeof o+":"+o;let m=n.valuecache[p];m===void 0&&(n.values.push(o),m=n.values.length-1,n.valuecache[p]=m),e.writeVarint(m)}}function vc(n,e){return(e<<3)+(7&n)}function Wp(n){return n<<1^n>>31}function Kp(n,e){const i=n.loadGeometry(),o=n.type;let h=0,p=0;for(const m of i){let x=1;o===1&&(x=m.length),e.writeVarint(vc(1,x));const w=o===3?m.length-1:m.length;for(let A=0;A<w;A++){A===1&&o!==1&&e.writeVarint(vc(2,w-1));const k=m[A].x-h,F=m[A].y-p;e.writeVarint(Wp(k)),e.writeVarint(Wp(F)),h+=k,p+=F}n.type===3&&e.writeVarint(vc(7,1))}}function Gf(n,e){const i=typeof n;i==="string"?e.writeStringField(1,n):i==="boolean"?e.writeBooleanField(7,n):i==="number"&&(n%1!=0?e.writeDoubleField(3,n):n<0?e.writeSVarintField(6,n):e.writeVarintField(5,n))}class Qp{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new jl(Yt,16,0),this.grid3D=new jl(Yt,16,0),this.featureIndexArray=new re,this.promoteId=i}insert(e,i,o,h,p,m){const x=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,h,p);const w=m?this.grid3D:this.grid;for(let A=0;A<i.length;A++){const k=i[A],F=[1/0,1/0,-1/0,-1/0];for(let Z=0;Z<k.length;Z++){const G=k[Z];F[0]=Math.min(F[0],G.x),F[1]=Math.min(F[1],G.y),F[2]=Math.max(F[2],G.x),F[3]=Math.max(F[3],G.y)}F[0]<Yt&&F[1]<Yt&&F[2]>=0&&F[3]>=0&&w.insert(x,F[0],F[1],F[2],F[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new Gi(new gf(this.rawTileData)).layers:new Nd(this.rawTileData).layers,this.sourceLayerCoder=new Ip(this.vtLayers?Object.keys(this.vtLayers).sort():[Fd])),this.vtLayers}query(e,i,o,h){this.loadVTLayers();const p=e.params,m=Yt/e.tileSize/e.scale,x=Rt(p.filter,p.globalState),w=e.queryGeometry,A=e.queryPadding*m,k=hc.fromPoints(w),F=this.grid.query(k.minX-A,k.minY-A,k.maxX+A,k.maxY+A),Z=hc.fromPoints(e.cameraQueryGeometry).expandBy(A),G=this.grid3D.query(Z.minX,Z.minY,Z.maxX,Z.maxY,((J,se,ge,le)=>(function(he,xe,Ae,He,ut){for(const ft of he)if(xe<=ft.x&&Ae<=ft.y&&He>=ft.x&&ut>=ft.y)return!0;const st=[new V(xe,Ae),new V(xe,ut),new V(He,ut),new V(He,Ae)];if(he.length>2){for(const ft of st)if(ql(he,ft))return!0}for(let ft=0;ft<he.length-1;ft++)if(gm(he[ft],he[ft+1],st))return!0;return!1})(e.cameraQueryGeometry,J-A,se-A,ge+A,le+A)));for(const J of G)F.push(J);F.sort(qf);const W={};let K;for(let J=0;J<F.length;J++){const se=F[J];if(se===K)continue;K=se;const ge=this.featureIndexArray.get(se);let le=null;this.loadMatchingFeature(W,ge.bucketIndex,ge.sourceLayerIndex,ge.featureIndex,x,p.layers,p.availableImages,i,o,h,((he,xe,Ae)=>(le||(le=xl(he)),xe.queryIntersectsFeature({queryGeometry:w,feature:he,featureState:Ae,geometry:le,zoom:this.z,transform:e.transform,pixelsToTileUnits:m,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return W}loadMatchingFeature(e,i,o,h,p,m,x,w,A,k,F){const Z=this.bucketLayerIDs[i];if(m&&!Z.some((J=>m.has(J))))return;const G=this.sourceLayerCoder.decode(o),W=this.vtLayers[G].feature(h);if(p.needGeometry){const J=oo(W,!0);if(!p.filter(new an(this.tileID.overscaledZ),J,this.tileID.canonical))return}else if(!p.filter(new an(this.tileID.overscaledZ),W))return;const K=this.getId(W,G);for(let J=0;J<Z.length;J++){const se=Z[J];if(m&&!m.has(se))continue;const ge=w[se];if(!ge)continue;let le={};K&&k&&(le=k.getState(ge.sourceLayer||Fd,K));const he=wi({},A[se]);he.paint=dg(he.paint,ge.paint,W,le,x),he.layout=dg(he.layout,ge.layout,W,le,x);const xe=!F||F(W,ge,le);if(!xe)continue;const Ae=new zf(W,this.z,this.x,this.y,K);Ae.layer=he;let He=e[se];He===void 0&&(He=e[se]=[]),He.push({featureIndex:h,feature:Ae,intersectionZ:xe})}}lookupSymbolFeatures(e,i,o,h,p,m,x,w){const A={};this.loadVTLayers();const k=Rt(p.filterSpec,p.globalState);for(const F of e)this.loadMatchingFeature(A,o,h,F,k,m,x,w,i);return A}hasLayer(e){for(const i of this.bucketLayerIDs)for(const o of i)if(e===o)return!0;return!1}getId(e,i){var o;let h=e.id;return this.promoteId&&(h=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof h=="boolean"&&(h=Number(h)),h===void 0&&(!((o=e.properties)===null||o===void 0)&&o.cluster)&&this.promoteId&&(h=Number(e.properties.cluster_id))),h}}function dg(n,e,i,o,h){return vr(n,((p,m)=>{const x=e instanceof mu?e.get(m):null;return x&&x.evaluate?x.evaluate(i,o,h):x}))}function qf(n,e){return e-n}function r(n,e,i,o,h){const p=[];for(let m=0;m<n.length;m++){const x=n[m];let w;for(let A=0;A<x.length-1;A++){let k=x[A],F=x[A+1];k.x<e&&F.x<e||(k.x<e?k=new V(e,k.y+(e-k.x)/(F.x-k.x)*(F.y-k.y))._round():F.x<e&&(F=new V(e,k.y+(e-k.x)/(F.x-k.x)*(F.y-k.y))._round()),k.y<i&&F.y<i||(k.y<i?k=new V(k.x+(i-k.y)/(F.y-k.y)*(F.x-k.x),i)._round():F.y<i&&(F=new V(k.x+(i-k.y)/(F.y-k.y)*(F.x-k.x),i)._round()),k.x>=o&&F.x>=o||(k.x>=o?k=new V(o,k.y+(o-k.x)/(F.x-k.x)*(F.y-k.y))._round():F.x>=o&&(F=new V(o,k.y+(o-k.x)/(F.x-k.x)*(F.y-k.y))._round()),k.y>=h&&F.y>=h||(k.y>=h?k=new V(k.x+(h-k.y)/(F.y-k.y)*(F.x-k.x),h)._round():F.y>=h&&(F=new V(k.x+(h-k.y)/(F.y-k.y)*(F.x-k.x),h)._round()),w&&k.equals(w[w.length-1])||(w=[k],p.push(w)),w.push(F)))))}}return p}function s(n,e,i,o,h){switch(e){case 1:return(function(p,m,x,w){const A=[];for(const k of p)for(const F of k){const Z=w===0?F.x:F.y;Z>=m&&Z<=x&&A.push([F])}return A})(n,i,o,h);case 2:return y(n,i,o,h,!1);case 3:return y(n,i,o,h,!0)}return[]}function d(n,e,i,o,h){const p=o===0?M:I;let m=[];const x=[];for(let k=0;k<n.length-1;k++){const F=n[k],Z=n[k+1],G=o===0?F.x:F.y,W=o===0?Z.x:Z.y;let K=!1;G<e?W>e&&m.push(p(F,Z,e)):G>i?W<i&&m.push(p(F,Z,i)):m.push(F),W<e&&G>=e&&(m.push(p(F,Z,e)),K=!0),W>i&&G<=i&&(m.push(p(F,Z,i)),K=!0),!h&&K&&(x.push(m),m=[])}const w=n.length-1,A=o===0?n[w].x:n[w].y;return A>=e&&A<=i&&m.push(n[w]),h&&m.length>0&&!m[0].equals(m[m.length-1])&&m.push(new V(m[0].x,m[0].y)),m.length>0&&x.push(m),x}function y(n,e,i,o,h){const p=[];for(const m of n){const x=d(m,e,i,o,h);x.length>0&&p.push(...x)}return p}function M(n,e,i){return new V(i,n.y+(i-n.x)/(e.x-n.x)*(e.y-n.y))}function I(n,e,i){return new V(n.x+(i-n.y)/(e.y-n.y)*(e.x-n.x),i)}Nt("FeatureIndex",Qp,{omit:["rawTileData","sourceLayerCoder"]});class Y extends V{constructor(e,i,o,h){super(e,i),this.angle=o,h!==void 0&&(this.segment=h)}clone(){return new Y(this.x,this.y,this.angle,this.segment)}}function ue(n,e,i,o,h){if(e.segment===void 0||i===0)return!0;let p=e,m=e.segment+1,x=0;for(;x>-i/2;){if(m--,m<0)return!1;x-=n[m].dist(p),p=n[m]}x+=n[m].dist(n[m+1]),m++;const w=[];let A=0;for(;x<i/2;){const k=n[m],F=n[m+1];if(!F)return!1;let Z=n[m-1].angleTo(k)-k.angleTo(F);for(Z=Math.abs((Z+3*Math.PI)%(2*Math.PI)-Math.PI),w.push({distance:x,angleDelta:Z}),A+=Z;x-w[0].distance>o;)A-=w.shift().angleDelta;if(A>h)return!1;m++,x+=k.dist(F)}return!0}function De(n){let e=0;for(let i=0;i<n.length-1;i++)e+=n[i].dist(n[i+1]);return e}function Je(n,e,i){return n?.6*e*i:0}function ht(n,e){return Math.max(n?n.right-n.left:0,e?e.right-e.left:0)}function xt(n,e,i,o,h,p){const m=Je(i,h,p),x=ht(i,o)*p;let w=0;const A=De(n)/2;for(let k=0;k<n.length-1;k++){const F=n[k],Z=n[k+1],G=F.dist(Z);if(w+G>A){const W=(A-w)/G,K=xn.number(F.x,Z.x,W),J=xn.number(F.y,Z.y,W),se=new Y(K,J,Z.angleTo(F),k);return se._round(),!m||ue(n,se,x,m,e)?se:void 0}w+=G}}function nt(n,e,i,o,h,p,m,x,w){const A=Je(o,p,m),k=ht(o,h),F=k*m,Z=n[0].x===0||n[0].x===w||n[0].y===0||n[0].y===w;return e-F<e/4&&(e=F+e/4),ot(n,Z?e/2*x%e:(k/2+2*p)*m*x%e,e,A,i,F,Z,!1,w)}function ot(n,e,i,o,h,p,m,x,w){const A=p/2,k=De(n);let F=0,Z=e-i,G=[];for(let W=0;W<n.length-1;W++){const K=n[W],J=n[W+1],se=K.dist(J),ge=J.angleTo(K);for(;Z+i<F+se;){Z+=i;const le=(Z-F)/se,he=xn.number(K.x,J.x,le),xe=xn.number(K.y,J.y,le);if(he>=0&&he<w&&xe>=0&&xe<w&&Z-A>=0&&Z+A<=k){const Ae=new Y(he,xe,ge,W);Ae._round(),o&&!ue(n,Ae,p,o,h)||G.push(Ae)}}F+=se}return x||G.length||m||(G=ot(n,F/2,i,o,h,p,m,!0,w)),G}function Jt(n,e,i,o){const h=[],p=n.image,m=p.pixelRatio,x=p.paddedRect.w-2,w=p.paddedRect.h-2;let A={x1:n.left,y1:n.top,x2:n.right,y2:n.bottom};const k=p.stretchX||[[0,x]],F=p.stretchY||[[0,w]],Z=(et,Ot)=>et+Ot[1]-Ot[0],G=k.reduce(Z,0),W=F.reduce(Z,0),K=x-G,J=w-W;let se=0,ge=G,le=0,he=W,xe=0,Ae=K,He=0,ut=J;if(p.content&&o){const et=p.content,Ot=et[2]-et[0],Dt=et[3]-et[1];(p.textFitWidth||p.textFitHeight)&&(A=zu(n)),se=di(k,0,et[0]),le=di(F,0,et[1]),ge=di(k,et[0],et[2]),he=di(F,et[1],et[3]),xe=et[0]-se,He=et[1]-le,Ae=Ot-ge,ut=Dt-he}const st=A.x1,ft=A.y1,zt=A.x2-st,wt=A.y2-ft,at=(et,Ot,Dt,Zt)=>{const kt=Ge(et.stretch-se,ge,zt,st),ti=Oe(et.fixed-xe,Ae,et.stretch,G),Yi=Ge(Ot.stretch-le,he,wt,ft),Ri=Oe(Ot.fixed-He,ut,Ot.stretch,W),Jn=Ge(Dt.stretch-se,ge,zt,st),Za=Oe(Dt.fixed-xe,Ae,Dt.stretch,G),Fr=Ge(Zt.stretch-le,he,wt,ft),er=Oe(Zt.fixed-He,ut,Zt.stretch,W),Hn=new V(kt,Yi),hn=new V(Jn,Yi),dr=new V(Jn,Fr),yr=new V(kt,Fr),Vn=new V(ti/m,Ri/m),ho=new V(Za/m,er/m),Ga=e*Math.PI/180;if(Ga){const ba=Math.sin(Ga),sr=Math.cos(Ga),jr=[sr,-ba,ba,sr];Hn._matMult(jr),hn._matMult(jr),yr._matMult(jr),dr._matMult(jr)}const fo=et.stretch+et.fixed,Kl=Ot.stretch+Ot.fixed;return{tl:Hn,tr:hn,bl:yr,br:dr,tex:{x:p.paddedRect.x+1+fo,y:p.paddedRect.y+1+Kl,w:Dt.stretch+Dt.fixed-fo,h:Zt.stretch+Zt.fixed-Kl},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vn,pixelOffsetBR:ho,minFontScaleX:Ae/m/zt,minFontScaleY:ut/m/wt,isSDF:i}};if(o&&(p.stretchX||p.stretchY)){const et=Mn(k,K,G),Ot=Mn(F,J,W);for(let Dt=0;Dt<et.length-1;Dt++){const Zt=et[Dt],kt=et[Dt+1];for(let ti=0;ti<Ot.length-1;ti++)h.push(at(Zt,Ot[ti],kt,Ot[ti+1]))}}else h.push(at({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:x+1},{fixed:0,stretch:w+1}));return h}function di(n,e,i){let o=0;for(const h of n)o+=Math.max(e,Math.min(i,h[1]))-Math.max(e,Math.min(i,h[0]));return o}function Mn(n,e,i){const o=[{fixed:-1,stretch:0}];for(const[h,p]of n){const m=o[o.length-1];o.push({fixed:h-m.stretch,stretch:m.stretch}),o.push({fixed:h-m.stretch,stretch:m.stretch+(p-h)})}return o.push({fixed:e+1,stretch:i}),o}function Ge(n,e,i,o){return n/e*i+o}function Oe(n,e,i,o){return n-e*i/o}Nt("Anchor",Y);class We{constructor(e,i,o,h,p,m,x,w,A,k){var F;if(this.boxStartIndex=e.length,A){let Z=m.top,G=m.bottom;const W=m.collisionPadding;W&&(Z-=W[1],G+=W[3]);let K=G-Z;K>0&&(K=Math.max(10,K),this.circleDiameter=K)}else{const Z=!((F=m.image)===null||F===void 0)&&F.content&&(m.image.textFitWidth||m.image.textFitHeight)?zu(m):{x1:m.left,y1:m.top,x2:m.right,y2:m.bottom};Z.y1=Z.y1*x-w[0],Z.y2=Z.y2*x+w[2],Z.x1=Z.x1*x-w[3],Z.x2=Z.x2*x+w[1];const G=m.collisionPadding;if(G&&(Z.x1-=G[0]*x,Z.y1-=G[1]*x,Z.x2+=G[2]*x,Z.y2+=G[3]*x),k){const W=new V(Z.x1,Z.y1),K=new V(Z.x2,Z.y1),J=new V(Z.x1,Z.y2),se=new V(Z.x2,Z.y2),ge=k*Math.PI/180;W._rotate(ge),K._rotate(ge),J._rotate(ge),se._rotate(ge),Z.x1=Math.min(W.x,K.x,J.x,se.x),Z.x2=Math.max(W.x,K.x,J.x,se.x),Z.y1=Math.min(W.y,K.y,J.y,se.y),Z.y2=Math.max(W.y,K.y,J.y,se.y)}e.emplaceBack(i.x,i.y,Z.x1,Z.y1,Z.x2,Z.y2,o,h,p)}this.boxEndIndex=e.length}}class _t{constructor(e=[],i=(o,h)=>o<h?-1:o>h?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:o}=this,h=i[e];for(;e>0;){const p=e-1>>1,m=i[p];if(o(h,m)>=0)break;i[e]=m,e=p}i[e]=h}_down(e){const{data:i,compare:o}=this,h=this.length>>1,p=i[e];for(;e<h;){let m=1+(e<<1);const x=m+1;if(x<this.length&&o(i[x],i[m])<0&&(m=x),o(i[m],p)>=0)break;i[e]=i[m],e=m}i[e]=p}}function ci(n,e=1,i=!1){const o=hc.fromPoints(n[0]),h=Math.min(o.width(),o.height());let p=h/2;const m=new _t([],cn),{minX:x,minY:w,maxX:A,maxY:k}=o;if(h===0)return new V(x,w);for(let G=x;G<A;G+=h)for(let W=w;W<k;W+=h)m.push(new ei(G+p,W+p,p,n));let F=(function(G){let W=0,K=0,J=0;const se=G[0];for(let ge=0,le=se.length,he=le-1;ge<le;he=ge++){const xe=se[ge],Ae=se[he],He=xe.x*Ae.y-Ae.x*xe.y;K+=(xe.x+Ae.x)*He,J+=(xe.y+Ae.y)*He,W+=3*He}return new ei(K/W,J/W,0,G)})(n),Z=m.length;for(;m.length;){const G=m.pop();(G.d>F.d||!F.d)&&(F=G,i&&console.log("found best %d after %d probes",Math.round(1e4*G.d)/1e4,Z)),G.max-F.d<=e||(p=G.h/2,m.push(new ei(G.p.x-p,G.p.y-p,p,n)),m.push(new ei(G.p.x+p,G.p.y-p,p,n)),m.push(new ei(G.p.x-p,G.p.y+p,p,n)),m.push(new ei(G.p.x+p,G.p.y+p,p,n)),Z+=4)}return i&&(console.log(`num probes: ${Z}`),console.log(`best distance: ${F.d}`)),F.p}function cn(n,e){return e.max-n.max}function ei(n,e,i,o){this.p=new V(n,e),this.h=i,this.d=(function(h,p){let m=!1,x=1/0;for(let w=0;w<p.length;w++){const A=p[w];for(let k=0,F=A.length,Z=F-1;k<F;Z=k++){const G=A[k],W=A[Z];G.y>h.y!=W.y>h.y&&h.x<(W.x-G.x)*(h.y-G.y)/(W.y-G.y)+G.x&&(m=!m),x=Math.min(x,tp(h,G,W))}}return(m?1:-1)*Math.sqrt(x)})(this.p,o),this.max=this.d+this.h*Math.SQRT2}var ai;T.aP=void 0,(ai=T.aP||(T.aP={}))[ai.center=1]="center",ai[ai.left=2]="left",ai[ai.right=3]="right",ai[ai.top=4]="top",ai[ai.bottom=5]="bottom",ai[ai["top-left"]=6]="top-left",ai[ai["top-right"]=7]="top-right",ai[ai["bottom-left"]=8]="bottom-left",ai[ai["bottom-right"]=9]="bottom-right";const Ui=Number.POSITIVE_INFINITY;function on(n,e){return e[1]!==Ui?(function(i,o,h){let p=0,m=0;switch(o=Math.abs(o),h=Math.abs(h),i){case"top-right":case"top-left":case"top":m=h-7;break;case"bottom-right":case"bottom-left":case"bottom":m=7-h}switch(i){case"top-right":case"bottom-right":case"right":p=-o;break;case"top-left":case"bottom-left":case"left":p=o}return[p,m]})(n,e[0],e[1]):(function(i,o){let h=0,p=0;o<0&&(o=0);const m=o/Math.SQRT2;switch(i){case"top-right":case"top-left":p=m-7;break;case"bottom-right":case"bottom-left":p=7-m;break;case"bottom":p=7-o;break;case"top":p=o-7}switch(i){case"top-right":case"bottom-right":h=-m;break;case"top-left":case"bottom-left":h=m;break;case"left":h=o;break;case"right":h=-o}return[h,p]})(n,e[0])}function ku(n,e,i){var o;const h=n.layout,p=(o=h.get("text-variable-anchor-offset"))===null||o===void 0?void 0:o.evaluate(e,{},i);if(p){const x=p.values,w=[];for(let A=0;A<x.length;A+=2){const k=w[A]=x[A],F=x[A+1].map((Z=>Z*Ar));k.startsWith("top")?F[1]-=7:k.startsWith("bottom")&&(F[1]+=7),w[A+1]=F}return new wn(w)}const m=h.get("text-variable-anchor");if(m){let x;x=n._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[h.get("text-radial-offset").evaluate(e,{},i)*Ar,Ui]:h.get("text-offset").evaluate(e,{},i).map((A=>A*Ar));const w=[];for(const A of m)w.push(A,on(A,x));return new wn(w)}return null}function Jp(n){switch(n){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function $y(n,e,i,o,h,p,m,x,w,A,k,F){let Z=p.textMaxSize.evaluate(e,{});Z===void 0&&(Z=m);const G=n.layers[0].layout,W=G.get("icon-offset").evaluate(e,{},k),K=v_(i.horizontal),J=m/24,se=n.tilePixelRatio*J,ge=n.tilePixelRatio*Z/24,le=n.tilePixelRatio*x,he=n.tilePixelRatio*G.get("symbol-spacing"),xe=G.get("text-padding")*n.tilePixelRatio,Ae=(function(Dt,Zt,kt,ti=1){const Yi=Dt.get("icon-padding").evaluate(Zt,{},kt),Ri=Yi&&Yi.values;return[Ri[0]*ti,Ri[1]*ti,Ri[2]*ti,Ri[3]*ti]})(G,e,k,n.tilePixelRatio),He=G.get("text-max-angle")/180*Math.PI,ut=G.get("text-rotation-alignment")!=="viewport"&&G.get("symbol-placement")!=="point",st=G.get("icon-rotation-alignment")==="map"&&G.get("symbol-placement")!=="point",ft=G.get("symbol-placement"),zt=he/2,wt=G.get("icon-text-fit");let at;o&&wt!=="none"&&(n.allowVerticalPlacement&&i.vertical&&(at=Tl(o,i.vertical,wt,G.get("icon-text-fit-padding"),W,J)),K&&(o=Tl(o,K,wt,G.get("icon-text-fit-padding"),W,J)));const et=k?F.line.getGranularityForZoomLevel(k.z):1,Ot=(Dt,Zt)=>{Zt.x<0||Zt.x>=Yt||Zt.y<0||Zt.y>=Yt||(function(kt,ti,Yi,Ri,Jn,Za,Fr,er,Hn,hn,dr,yr,Vn,ho,Ga,fo,Kl,ba,sr,jr,fr,wa,Jc,Ru,im){const Gh=kt.addToLineVertexArray(ti,Yi);let jd,Hf,$f,Xf,T_=0,S_=0,C_=0,M_=0,qg=-1,Hg=-1;const eh={};let E_=Kn("");if(kt.allowVerticalPlacement&&Ri.vertical){const fs=er.layout.get("text-rotate").evaluate(fr,{},Ru)+90;$f=new We(Hn,ti,hn,dr,yr,Ri.vertical,Vn,ho,Ga,fs),Fr&&(Xf=new We(Hn,ti,hn,dr,yr,Fr,Kl,ba,Ga,fs))}if(Jn){const fs=er.layout.get("icon-rotate").evaluate(fr,{}),El=er.layout.get("icon-text-fit")!=="none",Ud=Jt(Jn,fs,Jc,El),Bu=Fr?Jt(Fr,fs,Jc,El):void 0;Hf=new We(Hn,ti,hn,dr,yr,Jn,Kl,ba,!1,fs),T_=4*Ud.length;const Vd=kt.iconSizeData;let xc=null;Vd.kind==="source"?(xc=[uo*er.layout.get("icon-size").evaluate(fr,{})],xc[0]>uc&&En(`${kt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Vd.kind==="composite"&&(xc=[uo*wa.compositeIconSizes[0].evaluate(fr,{},Ru),uo*wa.compositeIconSizes[1].evaluate(fr,{},Ru)],(xc[0]>uc||xc[1]>uc)&&En(`${kt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),kt.addSymbols(kt.icon,Ud,xc,jr,sr,fr,T.az.none,ti,Gh.lineStartIndex,Gh.lineLength,-1,Ru),qg=kt.icon.placedSymbolArray.length-1,Bu&&(S_=4*Bu.length,kt.addSymbols(kt.icon,Bu,xc,jr,sr,fr,T.az.vertical,ti,Gh.lineStartIndex,Gh.lineLength,-1,Ru),Hg=kt.icon.placedSymbolArray.length-1)}const A_=Object.keys(Ri.horizontal);for(const fs of A_){const El=Ri.horizontal[fs];if(!jd){E_=Kn(El.text);const Bu=er.layout.get("text-rotate").evaluate(fr,{},Ru);jd=new We(Hn,ti,hn,dr,yr,El,Vn,ho,Ga,Bu)}const Ud=El.positionedLines.length===1;if(C_+=y_(kt,ti,El,Za,er,Ga,fr,fo,Gh,Ri.vertical?T.az.horizontal:T.az.horizontalOnly,Ud?A_:[fs],eh,qg,wa,Ru),Ud)break}Ri.vertical&&(M_+=y_(kt,ti,Ri.vertical,Za,er,Ga,fr,fo,Gh,T.az.vertical,["vertical"],eh,Hg,wa,Ru));const Wy=jd?jd.boxStartIndex:kt.collisionBoxArray.length,Ky=jd?jd.boxEndIndex:kt.collisionBoxArray.length,Qy=$f?$f.boxStartIndex:kt.collisionBoxArray.length,Jy=$f?$f.boxEndIndex:kt.collisionBoxArray.length,ev=Hf?Hf.boxStartIndex:kt.collisionBoxArray.length,tv=Hf?Hf.boxEndIndex:kt.collisionBoxArray.length,iv=Xf?Xf.boxStartIndex:kt.collisionBoxArray.length,nv=Xf?Xf.boxEndIndex:kt.collisionBoxArray.length;let Ou=-1;const pg=(fs,El)=>fs&&fs.circleDiameter?Math.max(fs.circleDiameter,El):El;Ou=pg(jd,Ou),Ou=pg($f,Ou),Ou=pg(Hf,Ou),Ou=pg(Xf,Ou);const P_=Ou>-1?1:0;P_&&(Ou*=im/Ar),kt.glyphOffsetArray.length>=Rh.MAX_GLYPHS&&En("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fr.sortKey!==void 0&&kt.addToSortKeyRanges(kt.symbolInstances.length,fr.sortKey);const rv=ku(er,fr,Ru),[av,sv]=(function(fs,El){const Ud=fs.length,Bu=El?.values;if(Bu?.length>0)for(let Vd=0;Vd<Bu.length;Vd+=2){const xc=Bu[Vd+1];fs.emplaceBack(T.aP[Bu[Vd]],xc[0],xc[1])}return[Ud,fs.length]})(kt.textAnchorOffsets,rv);kt.symbolInstances.emplaceBack(ti.x,ti.y,eh.right>=0?eh.right:-1,eh.center>=0?eh.center:-1,eh.left>=0?eh.left:-1,eh.vertical||-1,qg,Hg,E_,Wy,Ky,Qy,Jy,ev,tv,iv,nv,hn,C_,M_,T_,S_,P_,0,Vn,Ou,av,sv)})(n,Zt,Dt,i,o,h,at,n.layers[0],n.collisionBoxArray,e.index,e.sourceLayerIndex,n.index,se,[xe,xe,xe,xe],ut,w,le,Ae,st,W,e,p,A,k,m)};if(ft==="line")for(const Dt of r(e.geometry,0,0,Yt,Yt)){const Zt=Cu(Dt,et),kt=nt(Zt,he,He,i.vertical||K,o,24,ge,n.overscaling,Yt);for(const ti of kt)K&&Xy(n,K.text,zt,ti)||Ot(Zt,ti)}else if(ft==="line-center"){for(const Dt of e.geometry)if(Dt.length>1){const Zt=Cu(Dt,et),kt=xt(Zt,He,i.vertical||K,o,24,ge);kt&&Ot(Zt,kt)}}else if(e.type==="Polygon")for(const Dt of nl(e.geometry,0)){const Zt=ci(Dt,16);Ot(Cu(Dt[0],et,!0),new Y(Zt.x,Zt.y,0))}else if(e.type==="LineString")for(const Dt of e.geometry){const Zt=Cu(Dt,et);Ot(Zt,new Y(Zt[0].x,Zt[0].y,0))}else if(e.type==="Point")for(const Dt of e.geometry)for(const Zt of Dt)Ot([Zt],new Y(Zt.x,Zt.y,0))}function y_(n,e,i,o,h,p,m,x,w,A,k,F,Z,G,W){const K=(function(ge,le,he,xe,Ae,He,ut,st){const ft=xe.layout.get("text-rotate").evaluate(He,{})*Math.PI/180,zt=[];for(const wt of le.positionedLines)for(const at of wt.positionedGlyphs){if(!at.rect)continue;const et=at.rect||{};let Ot=4,Dt=!0,Zt=1,kt=0;const ti=(Ae||st)&&at.vertical,Yi=at.metrics.advance*at.scale/2;if(st&&le.verticalizable&&(kt=wt.lineOffset/2-(at.imageName?-(Ar-at.metrics.width*at.scale)/2:(at.scale-1)*Ar)),at.imageName){const ba=ut[at.imageName];Dt=ba.sdf,Zt=ba.pixelRatio,Ot=1/Zt}const Ri=Ae?[at.x+Yi,at.y]:[0,0];let Jn=Ae?[0,0]:[at.x+Yi+he[0],at.y+he[1]-kt],Za=[0,0];ti&&(Za=Jn,Jn=[0,0]);const Fr=at.metrics.isDoubleResolution?2:1,er=(at.metrics.left-Ot)*at.scale-Yi+Jn[0],Hn=(-at.metrics.top-Ot)*at.scale+Jn[1],hn=er+et.w/Fr*at.scale/Zt,dr=Hn+et.h/Fr*at.scale/Zt,yr=new V(er,Hn),Vn=new V(hn,Hn),ho=new V(er,dr),Ga=new V(hn,dr);if(ti){const ba=new V(-Yi,Yi- -17),sr=-Math.PI/2,jr=12-Yi,fr=new V(22-jr,-(at.imageName?jr:0)),wa=new V(...Za);yr._rotateAround(sr,ba)._add(fr)._add(wa),Vn._rotateAround(sr,ba)._add(fr)._add(wa),ho._rotateAround(sr,ba)._add(fr)._add(wa),Ga._rotateAround(sr,ba)._add(fr)._add(wa)}if(ft){const ba=Math.sin(ft),sr=Math.cos(ft),jr=[sr,-ba,ba,sr];yr._matMult(jr),Vn._matMult(jr),ho._matMult(jr),Ga._matMult(jr)}const fo=new V(0,0),Kl=new V(0,0);zt.push({tl:yr,tr:Vn,bl:ho,br:Ga,tex:et,writingMode:le.writingMode,glyphOffset:Ri,sectionIndex:at.sectionIndex,isSDF:Dt,pixelOffsetTL:fo,pixelOffsetBR:Kl,minFontScaleX:0,minFontScaleY:0})}return zt})(0,i,x,h,p,m,o,n.allowVerticalPlacement),J=n.textSizeData;let se=null;J.kind==="source"?(se=[uo*h.layout.get("text-size").evaluate(m,{})],se[0]>uc&&En(`${n.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):J.kind==="composite"&&(se=[uo*G.compositeTextSizes[0].evaluate(m,{},W),uo*G.compositeTextSizes[1].evaluate(m,{},W)],(se[0]>uc||se[1]>uc)&&En(`${n.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),n.addSymbols(n.text,K,se,x,p,m,A,e,w.lineStartIndex,w.lineLength,Z,W);for(const ge of k)F[ge]=n.text.placedSymbolArray.length-1;return 4*K.length}function v_(n){for(const e in n)return n[e];return null}function Xy(n,e,i,o){const h=n.compareText;if(e in h){const p=h[e];for(let m=p.length-1;m>=0;m--)if(o.dist(p[m])<i)return!0}else h[e]=[];return h[e].push(o),!1}const x_=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Ng{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,o]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const h=o>>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);const p=x_[15&o];if(!p)throw new Error("Unrecognized array type.");const[m]=new Uint16Array(e,2,1),[x]=new Uint32Array(e,4,1);return new Ng(x,m,p,e)}constructor(e,i=64,o=Float64Array,h){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=x_.indexOf(this.ArrayType),m=2*e*this.ArrayType.BYTES_PER_ELEMENT,x=e*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-x%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${o}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+x+w,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+m+x+w),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+x+w,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=i,o}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Fg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,o,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:m,nodeSize:x}=this,w=[0,p.length-1,0],A=[];for(;w.length;){const k=w.pop()||0,F=w.pop()||0,Z=w.pop()||0;if(F-Z<=x){for(let J=Z;J<=F;J++){const se=m[2*J],ge=m[2*J+1];se>=e&&se<=o&&ge>=i&&ge<=h&&A.push(p[J])}continue}const G=Z+F>>1,W=m[2*G],K=m[2*G+1];W>=e&&W<=o&&K>=i&&K<=h&&A.push(p[G]),(k===0?e<=W:i<=K)&&(w.push(Z),w.push(G-1),w.push(1-k)),(k===0?o>=W:h>=K)&&(w.push(G+1),w.push(F),w.push(1-k))}return A}within(e,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:p,nodeSize:m}=this,x=[0,h.length-1,0],w=[],A=o*o;for(;x.length;){const k=x.pop()||0,F=x.pop()||0,Z=x.pop()||0;if(F-Z<=m){for(let J=Z;J<=F;J++)w_(p[2*J],p[2*J+1],e,i)<=A&&w.push(h[J]);continue}const G=Z+F>>1,W=p[2*G],K=p[2*G+1];w_(W,K,e,i)<=A&&w.push(h[G]),(k===0?e-o<=W:i-o<=K)&&(x.push(Z),x.push(G-1),x.push(1-k)),(k===0?e+o>=W:i+o>=K)&&(x.push(G+1),x.push(F),x.push(1-k))}return w}}function Fg(n,e,i,o,h,p){if(h-o<=i)return;const m=o+h>>1;b_(n,e,m,o,h,p),Fg(n,e,i,o,m-1,1-p),Fg(n,e,i,m+1,h,1-p)}function b_(n,e,i,o,h,p){for(;h>o;){if(h-o>600){const A=h-o+1,k=i-o+1,F=Math.log(A),Z=.5*Math.exp(2*F/3),G=.5*Math.sqrt(F*Z*(A-Z)/A)*(k-A/2<0?-1:1);b_(n,e,i,Math.max(o,Math.floor(i-k*Z/A+G)),Math.min(h,Math.floor(i+(A-k)*Z/A+G)),p)}const m=e[2*i+p];let x=o,w=h;for(em(n,e,o,i),e[2*h+p]>m&&em(n,e,o,h);x<w;){for(em(n,e,x,w),x++,w--;e[2*x+p]<m;)x++;for(;e[2*w+p]>m;)w--}e[2*o+p]===m?em(n,e,o,w):(w++,em(n,e,w,h)),w<=i&&(o=w+1),i<=w&&(h=w-1)}}function em(n,e,i,o){jg(n,i,o),jg(e,2*i,2*o),jg(e,2*i+1,2*o+1)}function jg(n,e,i){const o=n[e];n[e]=n[i],n[i]=o}function w_(n,e,i,o){const h=n-i,p=e-o;return h*h+p*p}var Ug;T.cI=void 0,(Ug=T.cI||(T.cI={})).create="create",Ug.load="load",Ug.fullLoad="fullLoad";let fg=null,tm=[];const Vg=1e3/60,Zg="loadTime",Gg="fullLoadTime",Yy={mark(n){performance.mark(n)},frame(n){const e=n;fg!=null&&tm.push(e-fg),fg=e},clearMetrics(){fg=null,tm=[],performance.clearMeasures(Zg),performance.clearMeasures(Gg);for(const n in T.cI)performance.clearMarks(T.cI[n])},getPerformanceMetrics(){performance.measure(Zg,T.cI.create,T.cI.load),performance.measure(Gg,T.cI.create,T.cI.fullLoad);const n=performance.getEntriesByName(Zg)[0].duration,e=performance.getEntriesByName(Gg)[0].duration,i=tm.length,o=1/(tm.reduce(((p,m)=>p+m),0)/i/1e3),h=tm.filter((p=>p>Vg)).reduce(((p,m)=>p+(m-Vg)/Vg),0);return{loadTime:n,fullLoadTime:e,fps:o,percentDroppedFrames:h/(i+h)*100,totalFrames:i}}};T.$=ve,T.A=dt,T.B=eo,T.C=Er,T.D=Ut,T.E=yt,T.F=function([n,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:n*Math.cos(e)*Math.sin(i),y:n*Math.sin(e)*Math.sin(i),z:n*Math.cos(i)}},T.G=xn,T.H=an,T.I=_n,T.J=fh,T.K=function(n){if(yn==null){const e=n.navigator?n.navigator.userAgent:null;yn=!!n.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return yn},T.L=class{constructor(n,e){this.target=n,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Ef((()=>this.process())),this.subscription=go(this.target,"message",(i=>this.receive(i)),!1),this.globalScope=ta(self)?n:window}registerMessageHandler(n,e){this.messageHandlers[n]=e}unregisterMessageHandler(n){delete this.messageHandlers[n]}sendAsync(n,e){return new Promise(((i,o)=>{const h=Math.round(1e18*Math.random()).toString(36).substring(0,10),p=e?go(e.signal,"abort",(()=>{p?.unsubscribe(),delete this.resolveRejects[h];const w={id:h,type:"<cancel>",origin:location.origin,targetMapId:n.targetMapId,sourceMapId:this.mapId};this.target.postMessage(w)}),Pp):null;this.resolveRejects[h]={resolve:w=>{p?.unsubscribe(),i(w)},reject:w=>{p?.unsubscribe(),o(w)}};const m=[],x=Object.assign(Object.assign({},n),{id:h,sourceMapId:this.mapId,origin:location.origin,data:to(n.data,m)});this.target.postMessage(x,{transfer:m})}))}receive(n){const e=n.data,i=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!=="resource://android"&&location.origin!=="resource://android"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];const o=this.abortControllers[i];return delete this.abortControllers[i],void(o&&o.abort())}if(ta(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(this.taskQueue.length===0)return;const n=this.taskQueue.shift(),e=this.tasks[n];delete this.tasks[n],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(n,e)}processTask(n,e){return u(this,void 0,void 0,(function*(){if(e.type==="<response>"){const h=this.resolveRejects[n];return delete this.resolveRejects[n],h?void(e.error?h.reject(Ju(e.error)):h.resolve(Ju(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(n,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const i=Ju(e.data),o=new AbortController;this.abortControllers[n]=o;try{const h=yield this.messageHandlers[e.type](e.sourceMapId,i,o);this.completeTask(n,null,h)}catch(h){this.completeTask(n,h)}}))}completeTask(n,e,i){const o=[];delete this.abortControllers[n];const h={id:n,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?to(e):null,data:to(i,o)};this.target.postMessage(h,{transfer:o})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},T.M=ae,T.N=function(){var n=new dt(16);return dt!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n},T.O=function(n,e,i){var o,h,p,m,x,w,A,k,F,Z,G,W,K=i[0],J=i[1],se=i[2];return e===n?(n[12]=e[0]*K+e[4]*J+e[8]*se+e[12],n[13]=e[1]*K+e[5]*J+e[9]*se+e[13],n[14]=e[2]*K+e[6]*J+e[10]*se+e[14],n[15]=e[3]*K+e[7]*J+e[11]*se+e[15]):(h=e[1],p=e[2],m=e[3],x=e[4],w=e[5],A=e[6],k=e[7],F=e[8],Z=e[9],G=e[10],W=e[11],n[0]=o=e[0],n[1]=h,n[2]=p,n[3]=m,n[4]=x,n[5]=w,n[6]=A,n[7]=k,n[8]=F,n[9]=Z,n[10]=G,n[11]=W,n[12]=o*K+x*J+F*se+e[12],n[13]=h*K+w*J+Z*se+e[13],n[14]=p*K+A*J+G*se+e[14],n[15]=m*K+k*J+W*se+e[15]),n},T.P=V,T.Q=function(n,e,i){var o=i[0],h=i[1],p=i[2];return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*o,n[4]=e[4]*h,n[5]=e[5]*h,n[6]=e[6]*h,n[7]=e[7]*h,n[8]=e[8]*p,n[9]=e[9]*p,n[10]=e[10]*p,n[11]=e[11]*p,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},T.R=Fa,T.S=function(n,e,i){var o=e[0],h=e[1],p=e[2],m=e[3],x=e[4],w=e[5],A=e[6],k=e[7],F=e[8],Z=e[9],G=e[10],W=e[11],K=e[12],J=e[13],se=e[14],ge=e[15],le=i[0],he=i[1],xe=i[2],Ae=i[3];return n[0]=le*o+he*x+xe*F+Ae*K,n[1]=le*h+he*w+xe*Z+Ae*J,n[2]=le*p+he*A+xe*G+Ae*se,n[3]=le*m+he*k+xe*W+Ae*ge,n[4]=(le=i[4])*o+(he=i[5])*x+(xe=i[6])*F+(Ae=i[7])*K,n[5]=le*h+he*w+xe*Z+Ae*J,n[6]=le*p+he*A+xe*G+Ae*se,n[7]=le*m+he*k+xe*W+Ae*ge,n[8]=(le=i[8])*o+(he=i[9])*x+(xe=i[10])*F+(Ae=i[11])*K,n[9]=le*h+he*w+xe*Z+Ae*J,n[10]=le*p+he*A+xe*G+Ae*se,n[
2311]=le*m+he*k+xe*W+Ae*ge,n[12]=(le=i[12])*o+(he=i[13])*x+(xe=i[14])*F+(Ae=i[15])*K,n[13]=le*h+he*w+xe*Z+Ae*J,n[14]=le*p+he*A+xe*G+Ae*se,n[15]=le*m+he*k+xe*W+Ae*ge,n},T.T=rf,T.U=function(n,e){const i={};for(let o=0;o<e.length;o++){const h=e[o];h in n&&(i[h]=n[h])}return i},T.V=Yl,T.W=ri,T.X=zp,T.Y=Xm,T.Z=Be,T._=u,T.a=Al,T.a$=qt,T.a0=lt,T.a1=js,T.a2=Ns,T.a3=Wm,T.a4=wd,T.a5=Yt,T.a6=function(n,e,i){if(!n)return e||{};if(!e)return n||{};const o=Sd(n),h=Sd(e);(function(m,x){x.removeAll&&(m.add.clear(),m.update.clear(),m.remove.clear(),x.remove.clear());for(const w of x.remove)m.add.delete(w),m.update.delete(w);for(const[w,A]of x.update){const k=m.update.get(w);k&&(x.update.set(w,Dp(k,A)),m.update.delete(w))}})(o,h);const p={};if((o.removeAll||h.removeAll)&&(p.removeAll=!0),p.remove=new Set([...o.remove,...h.remove]),p.add=new Map([...o.add,...h.add]),p.update=new Map([...o.update,...h.update]),p.remove.size&&p.add.size)for(const m of p.add.keys())p.remove.delete(m);return(function(m){const x={};return m.removeAll&&(x.removeAll=m.removeAll),m.remove&&(x.remove=Array.from(m.remove)),m.add&&(x.add=Array.from(m.add.values())),m.update&&(x.update=Array.from(m.update.values())
23),x})(p)},T.a7=function(n,e){const i=new Map;if(n==null||n.type==null)return i;if(n.type==="Feature"){const o=Td(n,e);return o==null?void 0:(i.set(o,n),i)}if(n.type==="FeatureCollection"){const o=new Set;for(const h of n.features){const p=Td(h,e);if(p==null||o.has(p))return;o.add(p),i.set(p,h)}return i}},T.a8=function(n,e,i){var o,h;const p=[];if(e.removeAll)n.clear();else if(e.remove)for(const m of e.remove){const x=n.get(m);x&&(p.push(x.geometry),n.delete(m))}if(e.add)for(const m of e.add){const x=Td(m,i);if(x==null)continue;const w=n.get(x);w&&p.push(w.geometry),p.push(m.geometry),n.set(x,m)}if(e.update)for(const m of e.update){const x=n.get(m.id);if(!x)continue;const w=!!m.newGeometry,A=m.removeAllProperties||((o=m.removeProperties)===null||o===void 0?void 0:o.length)>0||((h=m.addOrUpdateProperties)===null||h===void 0?void 0:h.length)>0;if(!w&&!A)continue;p.push(x.geometry);const k=Object.assign({},x);if(n.set(m.id,k),w&&(p.push(m.newGeometry),k.geometry=m.newGeometry),A){if(k.properties=m.removeAllProperties?{}:Object.assign({},k.properties||{}),m.removeProperties)for(const F of m.removeProperties)delete k.properties[F];if(m.addOrUpdateProperties)for(const{key:F,value:Z}of m.addOrUpdateProperties)k.properties[F]=Z}}return p},T.a9=un,T.aA=function(n,{uSize:e,uSizeT:i},{lowerSize:o,upperSize:h}){return n.kind==="source"?o/uo:n.kind==="composite"?xn.number(o/uo,h/uo,i):e},T.aB=function(n,e){var i=e[0],o=e[1],h=e[2],p=e[3],m=e[4],x=e[5],w=e[6],A=e[7],k=e[8],F=e[9],Z=e[10],G=e[11],W=e[12],K=e[13],J=e[14],se=e[15],ge=i*x-o*m,le=i*w-h*m,he=i*A-p*m,xe=o*w-h*x,Ae=o*A-p*x,He=h*A-p*w,ut=k*K-F*W,st=k*J-Z*W,ft=k*se-G*W,zt=F*J-Z*K,wt=F*se-G*K,at=Z*se-G*J,et=ge*at-le*wt+he*zt+xe*ft-Ae*st+He*ut;return et?(n[0]=(x*at-w*wt+A*zt)*(et=1/et),n[1]=(h*wt-o*at-p*zt)*et,n[2]=(K*He-J*Ae+se*xe)*et,n[3]=(Z*Ae-F*He-G*xe)*et,n[4]=(w*ft-m*at-A*st)*et,n[5]=(i*at-h*ft+p*st)*et,n[6]=(J*he-W*He-se*le)*et,n[7]=(k*He-Z*he+G*le)*et,n[8]=(m*wt-x*ft+A*ut)*et,n[9]=(o*ft-i*wt-p*ut)*et,n[10]=(W*Ae-K*he+se*ge)*et,n[11]=(F*he-k*Ae-G*ge)*et,n[12]=(x*st-m*zt-w*ut)*et,n[13]=(i*zt-o*st+h*ut)*et,n[14]=(K*le-W*xe-J*ge)*et,n[15]=(k*xe-F*le+Z*ge)*et,n):null},T.aC=mt,T.aD=function(n){var e=n[0],i=n[1];return Math.sqrt(e*e+i*i)},T.aE=function(n){return n[0]=0,n[1]=0,n},T.aF=function(n,e,i){return n[0]=e[0]*i,n[1]=e[1]*i,n},T.aG=Cp,T.aH=ii,T.aI=function(n,e,i,o){const h=e.y-n.y,p=e.x-n.x,m=o.y-i.y,x=o.x-i.x,w=m*p-x*h;if(w===0)return null;const A=(x*(n.y-i.y)-m*(n.x-i.x))/w;return new V(n.x+A*p,n.y+A*h)},T.aJ=r,T.aK=Zc,T.aL=function(n){let e=1/0,i=1/0,o=-1/0,h=-1/0;for(const p of n)e=Math.min(e,p.x),i=Math.min(i,p.y),o=Math.max(o,p.x),h=Math.max(h,p.y);return[e,i,o,h]},T.aM=Ar,T.aN=It,T.aO=function(n,e,i,o,h=!1){if(!i[0]&&!i[1])return[0,0];const p=h?o==="map"?-n.bearingInRadians:0:o==="viewport"?n.bearingInRadians:0;if(p){const m=Math.sin(p),x=Math.cos(p);i=[i[0]*x-i[1]*m,i[0]*m+i[1]*x]}return[h?i[0]:It(e,i[0],n.zoom),h?i[1]:It(e,i[1],n.zoom)]},T.aQ=wf,T.aR=Jp,T.aS=bp,T.aT=Ng,T.aU=Fn,T.aV=dd,T.aW=de,T.aX=Lt,T.aY=Xe,T.aZ=Sa,T.a_=Lp,T.aa=hc,T.ab=25,T.ac=ea,T.ad=n=>{const e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(const o of n){const h=window.document.createElement("source");Ue(o)||(e.crossOrigin="Anonymous"),h.src=o,e.appendChild(h)}}))},T.ae=Ve,T.af=function(){return Wi++},T.ag=f,T.ah=Rh,T.ai=Fd,T.aj=Rt,T.ak=oo,T.al=zf,T.am=function(n){const e={};if(n.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((i,o,h,p)=>{const m=h||p;return e[o]=!m||m.toLowerCase(),""})),e["max-age"]){const i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e},T.an=Ct,T.ao=85.051129,T.ap=pr,T.aq=function(n){return Math.pow(2,n)},T.ar=Vt,T.as=Ym,T.at=function(n){return Math.log(n)/Math.LN2},T.au=function(n){var e=n[0],i=n[1];return e*e+i*i},T.av=function(n){if(!n.length)return new Set;const e=Math.max(...n.map((w=>w.canonical.z)));let i=1/0,o=-1/0,h=1/0,p=-1/0;const m=[];for(const w of n){const{x:A,y:k,z:F}=w.canonical,Z=Math.pow(2,e-F),G=A*Z,W=k*Z;m.push({id:w,x:G,y:W}),G<i&&(i=G),G>o&&(o=G),W<h&&(h=W),W>p&&(p=W)}const x=new Set;for(const w of m)w.x!==i&&w.x!==o&&w.y!==h&&w.y!==p||x.add(w.id);return x},T.aw=function(n,e){const i=Math.abs(2*n.wrap)-+(n.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return n.overscaledZ-e.overscaledZ||o-i||e.canonical.y-n.canonical.y||e.canonical.x-n.canonical.x},T.ax=class{constructor(n,e){this.max=n,this.onRemove=e,this.reset()}reset(){for(const n in this.data)for(const e of this.data[n])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(n,e,i){const o=n.wrapped().key;this.data[o]===void 0&&(this.data[o]=[]);const h={value:e,timeout:void 0};if(i!==void 0&&(h.timeout=setTimeout((()=>{this.remove(n,h)}
vendor: 39,533 bytes, line 23
23),i)),this.data[o].push(h),this.order.push(o),this.order.length>this.max){const p=this._getAndRemoveByKey(this.order[0]);p&&this.onRemove(p)}return this}has(n){return n.wrapped().key in this.data}getAndRemove(n){return this.has(n)?this._getAndRemoveByKey(n.wrapped().key):null}_getAndRemoveByKey(n){const e=this.data[n].shift();return e.timeout&&clearTimeout(e.timeout),this.data[n].length===0&&delete this.data[n],this.order.splice(this.order.indexOf(n),1),e.value}getByKey(n){const e=this.data[n];return e?e[0].value:null}get(n){return this.has(n)?this.data[n.wrapped().key][0].value:null}remove(n,e){if(!this.has(n))return this;const i=n.wrapped().key,o=e===void 0?0:this.data[i].indexOf(e),h=this.data[i][o];return this.data[i].splice(o,1),h.timeout&&clearTimeout(h.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(h.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(n){for(this.max=n;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(n){const e=[];for(const i in this.data)for(const o of this.data[i])n(o.value)||e.push(o);for(const i of e)this.remove(i.value.tileID,i)}},T.ay=function(n,e){let i=0,o=0;if(n.kind==="constant")o=n.layoutSize;else if(n.kind!=="source"){const{interpolationType:h,minZoom:p,maxZoom:m}=n,x=h?Ct(Zn.interpolationFactor(h,e,p,m),0,1):0;n.kind==="camera"?o=xn.number(n.minSize,n.maxSize,x):i=x}return{uSizeT:i,uSize:o}},T.b=Ta,T.b$=so,T.b0=Kt,T.b1=function(n){var e=new dt(3);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e},T.b2=function(n,e,i){return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],n},T.b3=function(n,e){var i=e[0],o=e[1],h=e[2],p=i*i+o*o+h*h;return p>0&&(p=1/Math.sqrt(p)),n[0]=e[0]*p,n[1]=e[1]*p,n[2]=e[2]*p,n},T.b4=Ht,T.b5=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]},T.b6=function(n,e,i){return n[0]=e[0]*i[0],n[1]=e[1]*i[1],n[2]=e[2]*i[2],n[3]=e[3]*i[3],n},T.b7=Ft,T.b8=function(n,e,i){const o=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return o===0?null:(-(n[0]*i[0]+n[1]*i[1]+n[2]*i[2])-i[3])/o},T.b9=si,T.bA=function(){return new Float64Array(3)},T.bB=Ke,T.bC=function(n,e,i){var o=i[0],h=i[1],p=i[2],m=i[3],x=e[0],w=e[1],A=e[2],k=h*A-p*w,F=p*x-o*A,Z=o*w-h*x;return n[0]=x+m*(k+=k)+h*(Z+=Z)-p*(F+=F),n[1]=w+m*F+p*k-o*Z,n[2]=A+m*Z+o*F-h*k,n},T.bD=function(n,e,i){const o=(h=[n[0],n[1],n[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((k=h[8])*(m=h[4])-(x=h[5])*(A=h[7]))+h[1]*(-k*(p=h[3])+x*(w=h[6]))+h[2]*(A*p-m*w);var h,p,m,x,w,A,k;if(o===0)return null;const F=Ht([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),Z=Ht([],[i[0],i[1],i[2]],[n[0],n[1],n[2]]),G=Ht([],[n[0],n[1],n[2]],[e[0],e[1],e[2]]),W=qt([],F,-n[3]);return Kt(W,W,qt([],Z,-e[3])),Kt(W,W,qt([],G,-i[3])),qt(W,W,1/o),W},T.bE=Af,T.bF=function(){return new Float64Array(4)},T.bG=function(n,e,i,o){var h=[],p=[];return h[0]=e[0]-i[0],h[1]=e[1]-i[1],h[2]=e[2]-i[2],p[0]=h[0]*Math.cos(o)-h[1]*Math.sin(o),p[1]=h[0]*Math.sin(o)+h[1]*Math.cos(o),p[2]=h[2],n[0]=p[0]+i[0],n[1]=p[1]+i[1],n[2]=p[2]+i[2],n},T.bH=function(n,e,i,o){var h=[],p=[];return h[0]=e[0]-i[0],h[1]=e[1]-i[1],h[2]=e[2]-i[2],p[0]=h[0],p[1]=h[1]*Math.cos(o)-h[2]*Math.sin(o),p[2]=h[1]*Math.sin(o)+h[2]*Math.cos(o),n[0]=p[0]+i[0],n[1]=p[1]+i[1],n[2]=p[2]+i[2],n},T.bI=function(n,e,i,o){var h=[],p=[];return h[0]=e[0]-i[0],h[1]=e[1]-i[1],h[2]=e[2]-i[2],p[0]=h[2]*Math.sin(o)+h[0]*Math.cos(o),p[1]=h[1],p[2]=h[2]*Math.cos(o)-h[0]*Math.sin(o),n[0]=p[0]+i[0],n[1]=p[1]+i[1],n[2]=p[2]+i[2],n},T.bJ=function(n,e,i){var o=Math.sin(i),h=Math.cos(i),p=e[0],m=e[1],x=e[2],w=e[3],A=e[8],k=e[9],F=e[10],Z=e[11];return e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=p*h-A*o,n[1]=m*h-k*o,n[2]=x*h-F*o,n[3]=w*h-Z*o,n[8]=p*o+A*h,n[9]=m*o+k*h,n[10]=x*o+F*h,n[11]=w*o+Z*h,n},T.bK=function(n,e){const i=ze(n,360),o=ze(e,360),h=o-i,p=o>i?h-360:h+360;return Math.abs(h)<Math.abs(p)?h:p},T.bL=function(n){return n[0]=0,n[1]=0,n[2]=0,n},T.bM=function(n,e,i,o){const h=Math.sqrt(n*n+e*e),p=Math.sqrt(i*i+o*o);n/=h,e/=h,i/=p,o/=p;const m=Math.acos(n*i+e*o);return-e*i+n*o>0?m:-m},T.bN=function(n,e){const i=ze(n,2*Math.PI),o=ze(e,2*Math.PI);return Math.min(Math.abs(i-o),Math.abs(i-o+2*Math.PI),Math.abs(i-o-2*Math.PI))},T.bO=function(){const n={},e=ke.$version;for(const i in ke.$root){const o=ke.$root[i];if(o.required){let h=null;h=i==="version"?e:o.type==="array"?[]:{},h!=null&&(n[i]=h)}}return n},T.bP=Pe,T.bQ=gh,T.bR=function n(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let o=0;o<e.length;o++)if(!n(e[o],i[o]))return!1;return!0}if(typeof e=="object"&&e!==null&&i!==null){if(typeof i!="object"||Object.keys(e).length!==Object.keys(i).length)return!1;for(const o in e)if(!n(e[o],i[o]))return!1;return!0}return e===i},T.bS=function(n){n=n.slice();const e=Object.create(null);for(let i=0;i<n.length;i++)e[n[i].id]=n[i];for(let i=0;i<n.length;i++)"ref"in n[i]&&(n[i]=Hi(n[i],e[n[i].ref]));return n},T.bT=function(n,e){if(n.type==="custom")return new Ap(n,e);switch(n.type){case"background":return new qi(n,e);case"circle":return new ef(n,e);case"color-relief":return new wm(n,e);case"fill":return new Em(n,e);case"fill-extrusion":return new pp(n,e);case"heatmap":return new xm(n,e);case"hillshade":return new Qn(n,e);case"line":return new gp(n,e);case"raster":return new gl(n,e);case"symbol":return new cc(n,e)}},T.bU=n=>n.type==="raster",T.bV=xr,T.bW=function(n,e){if(!n)return[{command:"setStyle",args:[e]}];let i=[];try{if(!Gt(n.version,e.version))return[{command:"setStyle",args:[e]}];Gt(n.center,e.center)||i.push({command:"setCenter",args:[e.center]}),Gt(n.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),Gt(n.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),Gt(n.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),Gt(n.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),Gt(n.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),Gt(n.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),Gt(n.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),Gt(n.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),Gt(n.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),Gt(n.light,e.light)||i.push({command:"setLight",args:[e.light]}),Gt(n.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),Gt(n.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),Gt(n.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const o={},h=[];(function(m,x,w,A){let k;for(k in x=x||{},m=m||{})Object.prototype.hasOwnProperty.call(m,k)&&(Object.prototype.hasOwnProperty.call(x,k)||rn(k,w,A));for(k in x)Object.prototype.hasOwnProperty.call(x,k)&&(Object.prototype.hasOwnProperty.call(m,k)?Gt(m[k],x[k])||(m[k].type==="geojson"&&x[k].type==="geojson"&&tr(m,x,k)?Wt(w,{command:"setGeoJSONSourceData",args:[k,x[k].data]}):dn(k,x,w,A)):yi(k,x,w))})(n.sources,e.sources,h,o);const p=[];n.layers&&n.layers.forEach((m=>{"source"in m&&o[m.source]?i.push({command:"removeLayer",args:[m.id]}):p.push(m)})),i=i.concat(h),(function(m,x,w){x=x||[];const A=(m=m||[]).map(An),k=x.map(An),F=m.reduce(Qi,{}),Z=x.reduce(Qi,{}),G=A.slice(),W=Object.create(null);let K,J,se,ge,le;for(let he=0,xe=0;he<A.length;he++)K=A[he],Object.prototype.hasOwnProperty.call(Z,K)?xe++:(Wt(w,{command:"removeLayer",args:[K]}),G.splice(G.indexOf(K,xe),1));for(let he=0,xe=0;he<k.length;he++)K=k[k.length-1-he],G[G.length-1-he]!==K&&(Object.prototype.hasOwnProperty.call(F,K)?(Wt(w,{command:"removeLayer",args:[K]}),G.splice(G.lastIndexOf(K,G.length-xe),1)):xe++,ge=G[G.length-he],Wt(w,{command:"addLayer",args:[Z[K],ge]}),G.splice(G.length-he,0,K),W[K]=!0);for(let he=0;he<k.length;he++)if(K=k[he],J=F[K],se=Z[K],!W[K]&&!Gt(J,se))if(Gt(J.source,se.source)&&Gt(J["source-layer"],se["source-layer"])&&Gt(J.type,se.type)){for(le in ir(J.layout,se.layout,w,K,null,"setLayoutProperty"),ir(J.paint,se.paint,w,K,null,"setPaintProperty"),Gt(J.filter,se.filter)||Wt(w,{command:"setFilter",args:[K,se.filter]}),Gt(J.minzoom,se.minzoom)&&Gt(J.maxzoom,se.maxzoom)||Wt(w,{command:"setLayerZoomRange",args:[K,se.minzoom,se.maxzoom]}),J)Object.prototype.hasOwnProperty.call(J,le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?ir(J[le],se[le],w,K,le.slice(6),"setPaintProperty"):Gt(J[le],se[le])||Wt(w,{command:"setLayerProperty",args:[K,le,se[le]]}));for(le in se)Object.prototype.hasOwnProperty.call(se,le)&&!Object.prototype.hasOwnProperty.call(J,le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?ir(J[le],se[le],w,K,le.slice(6),"setPaintProperty"):Gt(J[le],se[le])||Wt(w,{command:"setLayerProperty",args:[K,le,se[le]]}))}else Wt(w,{command:"removeLayer",args:[K]}),ge=G[G.lastIndexOf(K)+1],Wt(w,{command:"addLayer",args:[se,ge]})})(p,e.layers,i)}catch(o){console.warn("Unable to compute style diff:",o),i=[{command:"setStyle",args:[e]}]}return i},T.bX=function(n){const e=[],i=n.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),n.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),n.renderingMode&&n.renderingMode!=="2d"&&n.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},T.bY=vr,T.bZ=Ur,T.b_=class extends Ba{constructor(n,e){super(n,e),this.current=0}set(n){this.current!==n&&(this.current=n,this.gl.uniform1i(this.location,n))}},T.ba=function(n,e,i){return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n},T.bb=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]},T.bc=Km,T.bd=Bh,T.be=function(n,e,i,o,h){var p=1/Math.tan(e/2);if(n[0]=p/i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,h!=null&&h!==1/0){var m=1/(o-h);n[10]=(h+o)*m,n[14]=2*h*o*m}else n[10]=-1,n[14]=-2*o;return n},T.bf=function(n){var e=new dt(16);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],e},T.bg=function(n,e,i){var o=Math.sin(i),h=Math.cos(i),p=e[0],m=e[1],x=e[2],w=e[3],A=e[4],k=e[5],F=e[6],Z=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=p*h+A*o,n[1]=m*h+k*o,n[2]=x*h+F*o,n[3]=w*h+Z*o,n[4]=A*h-p*o,n[5]=k*h-m*o,n[6]=F*h-x*o,n[7]=Z*h-w*o,n},T.bh=function(n,e,i){var o=Math.sin(i),h=Math.cos(i),p=e[4],m=e[5],x=e[6],w=e[7],A=e[8],k=e[9],F=e[10],Z=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=p*h+A*o,n[5]=m*h+k*o,n[6]=x*h+F*o,n[7]=w*h+Z*o,n[8]=A*h-p*o,n[9]=k*h-m*o,n[10]=F*h-x*o,n[11]=Z*h-w*o,n},T.bi=function(){const n=new Float32Array(16);return Vt(n),n},T.bj=function(){const n=new Float64Array(16);return Vt(n),n},T.bk=function(){return new Float64Array(16)},T.bl=function(n,e,i){const o=new Float64Array(4);return Ke(o,n,e-90,i),o},T.bm=function(n,e,i,o){var h,p,m,x,w,A=e[0],k=e[1],F=e[2],Z=e[3],G=i[0],W=i[1],K=i[2],J=i[3];return(p=A*G+k*W+F*K+Z*J)<0&&(p=-p,G=-G,W=-W,K=-K,J=-J),1-p>Tt?(h=Math.acos(p),m=Math.sin(h),x=Math.sin((1-o)*h)/m,w=Math.sin(o*h)/m):(x=1-o,w=o),n[0]=x*A+w*G,n[1]=x*k+w*W,n[2]=x*F+w*K,n[3]=x*Z+w*J,n},T.bn=function(n){const e=new Float64Array(9);var i,o,h,p,m,x,w,A,k,F,Z,G,W,K,J,se,ge,le;F=(h=(o=n)[0])*(w=h+h),Z=(p=o[1])*w,W=(m=o[2])*w,K=m*(A=p+p),se=(x=o[3])*w,ge=x*A,le=x*(k=m+m),(i=e)[0]=1-(G=p*A)-(J=m*k),i[3]=Z-le,i[6]=W+ge,i[1]=Z+le,i[4]=1-F-J,i[7]=K-se,i[2]=W-ge,i[5]=K+se,i[8]=1-F-G;const he=Sa(-Math.asin(Ct(e[2],-1,1)));let xe,Ae;return Math.hypot(e[5],e[8])<.001?(xe=0,Ae=-Sa(Math.atan2(e[3],e[4]))):(xe=Sa(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),Ae=Sa(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:xe,pitch:he+90,bearing:Ae}},T.bo=function(n,e){return n.roll==e.roll&&n.pitch==e.pitch&&n.bearing==e.bearing},T.bp=mi,T.bq=xu,T.br=ks,T.bs=bl,T.bt=Jr,T.bu=rt,T.bv=Et,T.bw=Tn,T.bx=function(n,e,i,o,h){return rt(o,h,Ct((n-e)/(i-e),0,1))},T.by=function(n,e,i,o){return n[0]=e[0]+i[0]*o,n[1]=e[1]+i[1]*o,n[2]=e[2]+i[2]*o,n},T.bz=ze,T.c=ee,T.c$=class{constructor(n){this._marks={start:[n.url,"start"].join("#"),end:[n.url,"end"].join("#"),measure:n.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let n=performance.getEntriesByName(this._marks.measure);return n.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),n=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),n}},T.c0=class extends Ba{constructor(n,e){super(n,e),this.current=Na}set(n){if(n[12]!==this.current[12]||n[0]!==this.current[0])return this.current=n,void this.gl.uniformMatrix4fv(this.location,!1,n);for(let e=1;e<16;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix4fv(this.location,!1,n);break}}},T.c1=rc,T.c2=class extends Ba{constructor(n,e){super(n,e),this.current=[0,0,0]}set(n){n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]||(this.current=n,this.gl.uniform3f(this.location,n[0],n[1],n[2]))}},T.c3=class extends Ba{constructor(n,e){super(n,e),this.current=[0,0]}set(n){n[0]===this.current[0]&&n[1]===this.current[1]||(this.current=n,this.gl.uniform2f(this.location,n[0],n[1]))}},T.c4=Bt,T.c5=function(n,e){var i=Math.sin(e),o=Math.cos(e);return n[0]=o,n[1]=i,n[2]=0,n[3]=-i,n[4]=o,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n},T.c6=function(n,e,i){var o=e[0],h=e[1],p=e[2];return n[0]=o*i[0]+h*i[3]+p*i[6],n[1]=o*i[1]+h*i[4]+p*i[7],n[2]=o*i[2]+h*i[5]+p*i[8],n},T.c7=function(n,e,i,o,h,p,m){var x=1/(e-i),w=1/(o-h),A=1/(p-m);return n[0]=-2*x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*w,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*A,n[11]=0,n[12]=(e+i)*x,n[13]=(h+o)*w,n[14]=(m+p)*A,n[15]=1,n},T.c8=class extends Ba{constructor(n,e){super(n,e),this.current=new Array}set(n){if(n!=this.current){this.current=n;const e=new Float32Array(4*n.length);for(let i=0;i<n.length;i++)e[4*i]=n[i].r,e[4*i+1]=n[i].g,e[4*i+2]=n[i].b,e[4*i+3]=n[i].a;this.gl.uniform4fv(this.location,e)}}},T.c9=class extends Ba{constructor(n,e){super(n,e),this.current=new Array}set(n){if(n!=this.current){this.current=n;const e=new Float32Array(n);this.gl.uniform1fv(this.location,e)}}},T.cA=function(n,e){var i;if(!$o[e])return!1;const o=n?.target,h=((i=o?.ownerDocument)===null||i===void 0?void 0:i.defaultView)||window;return n instanceof h.MouseEvent||n instanceof h.WheelEvent},T.cB=function(n,e){return Ha[e]&&"touches"in n},T.cC=function(n){return Ha[n]||$o[n]},T.cD=function(n,e,i){var o=e[0],h=e[1];return n[0]=i[0]*o+i[4]*h+i[12],n[1]=i[1]*o+i[5]*h+i[13],n},T.cE=function(n,e){const{x:i,y:o}=un.fromLngLat(e);return!(n<0||n>25||o<0||o>=1||i<0||i>=1)},T.cF=function(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n},T.cG=class extends gu{},T.cH=Yy,T.cJ=be,T.cK=function(n,e){ee.REGISTERED_PROTOCOLS[n]=e},T.cL=function(n){delete ee.REGISTERED_PROTOCOLS[n]},T.cM=function(n,e){const i={};for(let h=0;h<n.length;h++){const p=e&&e[n[h].id]||Ks(n[h]);e&&(e[n[h].id]=p);let m=i[p];m||(m=i[p]=[]),m.push(n[h])}const o=[];for(const h in i)o.push(i[h]);return o},T.cN=Nt,T.cO=Ip,T.cP=Qp,T.cQ=vf,T.cR=function(n){var e;n.bucket.createArrays(),n.bucket.tilePixelRatio=Yt/(512*n.bucket.overscaling),n.bucket.compareText={},n.bucket.iconsNeedLinear=!1;const i=n.bucket.layers[0],o=i.layout,h=i._unevaluatedLayout._values,p={layoutIconSize:h["icon-size"].possiblyEvaluate(new an(n.bucket.zoom+1),n.canonical),layoutTextSize:h["text-size"].possiblyEvaluate(new an(n.bucket.zoom+1),n.canonical),textMaxSize:h["text-size"].possiblyEvaluate(new an(18))};if(n.bucket.textSizeData.kind==="composite"){const{minZoom:k,maxZoom:F}=n.bucket.textSizeData;p.compositeTextSizes=[h["text-size"].possiblyEvaluate(new an(k),n.canonical),h["text-size"].possiblyEvaluate(new an(F),n.canonical)]}if(n.bucket.iconSizeData.kind==="composite"){const{minZoom:k,maxZoom:F}=n.bucket.iconSizeData;p.compositeIconSizes=[h["icon-size"].possiblyEvaluate(new an(k),n.canonical),h["icon-size"].possiblyEvaluate(new an(F),n.canonical)]}const m=o.get("text-line-height")*Ar,x=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point",w=o.get("text-keep-upright"),A=o.get("text-size");for(const k of n.bucket.features){const F=o.get("text-font").evaluate(k,{},n.canonical).join(","),Z=A.evaluate(k,{},n.canonical),G=p.layoutTextSize.evaluate(k,{},n.canonical),W=p.layoutIconSize.evaluate(k,{},n.canonical),K={horizontal:{},vertical:void 0},J=k.text;let se,ge=[0,0];if(J){const xe=J.toString(),Ae=o.get("text-letter-spacing").evaluate(k,{},n.canonical)*Ar,He=_h(xe)?Ae:0,ut=o.get("text-anchor").evaluate(k,{},n.canonical),st=ku(i,k,n.canonical);if(!st){const at=o.get("text-radial-offset").evaluate(k,{},n.canonical);ge=at?on(ut,[at*Ar,Ui]):o.get("text-offset").evaluate(k,{},n.canonical).map((et=>et*Ar))}let ft=x?"center":o.get("text-justify").evaluate(k,{},n.canonical);const zt=o.get("symbol-placement")==="point"?o.get("text-max-width").evaluate(k,{},n.canonical)*Ar:1/0,wt=()=>{n.bucket.allowVerticalPlacement&&Oo(xe)&&(K.vertical=vd(J,n.glyphMap,n.glyphPositions,n.imagePositions,F,zt,m,ut,"left",He,ge,T.az.vertical,!0,G,Z))};if(!x&&st){const at=new Set;if(ft==="auto")for(let Ot=0;Ot<st.values.length;Ot+=2)at.add(Jp(st.values[Ot]));else at.add(ft);let et=!1;for(const Ot of at)if(!K.horizontal[Ot])if(et)K.horizontal[Ot]=K.horizontal[0];else{const Dt=vd(J,n.glyphMap,n.glyphPositions,n.imagePositions,F,zt,m,"center",Ot,He,ge,T.az.horizontal,!1,G,Z);Dt&&(K.horizontal[Ot]=Dt,et=Dt.positionedLines.length===1)}wt()}else{ft==="auto"&&(ft=Jp(ut));const at=vd(J,n.glyphMap,n.glyphPositions,n.imagePositions,F,zt,m,ut,ft,He,ge,T.az.horizontal,!1,G,Z);at&&(K.horizontal[ft]=at),wt(),Oo(xe)&&x&&w&&(K.vertical=vd(J,n.glyphMap,n.glyphPositions,n.imagePositions,F,zt,m,ut,ft,He,ge,T.az.vertical,!1,G,Z))}}let le=!1;if(k.icon&&k.icon.name){const xe=n.imageMap[k.icon.name];xe&&(se=Tp(n.imagePositions[k.icon.name],o.get("icon-offset").evaluate(k,{},n.canonical),o.get("icon-anchor").evaluate(k,{},n.canonical)),le=!!xe.sdf,n.bucket.sdfIcons===void 0?n.bucket.sdfIcons=le:n.bucket.sdfIcons!==le&&En("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(xe.pixelRatio!==n.bucket.pixelRatio||o.get("icon-rotate").constantOr(1)!==0)&&(n.bucket.iconsNeedLinear=!0))}const he=v_(K.horizontal)||K.vertical;(e=n.bucket).iconsInText||(e.iconsInText=!!he&&he.iconsInText),(he||se)&&$y(n.bucket,k,K,se,n.imageMap,p,G,W,ge,le,n.canonical,n.subdivisionGranularity)}n.showCollisionBoxes&&n.bucket.generateCollisionDebugBuffers()},T.cS=qc,T.cT=sc,T.cU=Ah,T.cV=function(n){const e=new gf;return(function(i,o){for(const h in i.layers)o.writeMessage(3,Vf,i.layers[h])})(n,e),e.finish()},T.cW=function(n,e,i,o,h,p){let m=s(n,e,i,h,0);return m=s(m,e,o,p,1),m},T.cX=class{constructor(n){this.maxEntries=n,this.map=new Map}get(n){const e=this.map.get(n);return e!==void 0&&(this.map.delete(n),this.map.set(n,e)),e}set(n,e){if(this.map.has(n))this.map.delete(n);else if(this.map.size>=this.maxEntries){const i=this.map.keys().next().value;this.map.delete(i)}this.map.set(n,e)}clear(){this.map.clear()}},T.cY=Gi,T.cZ=gf,T.c_=Nd,T.ca=class extends yl{},T.cb=Dm,T.cc=class extends jn{},T.cd=rd,T.ce=function(n){return n<=1?1:Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))},T.cf=$l,T.cg=function(n,e,i){var o=e[0],h=e[1],p=e[2],m=i[3]*o+i[7]*h+i[11]*p+i[15];return n[0]=(i[0]*o+i[4]*h+i[8]*p+i[12])/(m=m||1),n[1]=(i[1]*o+i[5]*h+i[9]*p+i[13])/m,n[2]=(i[2]*o+i[6]*h+i[10]*p+i[14])/m,n},T.ch=class extends _u{},T.ci=class extends t{},T.cj=function(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]&&n[8]===e[8]&&n[9]===e[9]&&n[10]===e[10]&&n[11]===e[11]&&n[12]===e[12]&&n[13]===e[13]&&n[14]===e[14]&&n[15]===e[15]},T.ck=function(n,e){var i=n[0],o=n[1],h=n[2],p=n[3],m=n[4],x=n[5],w=n[6],A=n[7],k=n[8],F=n[9],Z=n[10],G=n[11],W=n[12],K=n[13],J=n[14],se=n[15],ge=e[0],le=e[1],he=e[2],xe=e[3],Ae=e[4],He=e[5],ut=e[6],st=e[7],ft=e[8],zt=e[9],wt=e[10],at=e[11],et=e[12],Ot=e[13],Dt=e[14],Zt=e[15];return Math.abs(i-ge)<=Tt*Math.max(1,Math.abs(i),Math.abs(ge))&&Math.abs(o-le)<=Tt*Math.max(1,Math.abs(o),Math.abs(le))&&Math.abs(h-he)<=Tt*Math.max(1,Math.abs(h),Math.abs(he))&&Math.abs(p-xe)<=Tt*Math.max(1,Math.abs(p),Math.abs(xe))&&Math.abs(m-Ae)<=Tt*Math.max(1,Math.abs(m),Math.abs(Ae))&&Math.abs(x-He)<=Tt*Math.max(1,Math.abs(x),Math.abs(He))&&Math.abs(w-ut)<=Tt*Math.max(1,Math.abs(w),Math.abs(ut))&&Math.abs(A-st)<=Tt*Math.max(1,Math.abs(A),Math.abs(st))&&Math.abs(k-ft)<=Tt*Math.max(1,Math.abs(k),Math.abs(ft))&&Math.abs(F-zt)<=Tt*Math.max(1,Math.abs(F),Math.abs(zt))&&Math.abs(Z-wt)<=Tt*Math.max(1,Math.abs(Z),Math.abs(wt))&&Math.abs(G-at)<=Tt*Math.max(1,Math.abs(G),Math.abs(at))&&Math.abs(W-et)<=Tt*Math.max(1,Math.abs(W),Math.abs(et))&&Math.abs(K-Ot)<=Tt*Math.max(1,Math.abs(K),Math.abs(Ot))&&Math.abs(J-Dt)<=Tt*Math.max(1,Math.abs(J),Math.abs(Dt))&&Math.abs(se-Zt)<=Tt*Math.max(1,Math.abs(se),Math.abs(Zt))},T.cl=function(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},T.cm=n=>n.type==="symbol",T.cn=n=>n.type==="circle",T.co=n=>n.type==="heatmap",T.cp=n=>n.type==="line",T.cq=n=>n.type==="fill",T.cr=n=>n.type==="fill-extrusion",T.cs=n=>n.type==="hillshade",T.ct=n=>n.type==="color-relief",T.cu=n=>n.type==="background",T.cv=n=>n.type==="custom",T.cw=Pt,T.cx=function(n,e,i){if(e<=0)return n;const o=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(n*o)/o:(i>0?Math.ceil(n*o-1e-9):Math.floor(n*o+1e-10))/o},T.cy=function(n,e,i){const o=gt(e.x-i.x,e.y-i.y),h=gt(n.x-i.x,n.y-i.y);var p,m;return Sa(Math.atan2(o[0]*h[1]-o[1]*h[0],(p=o)[0]*(m=h)[0]+p[1]*m[1]))},T.cz=St,T.d=Ue,T.d0=function(n,e,i,o,h){return u(this,void 0,void 0,(function*(){if(lt())try{return yield js(n,e,i,o,h)}catch{}return(function(p,m,x,w,A){const k=p.width,F=p.height;ia&&ps||(ia=new OffscreenCanvas(k,F),ps=ia.getContext("2d",{willReadFrequently:!0})),ia.width=k,ia.height=F,ps.drawImage(p,0,0,k,F);const Z=ps.getImageData(m,x,w,A);return ps.clearRect(0,0,k,F),Z.data})(n,e,i,o,h)}))},T.d1=Sh,T.d2=X,T.d3=class{constructor(n,e){this.layers={[Fd]:this},this.name=Fd,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=n.length,this.features=n}feature(n){return new cg(this.features[n],this.extent)}},T.d4=l,T.d5=As,T.e=wi,T.f=n=>u(void 0,void 0,void 0,(function*(){if(n.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(n)],{type:"image/png"});try{return createImageBitmap(e)}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.`)}})),T.g=ie,T.h=n=>new Promise(((e,i)=>{const o=new Image;o.onload=()=>{e(o),URL.revokeObjectURL(o.src),o.onload=null,window.requestAnimationFrame((()=>{o.src=mo}))},o.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const h=new Blob([new Uint8Array(n)],{type:"image/png"});o.src=n.byteLength?URL.createObjectURL(h):mo})),T.i=ta,T.j=(n,e)=>Fe(wi(n,{type:"json"}),e),T.k=it,T.l=ct,T.m=Fe,T.n=(n,e)=>Fe(wi(n,{type:"arrayBuffer"}),e),T.o=function(n){return new gf(n).readFields(Um,[])},T.p=xp,T.q=function(n){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(n))},T.r=nd,T.s=go,T.t=rr,T.u=ke,T.v=Pc,T.w=En,T.x=vh,T.y=Js,T.z=ml})),N("worker",["./shared"],(function(T){class u{constructor(ee,ie){this.keyCache={},ee&&this.replace(ee,ie)}replace(ee,ie){this._layerConfigs={},this._layers={},this.update(ee,[],ie)}update(ee,ie,ae){for(const Pe of ee){this._layerConfigs[Pe.id]=Pe;const Fe=this._layers[Pe.id]=T.bT(Pe,ae);Fe._featureFilter=T.aj(Fe.filter,ae),this.keyCache[Pe.id]&&delete this.keyCache[Pe.id]}for(const Pe of ie)delete this.keyCache[Pe],delete this._layerConfigs[Pe],delete this._layers[Pe];this.familiesBySource={};const be=T.cM(Object.values(this._layerConfigs),this.keyCache);for(const Pe of be){const Fe=Pe.map((yt=>this._layers[yt.id])),Ue=Fe[0];if(Ue.isHidden())continue;const Ne=Ue.source||"";let Ze=this.familiesBySource[Ne];Ze||(Ze=this.familiesBySource[Ne]={});const ct=Ue.sourceLayer||T.ai;let it=Ze[ct];it||(it=Ze[ct]=[]),it.push(Fe)}}}class V{constructor(ee){const ie={},ae=[];for(const Ue in ee){const Ne=ee[Ue],Ze=ie[Ue]={};for(const ct in Ne){const it=Ne[+ct];if(!it||it.bitmap.width===0||it.bitmap.height===0)continue;const yt={x:0,y:0,w:it.bitmap.width+2,h:it.bitmap.height+2};ae.push(yt),Ze[ct]={rect:yt,metrics:it.metrics}}}const{w:be,h:Pe}=T.p(ae),Fe=new T.r({width:be||1,height:Pe||1});for(const Ue in ee){const Ne=ee[Ue];for(const Ze in Ne){const ct=Ne[+Ze];if(!ct||ct.bitmap.width===0||ct.bitmap.height===0)continue;const it=ie[Ue][Ze].rect;T.r.copy(ct.bitmap,Fe,{x:0,y:0},{x:it.x+1,y:it.y+1},ct.bitmap)}}this.image=Fe,this.positions=ie}}T.cN("GlyphAtlas",V);class X{constructor(ee){this.tileID=new T.a2(ee.tileID.overscaledZ,ee.tileID.wrap,ee.tileID.canonical.z,ee.tileID.canonical.x,ee.tileID.canonical.y),this.uid=ee.uid,this.zoom=ee.zoom,this.pixelRatio=ee.pixelRatio,this.tileSize=ee.tileSize,this.source=ee.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ee.showCollisionBoxes,this.collectResourceTiming=!!ee.collectResourceTiming,this.returnDependencies=!!ee.returnDependencies,this.promoteId=ee.promoteId,this.inFlightDependencies=[]}parse(ee,ie,ae,be,Pe){return T._(this,void 0,void 0,(function*(){this.status="parsing",this.data=ee,this.collisionBoxArray=new T.ag;const Fe=new T.cO(Object.keys(ee.layers).sort()),Ue=new T.cP(this.tileID,this.promoteId);Ue.bucketLayerIDs=[];const Ne={},Ze={featureIndex:Ue,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:ae,subdivisionGranularity:Pe},ct=ie.familiesBySource[this.source];for(const Ve in ct){const kn=ee.layers[Ve];if(!kn)continue;kn.version===1&&T.w(`Vector tile source "${this.source}" layer "${Ve}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Pr=Fe.encode(Ve),Zr=[];for(let Pi=0;Pi<kn.length;Pi++){const bt=kn.feature(Pi),li=Ue.getId(bt,Ve);Zr.push({feature:bt,id:li,index:Pi,sourceLayerIndex:Pr})}for(const Pi of ct[Ve]){const bt=Pi[0];bt.source!==this.source&&T.w(`layer.source = ${bt.source} does not equal this.source = ${this.source}`),bt.isHidden(this.zoom,!0)||(ce(Pi,this.zoom,ae),(Ne[bt.id]=bt.createBucket({index:Ue.bucketLayerIDs.length,layers:Pi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Pr,sourceID:this.source})).populate(Zr,Ze,this.tileID.canonical),Ue.bucketLayerIDs.push(Pi.map((li=>li.id))))}}const it=T.bY(Ze.glyphDependencies,(Ve=>Object.keys(Ve).map(Number)));this.inFlightDependencies.forEach((Ve=>Ve?.abort())),this.inFlightDependencies=[];let yt=Promise.resolve({});if(Object.keys(it).length){const Ve=new AbortController;this.inFlightDependencies.push(Ve),yt=be.sendAsync({type:"GG",data:{stacks:it,source:this.source,tileID:this.tileID,type:"glyphs"}},Ve)}const ke=Object.keys(Ze.iconDependencies);let oi=Promise.resolve({});if(ke.length){const Ve=new AbortController;this.inFlightDependencies.push(Ve),oi=be.sendAsync({type:"GI",data:{icons:ke,source:this.source,tileID:this.tileID,type:"icons"}},Ve)}const Hi=Object.keys(Ze.patternDependencies);let Gt=Promise.resolve({});if(Hi.length){const Ve=new AbortController;this.inFlightDependencies.push(Ve),Gt=be.sendAsync({type:"GI",data:{icons:Hi,source:this.source,tileID:this.tileID,type:"patterns"}},Ve)}const Wt=Ze.dashDependencies;let yi=Promise.resolve({});if(Object.keys(Wt).length){const Ve=new AbortController;this.inFlightDependencies.push(Ve),yi=be.sendAsync({type:"GDA",data:{dashes:Wt}},Ve)}const[rn,dn,tr,ir]=yield Promise.all([yt,oi,Gt,yi]),An=new V(rn),Qi=new T.cQ(dn,tr);for(const Ve in Ne){const kn=Ne[Ve];kn instanceof T.ah?(ce(kn.layers,this.zoom,ae),T.cR({bucket:kn,glyphMap:rn,glyphPositions:An.positions,imageMap:dn,imagePositions:Qi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Ze.subdivisionGranularity})):kn.hasDependencies&&(kn instanceof T.cS||kn instanceof T.cT||kn instanceof T.cU)&&(ce(kn.layers,this.zoom,ae),kn.addFeatures(Ze,this.tileID.canonical,Qi.patternPositions,ir))}return this.status="done",{buckets:Object.values(Ne).filter((Ve=>!Ve.isEmpty())),featureIndex:Ue,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:An.image,imageAtlas:Qi,dashPositions:ir,glyphMap:this.returnDependencies?rn:null,iconMap:this.returnDependencies?dn:null,glyphPositions:this.returnDependencies?An.positions:null}}))}}function ce(Be,ee,ie){const ae=new T.H(ee);for(const be of Be)be.recalculate(ae,ie)}class ne{constructor(ee,ie,ae,be,Pe){this.type=ee,this.properties=ae||{},this.extent=Pe,this.pointsArray=ie,this.id=be}loadGeometry(){return this.pointsArray.map((ee=>ee.map((ie=>new T.P(ie.x,ie.y)))))}}class ye{constructor(ee,ie,ae){this.version=2,this._myFeatures=ee,this.name=ie,this.length=ee.length,this.extent=ae}feature(ee){return this._myFeatures[ee]}}class Se{constructor(){this.layers={}}addLayer(ee){this.layers[ee.name]=ee}}function Ie(Be){let ee=T.cV(Be);return ee.byteOffset===0&&ee.byteLength===ee.buffer.byteLength||(ee=new Uint8Array(ee)),{vectorTile:Be,rawData:ee.buffer}}function Te(Be,ee,ie){const{extent:ae}=Be,be=Math.pow(2,ie.z-ee.z),Pe=(ie.x-ee.x*be)*ae,Fe=(ie.y-ee.y*be)*ae,Ue=[];for(let Ne=0;Ne<Be.length;Ne++){const Ze=Be.feature(Ne);let ct=Ze.loadGeometry();for(const yt of ct)for(const ke of yt)ke.x=ke.x*be-Pe,ke.y=ke.y*be-Fe;const it=128;ct=T.cW(ct,Ze.type,-it,-it,ae+it,ae+it),ct.length!==0&&Ue.push(new ne(Ze.type,ct,Ze.properties,Ze.id,ae))}return new ye(Ue,Be.name,ae)}class ve{constructor(ee,ie,ae){this.actor=ee,this.layerIndex=ie,this.availableImages=ae,this.fetching={},this.loading={},this.loaded={},this.overzoomedTileResultCache=new T.cX(1e3)}loadVectorTile(ee,ie){return T._(this,void 0,void 0,(function*(){const ae=yield T.n(ee.request,ie);try{return{vectorTile:ee.encoding!=="mlt"?new T.cY(new T.cZ(ae.data)):new T.c_(ae.data),rawData:ae.data,cacheControl:ae.cacheControl,expires:ae.expires}}catch(be){const Pe=new Uint8Array(ae.data);let Fe=`Unable to parse the tile at ${ee.request.url}, `;throw Fe+=Pe[0]===31&&Pe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${be.message}`,new Error(Fe)}}))}loadTile(ee){return T._(this,void 0,void 0,(function*(){const{uid:ie,overzoomParameters:ae}=ee;ae&&(ee.request=ae.overzoomRequest);const be=!!(ee&&ee.request&&ee.request.collectResourceTiming)&&new T.c$(ee.request),Pe=new X(ee);this.loading[ie]=Pe;const Fe=new AbortController;Pe.abort=Fe;try{const Ue=yield this.loadVectorTile(ee,Fe);if(delete this.loading[ie],!Ue)return null;if(ae){const yt=this._getOverzoomTile(ee,Ue.vectorTile);Ue.rawData=yt.rawData,Ue.vectorTile=yt.vectorTile}const Ne=Ue.rawData,Ze={};Ue.expires&&(Ze.expires=Ue.expires),Ue.cacheControl&&(Ze.cacheControl=Ue.cacheControl);const ct={};if(be){const yt=be.finish();yt&&(ct.resourceTiming=JSON.parse(JSON.stringify(yt)))}Pe.vectorTile=Ue.vectorTile;const it=Pe.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity);this.loaded[ie]=Pe,this.fetching[ie]={rawTileData:Ne,cacheControl:Ze,resourceTiming:ct};try{const yt=yield it;return T.e({rawTileData:Ne.slice(0),encoding:ee.encoding},yt,Ze,ct)}finally{delete this.fetching[ie]}}catch(Ue){throw delete this.loading[ie],Pe.status="done",this.loaded[ie]=Pe,Ue}}))}_getOverzoomTile(ee,ie){const{tileID:ae,source:be,overzoomParameters:Pe}=ee,{maxZoomTileID:Fe}=Pe,Ue=`${Fe.key}_${ae.key}`,Ne=this.overzoomedTileResultCache.get(Ue);if(Ne)return Ne;const Ze=new Se,ct=this.layerIndex.familiesBySource[be];for(const yt in ct){const ke=ie.layers[yt];if(!ke)continue;const oi=Te(ke,Fe,ae.canonical);oi.length>0&&Ze.addLayer(oi)}const it=Ie(Ze);return this.overzoomedTileResultCache.set(Ue,it),it}reloadTile(ee){return T._(this,void 0,void 0,(function*(){const ie=ee.uid;if(!this.loaded||!this.loaded[ie])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const ae=this.loaded[ie];if(ae.showCollisionBoxes=ee.showCollisionBoxes,ae.status==="parsing"){const be=yield ae.parse(ae.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity);let Pe;if(this.fetching[ie]){const{rawTileData:Fe,cacheControl:Ue,resourceTiming:Ne}=this.fetching[ie];delete this.fetching[ie],Pe=T.e({rawTileData:Fe.slice(0),encoding:ee.encoding},be,Ue,Ne)}else Pe=be;return Pe}if(ae.status==="done"&&ae.vectorTile)return ae.parse(ae.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity)}))}abortTile(ee){return T._(this,void 0,void 0,(function*(){const ie=this.loading,ae=ee.uid;ie&&ie[ae]&&ie[ae].abort&&(ie[ae].abort.abort(),delete ie[ae])}))}removeTile(ee){return T._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[ee.uid]&&delete this.loaded[ee.uid]}))}}class lt{constructor(){this.loaded={}}loadTile(ee){return T._(this,void 0,void 0,(function*(){const{uid:ie,encoding:ae,rawImageData:be,redFactor:Pe,greenFactor:Fe,blueFactor:Ue,baseShift:Ne}=ee,Ze=be.width+2,ct=be.height+2,it=T.b(be)?new T.R({width:Ze,height:ct},yield T.d0(be,-1,-1,Ze,ct)):be,yt=new T.d1(ie,it,ae,Pe,Fe,Ue,Ne);return this.loaded=this.loaded||{},this.loaded[ie]=yt,yt}))}removeTile(ee){const ie=this.loaded,ae=ee.uid;ie&&ie[ae]&&delete ie[ae]}}var Tt,dt,Bt=(function(){if(dt)return Tt;function Be(ie,ae){if(ie.length!==0){ee(ie[0],ae);for(var be=1;be<ie.length;be++)ee(ie[be],!ae)}}function ee(ie,ae){for(var be=0,Pe=0,Fe=0,Ue=ie.length,Ne=Ue-1;Fe<Ue;Ne=Fe++){var Ze=(ie[Fe][0]-ie[Ne][0])*(ie[Ne][1]+ie[Fe][1]),ct=be+Ze;Pe+=Math.abs(be)>=Math.abs(Ze)?be-ct+Ze:Ze-ct+be,be=ct}be+Pe>=0!=!!ae&&ie.reverse()}return dt=1,Tt=function ie(ae,be){var Pe,Fe=ae&&ae.type;if(Fe==="FeatureCollection")for(Pe=0;Pe<ae.features.length;Pe++)ie(ae.features[Pe],be);else if(Fe==="GeometryCollection")for(Pe=0;Pe<ae.geometries.length;Pe++)ie(ae.geometries[Pe],be);else if(Fe==="Feature")ie(ae.geometry,be);else if(Fe==="Polygon")Be(ae.coordinates,be);else if(Fe==="MultiPolygon")for(Pe=0;Pe<ae.coordinates.length;Pe++)Be(ae.coordinates[Pe],be);return ae}})(),Vt=T.d2(Bt);const ui={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Be=>Be},Ft=Math.fround||(vi=new Float32Array(1),Be=>(vi[0]=+Be,vi[0]));var vi;class Kt{constructor(ee){this.options=Object.assign(Object.create(ui),ee),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ee){const{log:ie,minZoom:ae,maxZoom:be}=this.options;ie&&console.time("total time");const Pe=`prepare ${ee.length} points`;ie&&console.time(Pe),this.points=ee;const Fe=[];for(let Ne=0;Ne<ee.length;Ne++){const Ze=ee[Ne];if(!Ze.geometry)continue;const[ct,it]=Ze.geometry.coordinates,yt=Ft(Xt(ct)),ke=Ft(si(it));Fe.push(yt,ke,1/0,Ne,-1,1),this.options.reduce&&Fe.push(0)}let Ue=this.trees[be+1]=this._createTree(Fe);ie&&console.timeEnd(Pe);for(let Ne=be;Ne>=ae;Ne--){const Ze=+Date.now();Ue=this.trees[Ne]=this._createTree(this._cluster(Ue,Ne)),ie&&console.log("z%d: %d clusters in %dms",Ne,Ue.numItems,+Date.now()-Ze)}return ie&&console.timeEnd("total time"),this}getClusters(ee,ie){let ae=((ee[0]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,ee[1]));let Pe=ee[2]===180?180:((ee[2]+180)%360+360)%360-180;const Fe=Math.max(-90,Math.min(90,ee[3]));if(ee[2]-ee[0]>=360)ae=-180,Pe=180;else if(ae>Pe){const it=this.getClusters([ae,be,180,Fe],ie),yt=this.getClusters([-180,be,Pe,Fe],ie);return it.concat(yt)}const Ue=this.trees[this._limitZoom(ie)],Ne=Ue.range(Xt(ae),si(Fe),Xt(Pe),si(be)),Ze=Ue.data,ct=[];for(const it of Ne){const yt=this.stride*it;ct.push(Ze[yt+5]>1?qt(Ze,yt,this.clusterProps):this.points[Ze[yt+3]])}return ct}getChildren(ee){const ie=this._getOriginId(ee),ae=this._getOriginZoom(ee),be="No cluster with the specified id.",Pe=this.trees[ae];if(!Pe)throw new Error(be);const Fe=Pe.data;if(ie*this.stride>=Fe.length)throw new Error(be);const Ue=this.options.radius/(this.options.extent*Math.pow(2,ae-1)),Ne=Pe.within(Fe[ie*this.stride],Fe[ie*this.stride+1],Ue),Ze=[];for(const ct of Ne){const it=ct*this.stride;Fe[it+4]===ee&&Ze.push(Fe[it+5]>1?qt(Fe,it,this.clusterProps):this.points[Fe[it+3]])}if(Ze.length===0)throw new Error(be);return Ze}getLeaves(ee,ie,ae){const be=[];return this._appendLeaves(be,ee,ie=ie||10,ae=ae||0,0),be}getTile(ee,ie,ae){const be=this.trees[this._limitZoom(ee)],Pe=Math.pow(2,ee),{extent:Fe,radius:Ue}=this.options,Ne=Ue/Fe,Ze=(ae-Ne)/Pe,ct=(ae+1+Ne)/Pe,it={features:[]};return this._addTileFeatures(be.range((ie-Ne)/Pe,Ze,(ie+1+Ne)/Pe,ct),be.data,ie,ae,Pe,it),ie===0&&this._addTileFeatures(be.range(1-Ne/Pe,Ze,1,ct),be.data,Pe,ae,Pe,it),ie===Pe-1&&this._addTileFeatures(be.range(0,Ze,Ne/Pe,ct),be.data,-1,ae,Pe,it),it.features.length?it:null}getClusterExpansionZoom(ee){let ie=this._getOriginZoom(ee)-1;for(;ie<=this.options.maxZoom;){const ae=this.getChildren(ee);if(ie++,ae.length!==1)break;ee=ae[0].properties.cluster_id}return ie}_appendLeaves(ee,ie,ae,be,Pe){const Fe=this.getChildren(ie);for(const Ue of Fe){const Ne=Ue.properties;if(Ne&&Ne.cluster?Pe+Ne.point_count<=be?Pe+=Ne.point_count:Pe=this._appendLeaves(ee,Ne.cluster_id,ae,be,Pe):Pe<be?Pe++:ee.push(Ue),ee.length===ae)break}return Pe}_createTree(ee){const ie=new T.aT(ee.length/this.stride|0,this.options.nodeSize,Float32Array);for(let ae=0;ae<ee.length;ae+=this.stride)ie.add(ee[ae],ee[ae+1]);return ie.finish(),ie.data=ee,ie}_addTileFeatures(ee,ie,ae,be,Pe,Fe){for(const Ue of ee){const Ne=Ue*this.stride,Ze=ie[Ne+5]>1;let ct,it,yt;if(Ze)ct=Ht(ie,Ne,this.clusterProps),it=ie[Ne],yt=ie[Ne+1];else{const Hi=this.points[ie[Ne+3]];ct=Hi.properties;const[Gt,Wt]=Hi.geometry.coordinates;it=Xt(Gt),yt=si(Wt)}const ke={type:1,geometry:[[Math.round(this.options.extent*(it*Pe-ae)),Math.round(this.options.extent*(yt*Pe-be))]],tags:ct};let oi;oi=Ze||this.options.generateId?ie[Ne+3]:this.points[ie[Ne+3]].id,oi!==void 0&&(ke.id=oi),Fe.features.push(ke)}}_limitZoom(ee){return Math.max(this.options.minZoom,Math.min(Math.floor(+ee),this.options.maxZoom+1))}_cluster(ee,ie){const{radius:ae,extent:be,reduce:Pe,minPoints:Fe}=this.options,Ue=ae/(be*Math.pow(2,ie)),Ne=ee.data,Ze=[],ct=this.stride;for(let it=0;
23it<Ne.length;it+=ct){if(Ne[it+2]<=ie)continue;Ne[it+2]=ie;const yt=Ne[it],ke=Ne[it+1],oi=ee.within(Ne[it],Ne[it+1],Ue),Hi=Ne[it+5];let Gt=Hi;for(const Wt of oi){const yi=Wt*ct;Ne[yi+2]>ie&&(Gt+=Ne[yi+5])}if(Gt>Hi&&Gt>=Fe){let Wt,yi=yt*Hi,rn=ke*Hi,dn=-1;const tr=(it/ct<<5)+(ie+1)+this.points.length;for(const ir of oi){const An=ir*ct;if(Ne[An+2]<=ie)continue;Ne[An+2]=ie;const Qi=Ne[An+5];yi+=Ne[An]*Qi,rn+=Ne[An+1]*Qi,Ne[An+4]=tr,Pe&&(Wt||(Wt=this._map(Ne,it,!0),dn=this.clusterProps.length,this.clusterProps.push(Wt)),Pe(Wt,this._map(Ne,An)))}Ne[it+4]=tr,Ze.push(yi/Gt,rn/Gt,1/0,tr,-1,Gt),Pe&&Ze.push(dn)}else{for(let Wt=0;Wt<ct;Wt++)Ze.push(Ne[it+Wt]);if(Gt>1)for(const Wt of oi){const yi=Wt*ct;if(!(Ne[yi+2]<=ie)){Ne[yi+2]=ie;for(let rn=0;rn<ct;rn++)Ze.push(Ne[yi+rn])}}}}return Ze}_getOriginId(ee){return ee-this.points.length>>5}_getOriginZoom(ee){return(ee-this.points.length)%32}_map(ee,ie,ae){if(ee[ie+5]>1){const Fe=this.clusterProps[ee[ie+6]];return ae?Object.assign({},Fe):Fe}const be=this.points[ee[ie+3]].properties,Pe=this.options.map(be);return ae&&Pe===be?Object.assign({},Pe):Pe}}function qt(Be,ee,ie){return{type:"Feature",id:Be[ee+3],properties:Ht(Be,ee,ie),geometry:{type:"Point",coordinates:[(ae=Be[ee],360*(ae-.5)),ii(Be[ee+1])]}};var ae}function Ht(Be,ee,ie){const ae=Be[ee+5],be=ae>=1e4?`${Math.round(ae/1e3)}k`:ae>=1e3?Math.round(ae/100)/10+"k":ae,Pe=Be[ee+6],Fe=Pe===-1?{}:Object.assign({},ie[Pe]);return Object.assign(Fe,{cluster:!0,cluster_id:Be[ee+3],point_count:ae,point_count_abbreviated:be})}function Xt(Be){return Be/360+.5}function si(Be){const ee=Math.sin(Be*Math.PI/180),ie=.5-.25*Math.log((1+ee)/(1-ee))/Math.PI;return ie<0?0:ie>1?1:ie}function ii(Be){const ee=(180-360*Be)*Math.PI/180;return 360*Math.atan(Math.exp(ee))/Math.PI-90}function Vi(Be,ee,ie,ae){let be=ae;const Pe=ee+(ie-ee>>1);let Fe,Ue=ie-ee;const Ne=Be[ee],Ze=Be[ee+1],ct=Be[ie],it=Be[ie+1];for(let yt=ee+3;yt<ie;yt+=3){const ke=Ke(Be[yt],Be[yt+1],Ne,Ze,ct,it);if(ke>be)Fe=yt,be=ke;else if(ke===be){const oi=Math.abs(yt-Pe);oi<Ue&&(Fe=yt,Ue=oi)}}be>ae&&(Fe-ee>3&&Vi(Be,ee,Fe,ae),Be[Fe+2]=be,ie-Fe>3&&Vi(Be,Fe,ie,ae))}function Ke(Be,ee,ie,ae,be,Pe){let Fe=be-ie,Ue=Pe-ae;if(Fe!==0||Ue!==0){const Ne=((Be-ie)*Fe+(ee-ae)*Ue)/(Fe*Fe+Ue*Ue);Ne>1?(ie=be,ae=Pe):Ne>0&&(ie+=Fe*Ne,ae+=Ue*Ne)}return Fe=Be-ie,Ue=ee-ae,Fe*Fe+Ue*Ue}function mt(Be,ee,ie,ae){const be={type:ee,geom:ie},Pe={id:Be??null,type:be.type,geometry:be.geom,tags:ae,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(be.type){case"Point":case"MultiPoint":case"LineString":gt(Pe,be.geom);break;case"Polygon":gt(Pe,be.geom[0]);break;case"MultiLineString":for(const Fe of be.geom)gt(Pe,Fe);break;case"MultiPolygon":for(const Fe of be.geom)gt(Pe,Fe[0])}return Pe}function gt(Be,ee){for(let ie=0;ie<ee.length;ie+=3)Be.minX=Math.min(Be.minX,ee[ie]),Be.minY=Math.min(Be.minY,ee[ie+1]),Be.maxX=Math.max(Be.maxX,ee[ie]),Be.maxY=Math.max(Be.maxY,ee[ie+1])}function Yt(Be,ee){const ie=[];switch(Be.type){case"FeatureCollection":for(let ae=0;ae<Be.features.length;ae++)It(ie,Be.features[ae],ee,ae);break;case"Feature":It(ie,Be,ee);break;default:It(ie,{geometry:Be,properties:void 0},ee)}return ie}function It(Be,ee,ie,ae){if(!ee.geometry)return;if(ee.geometry.type==="GeometryCollection"){for(const Ue of ee.geometry.geometries)It(Be,{id:ee.id,geometry:Ue,properties:ee.properties},ie,ae);return}if(!ee.geometry.coordinates?.length)return;const Pe=Math.pow(ie.tolerance/((1<<ie.maxZoom)*ie.extent),2);let Fe=ee.id;switch(ie.promoteId?Fe=ee.properties?.[ie.promoteId]:ie.generateId&&(Fe=ae||0),ee.geometry.type){case"Point":{const Ue=[];return ze(ee.geometry.coordinates,Ue),void Be.push(mt(Fe,ee.geometry.type,Ue,ee.properties))}case"MultiPoint":{const Ue=[];for(const Ne of ee.geometry.coordinates)ze(Ne,Ue);return void Be.push(mt(Fe,ee.geometry.type,Ue,ee.properties))}case"LineString":{const Ue=[];return rt(ee.geometry.coordinates,Ue,Pe,!1),void Be.push(mt(Fe,ee.geometry.type,Ue,ee.properties))}case"MultiLineString":{if(ie.lineMetrics){for(const Ne of ee.geometry.coordinates){const Ze=[];rt(Ne,Ze,Pe,!1),Be.push(mt(Fe,"LineString",Ze,ee.properties))}return}const Ue=[];return Et(ee.geometry.coordinates,Ue,Pe,!1),void Be.push(mt(Fe,ee.geometry.type,Ue,ee.properties))}case"Polygon":{const Ue=[];return Et(ee.geometry.coordinates,Ue,Pe,!0),void Be.push(mt(Fe,ee.geometry.type,Ue,ee.properties))}case"MultiPolygon":{const Ue=[];for(const Ne of ee.geometry.coordinates){const Ze=[];Et(Ne,Ze,Pe,!0),Ue.push(Ze)}return void Be.push(mt(Fe,ee.geometry.type,Ue,ee.properties))}default:throw new Error("Input data is not a valid GeoJSON object.")}}function ze(Be,ee){ee.push(Pt(Be[0]),St(Be[1]),0)}function rt(Be,ee,ie,ae){let be,Pe,Fe=0;for(let Ne=0;Ne<Be.length;Ne++){const Ze=Pt(Be[Ne][0]),ct=St(Be[Ne][1]);ee.push(Ze,ct,0),Ne>0&&(Fe+=ae?(be*ct-Ze*Pe)/2:Math.sqrt(Math.pow(Ze-be,2)+Math.pow(ct-Pe,2))),be=Ze,Pe=ct}const Ue=ee.length-3;ee[2]=1,ie>0&&Vi(ee,0,Ue,ie),ee[Ue+2]=1,ee.size=Math.abs(Fe),ee.start=0,ee.end=ee.size}function Et(Be,ee,ie,ae){for(let be=0;be<Be.length;be++){const Pe=[];rt(Be[be],Pe,ie,ae),ee.push(Pe)}}function Pt(Be){return Be/360+.5}function St(Be){const ee=Math.sin(Be*Math.PI/180),ie=.5-.25*Math.log((1+ee)/(1-ee))/Math.PI;return ie<0?0:ie>1?1:ie}function Ct(Be,ee,ie,ae,be,Pe,Fe,Ue){if(ae/=ee,Pe>=(ie/=ee)&&Fe<ae)return Be;if(Fe<ie||Pe>=ae)return null;const Ne=[];for(const Ze of Be){const ct=be===0?Ze.minX:Ze.minY,it=be===0?Ze.maxX:Ze.maxY;if(ct>=ie&&it<ae)Ne.push(Ze);else if(!(it<ie||ct>=ae))switch(Ze.type){case"Point":case"MultiPoint":{const yt=[];if(ri(Ze.geometry,yt,ie,ae,be),!yt.length)continue;
23Ne.push(mt(Ze.id,yt.length===3?"Point":"MultiPoint",yt,Ze.tags));continue}case"LineString":{const yt=[];if(wi(Ze.geometry,yt,ie,ae,be,!1,Ue.lineMetrics),!yt.length)continue;if(Ue.lineMetrics){for(const ke of yt)Ne.push(mt(Ze.id,Ze.type,ke,Ze.tags));continue}if(yt.length>1){Ne.push(mt(Ze.id,"MultiLineString",yt,Ze.tags));continue}Ne.push(mt(Ze.id,Ze.type,yt[0],Ze.tags));continue}case"MultiLineString":{const yt=[];if(vr(Ze.geometry,yt,ie,ae,be,!1),!yt.length)continue;if(yt.length===1){Ne.push(mt(Ze.id,"LineString",yt[0],Ze.tags));continue}Ne.push(mt(Ze.id,Ze.type,yt,Ze.tags));continue}case"Polygon":{const yt=[];if(vr(Ze.geometry,yt,ie,ae,be,!0),!yt.length)continue;Ne.push(mt(Ze.id,Ze.type,yt,Ze.tags));continue}case"MultiPolygon":{const yt=[];for(const ke of Ze.geometry){const oi=[];vr(ke,oi,ie,ae,be,!0),oi.length&&yt.push(oi)}if(!yt.length)continue;Ne.push(mt(Ze.id,Ze.type,yt,Ze.tags));continue}}}return Ne.length?Ne:null}function ri(Be,ee,ie,ae,be){for(let Pe=0;Pe<Be.length;Pe+=3){const Fe=Be[Pe+be];Fe>=ie&&Fe<=ae&&Ur(ee,Be[Pe],Be[Pe+1],Be[Pe+2])}}function wi(Be,ee,ie,ae,be,Pe,Fe){let Ue=Wi(Be);const Ne=be===0?xr:Ho;let Ze,ct,it=Be.start;for(let Gt=0;Gt<Be.length-3;Gt+=3){const Wt=Be[Gt],yi=Be[Gt+1],rn=Be[Gt+2],dn=Be[Gt+3],tr=Be[Gt+4],ir=be===0?Wt:yi,An=be===0?dn:tr;let Qi=!1;Fe&&(Ze=Math.sqrt(Math.pow(Wt-dn,2)+Math.pow(yi-tr,2))),ir<ie?An>ie&&(ct=Ne(Ue,Wt,yi,dn,tr,ie),Fe&&(Ue.start=it+Ze*ct)):ir>ae?An<ae&&(ct=Ne(Ue,Wt,yi,dn,tr,ae),Fe&&(Ue.start=it+Ze*ct)):Ur(Ue,Wt,yi,rn),An<ie&&ir>=ie&&(ct=Ne(Ue,Wt,yi,dn,tr,ie),Qi=!0),An>ae&&ir<=ae&&(ct=Ne(Ue,Wt,yi,dn,tr,ae),Qi=!0),!Pe&&Qi&&(Fe&&(Ue.end=it+Ze*ct),ee.push(Ue),Ue=Wi(Be)),Fe&&(it+=Ze)}let yt=Be.length-3;const ke=Be[yt],oi=Be[yt+1],Hi=be===0?ke:oi;Hi>=ie&&Hi<=ae&&Ur(Ue,ke,oi,Be[yt+2]),yt=Ue.length-3,Pe&&yt>=3&&(Ue[yt]!==Ue[0]||Ue[yt+1]!==Ue[1])&&Ur(Ue,Ue[0],Ue[1],Ue[2]),Ue.length&&ee.push(Ue)}function Wi(Be){const ee=[];return ee.size=Be.size,ee.start=Be.start,ee.end=Be.end,ee}function vr(Be,ee,ie,ae,be,Pe){for(const Fe of Be)wi(Fe,ee,ie,ae,be,Pe,!1)}function Ur(Be,ee,ie,ae){Be.push(ee,ie,ae)}function xr(Be,ee,ie,ae,be,Pe){const Fe=(Pe-ee)/(ae-ee);return Ur(Be,Pe,ie+(be-ie)*Fe,1),Fe}function Ho(Be,ee,ie,ae,be,Pe){const Fe=(Pe-ie)/(be-ie);return Ur(Be,ee+(ae-ee)*Fe,Pe,1),Fe}function En(Be,ee){const ie=ee.buffer/ee.extent;let ae=Be;const be=Ct(Be,1,-1-ie,ie,0,-1,2,ee),Pe=Ct(Be,1,1-ie,2+ie,0,-1,2,ee);return(be||Pe)&&(ae=Ct(Be,1,-ie,1+ie,0,-1,2,ee)||[],be&&(ae=Vr(be,1).concat(ae)),Pe&&(ae=ae.concat(Vr(Pe,-1)))),ae}function Vr(Be,ee){const ie=[];for(const ae of Be)switch(ae.type){case"Point":case"MultiPoint":case"LineString":{const be=ta(ae.geometry,ee);ie.push(mt(ae.id,ae.type,be,ae.tags));continue}case"MultiLineString":case"Polygon":{const be=[];for(const Pe of ae.geometry)be.push(ta(Pe,ee));ie.push(mt(ae.id,ae.type,be,ae.tags));continue}case"MultiPolygon":{const be=[];for(const Pe of ae.geometry){const Fe=[];for(const Ue of Pe)Fe.push(ta(Ue,ee));be.push(Fe)}ie.push(mt(ae.id,ae.type,be,ae.tags));continue}}return ie}function ta(Be,ee){const ie=[];ie.size=Be.size,Be.start!==void 0&&(ie.start=Be.start,ie.end=Be.end);for(let ae=0;ae<Be.length;ae+=3)ie.push(Be[ae]+ee,Be[ae+1],Be[ae+2]);return ie}function yn(Be,ee){if(Be.transformed)return Be;const ie=1<<Be.z,ae=Be.x,be=Be.y;for(const Pe of Be.features){if(Pe.type===1){const Ue=[];for(let Ne=0;Ne<Pe.geometry.length;Ne+=2)Ue.push(Ta(Pe.geometry[Ne],Pe.geometry[Ne+1],ee,ie,ae,be));Pe.geometry=Ue;continue}const Fe=[];for(const Ue of Pe.geometry){const Ne=[];for(let Ze=0;Ze<Ue.length;Ze+=2)Ne.push(Ta(Ue[Ze],Ue[Ze+1],ee,ie,ae,be));Fe.push(Ne)}Pe.geometry=Fe}return Be.transformed=!0,Be}function Ta(Be,ee,ie,ae,be,Pe){return[Math.round(ie*(Be*ae-be)),Math.round(ie*(ee*ae-Pe))]}function mo(Be,ee,ie,ae,be){const Pe=ee===be.maxZoom?0:be.tolerance/((1<<ee)*be.extent),Fe={features:[],numPoints:0,numSimplified:0,numFeatures:Be.length,source:null,x:ie,y:ae,z:ee,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const Ue of Be)js(Fe,Ue,Pe,be);return Fe}function js(Be,ee,ie,ae){Be.minX=Math.min(Be.minX,ee.minX),Be.minY=Math.min(Be.minY,ee.minY),Be.maxX=Math.max(Be.maxX,ee.maxX),Be.maxY=Math.max(Be.maxY,ee.maxY);let be,Pe=ee.tags||null;switch(ee.type){case"Point":case"MultiPoint":{const Fe=[];for(let Ue=0;Ue<ee.geometry.length;Ue+=3)Fe.push(ee.geometry[Ue],ee.geometry[Ue+1]),Be.numPoints++,Be.numSimplified++;if(!Fe.length)return;be={type:1,tags:Pe,geometry:Fe};break}case"LineString":{const Fe=[];if(ia(Fe,ee.geometry,Be,ie,!1,!1),!Fe.length)return;if(ae.lineMetrics){Pe={};for(const Ue in ee.tags)Pe[Ue]=ee.tags[Ue];Pe.mapbox_clip_start=ee.geometry.start/ee.geometry.size,Pe.mapbox_clip_end=ee.geometry.end/ee.geometry.size}be={type:2,tags:Pe,geometry:Fe};break}case"MultiLineString":case"Polygon":{const Fe=[];for(let Ue=0;Ue<ee.geometry.length;Ue++)ia(Fe,ee.geometry[Ue],Be,ie,ee.type==="Polygon",Ue===0);if(!Fe.length)return;be={type:ee.type==="Polygon"?3:2,tags:Pe,geometry:Fe};break}case"MultiPolygon":{const Fe=[];for(let Ue=0;Ue<ee.geometry.length;Ue++){const Ne=ee.geometry[Ue];for(let Ze=0;Ze<Ne.length;Ze++)ia(Fe,Ne[Ze],Be,ie,!0,Ze===0)}if(!Fe.length)return;be={type:3,tags:Pe,geometry:Fe};break}}ee.id!==null&&(be.id=ee.id),Be.features.push(be)}function ia(Be,ee,ie,ae,be,Pe){const Fe=ae*ae;if(ae>0&&ee.size<(be?Fe:ae))return void(ie.numPoints+=ee.length/3);const Ue=[];for(let Ne=0;Ne<ee.length;
23Ne+=3)(ae===0||ee[Ne+2]>Fe)&&(ie.numSimplified++,Ue.push(ee[Ne],ee[Ne+1])),ie.numPoints++;be&&(function(Ne,Ze){let ct=0;for(let it=0,yt=Ne.length,ke=yt-2;it<yt;ke=it,it+=2)ct+=(Ne[it]-Ne[ke])*(Ne[it+1]+Ne[ke+1]);if(ct>0===Ze)for(let it=0,yt=Ne.length;it<yt/2;it+=2){const ke=Ne[it],oi=Ne[it+1];Ne[it]=Ne[yt-2-it],Ne[it+1]=Ne[yt-1-it],Ne[yt-2-it]=ke,Ne[yt-1-it]=oi}})(Ue,Pe),Be.push(Ue)}function ps(Be,ee,ie){const ae=!!ee.newGeometry,be=ee.removeAllProperties||ee.removeProperties?.length>0||ee.addOrUpdateProperties?.length>0;if(ae){let Pe=Yt({type:"FeatureCollection",features:[{type:"Feature",id:Be.id,geometry:ee.newGeometry,properties:be?go(Be.tags,ee):Be.tags}]},ie);return Pe=En(Pe,ie),Pe[0]}if(be){const Pe={...Be};return Pe.tags=go(Pe.tags,ee),Pe}return null}function go(Be,ee){if(ee.removeAllProperties)return{};const ie={...Be||{}};if(ee.removeProperties)for(const ae of ee.removeProperties)delete ie[ae];if(ee.addOrUpdateProperties)for(const{key:ae,value:be}of ee.addOrUpdateProperties)ie[ae]=be;return ie}const pr={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,debug:0};class Sa{options;tiles;tileCoords;stats={};total=0;source;constructor(ee,ie){const ae=(ie=this.options=Object.assign({},pr,ie)).debug;if(ae&&console.time("preprocess data"),ie.maxZoom<0||ie.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(ie.promoteId&&ie.generateId)throw new Error("promoteId and generateId cannot be used together.");let be=Yt(ee,ie);this.tiles={},this.tileCoords=[],ae&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",ie.indexMaxZoom,ie.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),be=En(be,ie),be.length&&this.splitTile(be,0,0,0),ie.updateable&&(this.source=be),ae&&(be.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(ee,ie,ae,be,Pe,Fe,Ue){const Ne=[ee,ie,ae,be],Ze=this.options,ct=Ze.debug;for(;Ne.length;){be=Ne.pop(),ae=Ne.pop(),ie=Ne.pop(),ee=Ne.pop();const it=1<<ie,yt=Ha(ie,ae,be);let ke=this.tiles[yt];if(!ke&&(ct>1&&console.time("creation"),ke=this.tiles[yt]=mo(ee,ie,ae,be,Ze),this.tileCoords.push({z:ie,x:ae,y:be,id:yt}),ct)){ct>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ie,ae,be,ke.numFeatures,ke.numPoints,ke.numSimplified),console.timeEnd("creation"));const Qi=`z${ie}`;this.stats[Qi]=(this.stats[Qi]||0)+1,this.total++}if(ke.source=ee,Pe==null){if(ie===Ze.indexMaxZoom||ke.numPoints<=Ze.indexMaxPoints)continue}else{if(ie===Ze.maxZoom||ie===Pe)continue;if(Pe!=null){const Qi=Pe-ie;if(ae!==Fe>>Qi||be!==Ue>>Qi)continue}}if(ke.source=null,!ee.length)continue;ct>1&&console.time("clipping");const oi=.5*Ze.buffer/Ze.extent,Hi=.5-oi,Gt=.5+oi,Wt=1+oi;let yi=null,rn=null,dn=null,tr=null;const ir=Ct(ee,it,ae-oi,ae+Gt,0,ke.minX,ke.maxX,Ze),An=Ct(ee,it,ae+Hi,ae+Wt,0,ke.minX,ke.maxX,Ze);ir&&(yi=Ct(ir,it,be-oi,be+Gt,1,ke.minY,ke.maxY,Ze),rn=Ct(ir,it,be+Hi,be+Wt,1,ke.minY,ke.maxY,Ze)),An&&(dn=Ct(An,it,be-oi,be+Gt,1,ke.minY,ke.maxY,Ze),tr=Ct(An,it,be+Hi,be+Wt,1,ke.minY,ke.maxY,Ze)),ct>1&&console.timeEnd("clipping"),Ne.push(yi||[],ie+1,2*ae,2*be),Ne.push(rn||[],ie+1,2*ae,2*be+1),Ne.push(dn||[],ie+1,2*ae+1,2*be),Ne.push(tr||[],ie+1,2*ae+1,2*be+1)}}getTile(ee,ie,ae){ee=+ee,ie=+ie,ae=+ae;const be=this.options,{extent:Pe,debug:Fe}=be;if(ee<0||ee>24)return null;const Ue=1<<ee,Ne=Ha(ee,ie=ie+Ue&Ue-1,ae);if(this.tiles[Ne])return yn(this.tiles[Ne],Pe);Fe>1&&console.log("drilling down to z%d-%d-%d",ee,ie,ae);let Ze,ct=ee,it=ie,yt=ae;for(;!Ze&&ct>0;)ct--,it>>=1,yt>>=1,Ze=this.tiles[Ha(ct,it,yt)];return Ze?.source?(Fe>1&&(console.log("found parent tile z%d-%d-%d",ct,it,yt),console.time("drilling down")),this.splitTile(Ze.source,ct,it,yt,ee,ie,ae),Fe>1&&console.timeEnd("drilling down"),this.tiles[Ne]?yn(this.tiles[Ne],Pe):null):null}invalidateTiles(ee){const ie=this.options,{debug:ae}=ie;let be=1/0,Pe=-1/0,Fe=1/0,Ue=-1/0;for(const ct of ee)be=Math.min(be,ct.minX),Pe=Math.max(Pe,ct.maxX),Fe=M
23ath.min(Fe,ct.minY),Ue=Math.max(Ue,ct.maxY);const Ne=ie.buffer/ie.extent,Ze=new Set;for(const ct in this.tiles){const it=this.tiles[ct],yt=1<<it.z,ke=(it.x-Ne)/yt,oi=(it.x+1+Ne)/yt,Hi=(it.y-Ne)/yt,Gt=(it.y+1+Ne)/yt;if(Pe<ke||be>=oi||Ue<Hi||Fe>=Gt)continue;let Wt=!1;for(const yi of ee)if(yi.maxX>=ke&&yi.minX<oi&&yi.maxY>=Hi&&yi.minY<Gt){Wt=!0;break}if(Wt){if(ae){ae>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",it.z,it.x,it.y,it.numFeatures,it.numPoints,it.numSimplified);const yi=`z${it.z}`;this.stats[yi]=(this.stats[yi]||0)-1,this.total--}delete this.tiles[ct],Ze.add(ct)}}Ze.size&&(this.tileCoords=this.tileCoords.filter((ct=>!Ze.has(ct.id))))}updateData(ee){const ie=this.options,ae=ie.debug;if(!ie.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");const{affected:be,source:Pe}=(function(it,yt,ke){const oi=(function(Gt){return Gt?{removeAll:Gt.removeAll,remove:new Set(Gt.remove||[]),add:new Map(Gt.add?.map((Wt=>[Wt.id,Wt]))),update:new Map(Gt.update?.map((Wt=>[Wt.id,Wt])))}:{remove:new Set,add:new Map,update:new Map}})(yt);let Hi=[];if(oi.removeAll&&(Hi=it,it=[]),oi.remove.size||oi.add.size){const Gt=[];for(const Wt of it){const{id:yi}=Wt;(oi.remove.has(yi)||oi.add.has(yi))&&Gt.push(Wt)}if(Gt.length){Hi.push(...Gt);const Wt=new Set(Gt.map((yi=>yi.id)));it=it.filter((yi=>!Wt.has(yi.id)))}if(oi.add.size){let Wt=Yt({type:"FeatureCollection",features:Array.from(oi.add.values())},ke);Wt=En(Wt,ke),Hi.push(...Wt),it.push(...Wt)}}if(oi.update.size)for(const[Gt,Wt]of oi.update){const yi=it.findIndex((tr=>tr.id===Gt));if(yi===-1)continue;const rn=it[yi],dn=ps(rn,Wt,ke);dn&&(Hi.push(rn,dn),it[yi]=dn)}return{affected:Hi,source:it}})(this.source,ee,ie);if(!be.length)return;this.source=Pe,ae>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(be),ae>1&&console.timeEnd("invalidating");const[Fe,Ue,Ne]=[0,0,0],Ze=mo(this.source,Fe,Ue,Ne,this.options);Ze.source=this.source;const ct=Ha(Fe,Ue,Ne);if(this.tiles[ct]=Ze,this.tileCoords.push({z:Fe,x:Ue,y:Ne,id:ct}),ae){const it=`z${Fe}`;this.stats[it]=(this.stats[it]||0)+1,this.total++}}}function Ha(Be,ee,ie){return 32*((1<<Be)*ie+ee)+Be}class $o extends ve{constructor(ee,ie,ae,be=ms){super(ee,ie,ae),this._dataUpdateable=new Map,this._createGeoJSONIndex=be}loadVectorTile(ee,ie){return T._(this,void 0,void 0,(function*(){const ae=ee.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const be=this._geoJSONIndex.getTile(ae.z,ae.x,ae.y);return be?Ie(new T.d3(be.features,{version:2,extent:T.a5})):null}))}loadData(ee){return T._(this,void 0,void 0,(function*(){var ie;(ie=this._pendingRequest)===null||ie===void 0||ie.abort();const ae=this._startPerformance(ee);this._pendingRequest=new AbortController;try{(!this._pendingData||ee.request||ee.data||ee.dataDiff)&&(this._pendingData=this.loadAndProcessGeoJSON(ee,this._pendingRequest));const be=yield this._pendingData;this._geoJSONIndex=this._createGeoJSONIndex(be,ee),this.loaded={};const Pe={};return ee.request&&(Pe.data=be),this._finishPerformance(ae,ee,Pe),Pe}catch(be){if(delete this._pendingRequest,T.Z(be))return{abandoned:!0};throw be}}))}_startPerformance(ee){var ie;if(!((ie=ee?.request)===null||ie===void 0)&&ie.collectResourceTiming)return new T.c$(ee.request)}_finishPerformance(ee,ie,ae){if(!ee)return;const be=ee.finish();be&&(ae.resourceTiming={},ae.resourceTiming[ie.source]=JSON.parse(JSON.stringify(be)))}getData(){return T._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(ee){const ie=this.loaded;return ie&&ie[ee.uid]?super.reloadTile(ee):this.loadTile(ee)}loadAndProcessGeoJSON(ee,ie){return T._(this,void 0,void 0,(function*(){let ae;if(ee.request?ae=yield this.loadGeoJSONFromUrl(ee.request,ee.promoteId,ie):ee.data?ae=this._loadGeoJSONFromObject(ee.data,ee.promoteId):ee.dataDiff&&(ae=this._loadGeoJSONFromDiff(ee.dataDiff,ee.promoteId,ee.source)),delete this._pendingRequest,typeof ae!="object")throw new Error(`Input data given to '${ee.source}' is not a valid GeoJSON object.`);return Vt(ae,!0),ee.filter&&(ae=this._filterGeoJSON(ae,ee.filter)),ae}))}loadGeoJSONFromUrl(ee,ie,ae){return T._(this,void 0,void 0,(function*(){const be=yield T.j(ee,ae);return this._dataUpdateable=T.a7(be.data,ie),be.data}))}_loadGeoJSONFromObject(ee,ie){return this._dataUpdateable=T.a7(ee,ie),ee}_loadGeoJSONFromDiff(ee,ie,ae){if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${ae}`);T.a8(this._dataUpdateable,ee,ie);const be=Array.from(this._dataUpdateable.values());return this._toFeatureCollection(be)}
vendor: 47,048 bytes, line 23
23_filterGeoJSON(ee,ie){const ae=T.d4(ie,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ae.result==="error")throw new Error(ae.value.map((Pe=>`${Pe.key}: ${Pe.message}`)).join(", "));const be=ee.features.filter((Pe=>ae.value.evaluate({zoom:0},Pe)));return this._toFeatureCollection(be)}_toFeatureCollection(ee){return{type:"FeatureCollection",features:ee}}removeSource(ee){return T._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(ee){return this._geoJSONIndex.getClusterExpansionZoom(ee.clusterId)}getClusterChildren(ee){return this._geoJSONIndex.getChildren(ee.clusterId)}getClusterLeaves(ee){return this._geoJSONIndex.getLeaves(ee.clusterId,ee.limit,ee.offset)}}function ms(Be,ee){return ee.cluster?new Kt((function({superclusterOptions:ie,clusterProperties:ae}){if(!ae||!ie)return ie;const be={},Pe={},Fe={accumulated:null,zoom:0},Ue={properties:null},Ne=Object.keys(ae);for(const Ze of Ne){const[ct,it]=ae[Ze],yt=T.d4(it),ke=T.d4(typeof ct=="string"?[ct,["accumulated"],["get",Ze]]:ct);be[Ze]=yt.value,Pe[Ze]=ke.value}return ie.map=Ze=>{Ue.properties=Ze;const ct={};for(const it of Ne)ct[it]=be[it].evaluate(Fe,Ue);return ct},ie.reduce=(Ze,ct)=>{Ue.properties=ct;for(const it of Ne)Fe.accumulated=Ze[it],Ze[it]=Pe[it].evaluate(Fe,Ue)},ie})(ee)).load(Be.features):(function(ie,ae){return new Sa(ie,ae)})(Be,ee.geojsonVtOptions)}class Al{constructor(ee){this.self=ee,this.actor=new T.L(ee),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(ie,ae)=>{if(this.externalWorkerSourceTypes[ie])throw new Error(`Worker source with name "${ie}" already registered.`);this.externalWorkerSourceTypes[ie]=ae},this.self.addProtocol=T.cK,this.self.removeProtocol=T.cL,this.self.registerRTLTextPlugin=ie=>{T.d5.setMethods(ie)},this.actor.registerMessageHandler("LDT",((ie,ae)=>this._getDEMWorkerSource(ie,ae.source).loadTile(ae))),this.actor.registerMessageHandler("RDT",((ie,ae)=>T._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(ie,ae.source).removeTile(ae)})))),this.actor.registerMessageHandler("GCEZ",((ie,ae)=>T._(this,void 0,void 0,(function*(){return this._getWorkerSource(ie,ae.type,ae.source).getClusterExpansionZoom(ae)})))),this.actor.registerMessageHandler("GCC",((ie,ae)=>T._(this,void 0,void 0,(function*(){return this._getWorkerSource(ie,ae.type,ae.source).getClusterChildren(ae)})))),this.actor.registerMessageHandler("GCL",((ie,ae)=>T._(this,void 0,void 0,(function*(){return this._getWorkerSource(ie,ae.type,ae.source).getClusterLeaves(ae)})))),this.actor.registerMessageHandler("LD",((ie,ae)=>this._getWorkerSource(ie,ae.type,ae.source).loadData(ae))),this.actor.registerMessageHandler("GD",((ie,ae)=>this._getWorkerSource(ie,ae.type,ae.source).getData())),this.actor.registerMessageHandler("LT",((ie,ae)=>this._getWorkerSource(ie,ae.type,ae.source).loadTile(ae))),this.actor.registerMessageHandler("RT",((ie,ae)=>this._getWorkerSource(ie,ae.type,ae.source).reloadTile(ae))),this.actor.registerMessageHandler("AT",((ie,ae)=>this._getWorkerSource(ie,ae.type,ae.source).abortTile(ae))),this.actor.registerMessageHandler("RMT",((ie,ae)=>this._getWorkerSource(ie,ae.type,ae.source).removeTile(ae))),this.actor.registerMessageHandler("RS",((ie,ae)=>T._(this,void 0,void 0,(function*(){if(!this.workerSources[ie]||!this.workerSources[ie][ae.type]||!this.workerSources[ie][ae.type][ae.source])return;const be=this.workerSources[ie][ae.type][ae.source];delete this.workerSources[ie][ae.type][ae.source],be.removeSource!==void 0&&be.removeSource(ae)})))),this.actor.registerMessageHandler("RM",(ie=>T._(this,void 0,void 0,(function*(){delete this.layerIndexes[ie],delete this.availableImages[ie],delete this.workerSources[ie],delete this.demWorkerSources[ie],this.globalStates.delete(ie)})))),this.actor.registerMessageHandler("SR",((ie,ae)=>T._(this,void 0,void 0,(function*(){this.referrer=ae})))),this.actor.registerMessageHandler("SRPS",((ie,ae)=>this._syncRTLPluginState(ie,ae))),this.actor.registerMessageHandler("IS",((ie,ae)=>T._(this,void 0,void 0,(function*(){this.self.importScripts(ae)})))),this.actor.registerMessageHandler("SI",((ie,ae)=>this._setImages(ie,ae))),this.actor.registerMessageHandler("UL",((ie,ae)=>T._(this,void 0,void 0,(function*(){this._getLayerIndex(ie).update(ae.layers,ae.removedIds,this._getGlobalState(ie))})))),this.actor.registerMessageHandler("UGS",((ie,ae)=>T._(this,void 0,void 0,(function*(){const be=this._getGlobalState(ie);for(const Pe in ae)be[Pe]=ae[Pe]})))),this.actor.registerMessageHandler("SL",((ie,ae)=>T._(this,void 0,void 0,(function*(){this._getLayerIndex(ie).replace(ae,this._getGlobalState(ie))}))))}_getGlobalState(ee){let ie=this.globalStates.get(ee);return ie||(ie={},this.globalStates.set(ee,ie)),ie}_setImages(ee,ie){return T._(this,void 0,void 0,(function*(){this.availableImages[ee]=ie;for(const ae in this.workerSources[ee]){const be=this.workerSources[ee][ae];for(const Pe in be)be[Pe].availableImages=ie}}))}_syncRTLPluginState(ee,ie){return T._(this,void 0,void 0,(function*(){return yield T.d5.syncState(ie,this.self.importScripts)}))}_getAvailableImages(ee){let ie=this.availableImages[ee];return ie||(ie=[]),ie}_getLayerIndex(ee){let ie=this.layerIndexes[ee];return ie||(ie=this.layerIndexes[ee]=new u),ie}_getWorkerSource(ee,ie,ae){if(this.workerSources[ee]||(this.workerSources[ee]={}),this.workerSources[ee][ie]||(this.workerSources[ee][ie]={}),!this.workerSources[ee][ie][ae]){const be={sendAsync:(Pe,Fe)=>(Pe.targetMapId=ee,this.actor.sendAsync(Pe,Fe))};switch(ie){case"vector":this.workerSources[ee][ie][ae]=new ve(be,this._getLayerIndex(ee),this._getAvailableImages(ee));break;case"geojson":this.workerSources[ee][ie][ae]=new $o(be,this._getLayerIndex(ee),this._getAvailableImages(ee));break;default:this.workerSources[ee][ie][ae]=new this.externalWorkerSourceTypes[ie](be,this._getLayerIndex(ee),this._getAvailableImages(ee))}}return this.workerSources[ee][ie][ae]}_getDEMWorkerSource(ee,ie){return this.demWorkerSources[ee]||(this.demWorkerSources[ee]={}),this.demWorkerSources[ee][ie]||(this.demWorkerSources[ee][ie]=new lt),this.demWorkerSources[ee][ie]}}return T.i(self)&&(self.worker=new Al(self)),Al})),N("index",["exports","./shared"],(function(T,u){var V="5.17.0";function X(){var g=new u.A(4);return u.A!=Float32Array&&(g[1]=0,g[2]=0),g[0]=1,g[3]=1,g}let ce,ne,ye;const Se={frame(g,t,a,c){const f=c||window,v=f.requestAnimationFrame((C=>{b(),t(C)})),{unsubscribe:b}=u.s(g.signal,"abort",(()=>{b(),f.cancelAnimationFrame(v),a(new u.a(g.signal.reason))}),!1)},frameAsync(g,t){return new Promise(((a,c)=>{this.frame(g,a,c,t)}))},getImageData(g,t=0){return this.getImageCanvasContext(g).getImageData(-t,-t,g.width+2*t,g.height+2*t)},getImageCanvasContext(g){const t=window.document.createElement("canvas"),a=t.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return t.width=g.width,t.height=g.height,a.drawImage(g,0,0,g.width,g.height),a},resolveURL:g=>(ce||(ce=document.createElement("a")),ce.href=g,ce.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return ye!==void 0?ye:!!matchMedia&&(ne==null&&(ne=matchMedia("(prefers-reduced-motion: reduce)")),ne.matches)},set prefersReducedMotion(g){ye=g}},Ie=new class{constructor(){this._realTime=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:this._realTime()}setNow(g){this._frozenAt=g}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Te(){return Ie.getCurrentTime()}class ve{static testProp(t){if(!ve.docStyle)return t[0];for(let a=0;a<t.length;a++)if(t[a]in ve.docStyle)return t[a];return t[0]}static create(t,a,c){const f=window.document.createElement(t);return a!==void 0&&(f.className=a),c&&c.appendChild(f),f}static createNS(t,a){return window.document.createElementNS(t,a)}static disableDrag(){ve.docStyle&&ve.selectProp&&(ve.userSelect=ve.docStyle[ve.selectProp],ve.docStyle[ve.selectProp]="none")}static enableDrag(){ve.docStyle&&ve.selectProp&&(ve.docStyle[ve.selectProp]=ve.userSelect)}static setTransform(t,a){t.style[ve.transformProp]=a}static addEventListener(t,a,c,f={}){t.addEventListener(a,c,"passive"in f?f:f.capture)}static removeEventListener(t,a,c,f={}){t.removeEventListener(a,c,"passive"in f?f:f.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",ve.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ve.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",ve.suppressClickInternal,!0)}),0)}static getScale(t){const a=t.getBoundingClientRect();return{x:a.width/t.offsetWidth||1,y:a.height/t.offsetHeight||1,boundingClientRect:a}}static getPoint(t,a,c){const f=a.boundingClientRect;return new u.P((c.clientX-f.left)/a.x-t.clientLeft,(c.clientY-f.top)/a.y-t.clientTop)}static mousePos(t,a){const c=ve.getScale(t);return ve.getPoint(t,c,a)}static touchPos(t,a){const c=[],f=ve.getScale(t);for(let v=0;v<a.length;v++)c.push(ve.getPoint(t,f,a[v]));return c}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}static sanitize(t){const a=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),c=a.querySelectorAll("script");for(const f of c)f.remove();return ve.clean(a),a.innerHTML}static isPossiblyDangerous(t,a){const c=a.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!c.includes("javascript:")&&!c.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){const a=t.children;for(const c of a)ve.removeAttributes(c),ve.clean(c)}static removeAttributes(t){for(const{name:a,value:c}of t.attributes)ve.isPossiblyDangerous(a,c)&&t.removeAttribute(a)}}ve.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,ve.selectProp=ve.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ve.transformProp=ve.testProp(["transform","WebkitTransform"]);const lt={supported:!1,testSupport:function(g){!Bt&&dt&&(Vt?ui(g):Tt=g)}};let Tt,dt,Bt=!1,Vt=!1;function ui(g){const t=g.createTexture();g.bindTexture(g.TEXTURE_2D,t);try{if(g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,dt),g.isContextLost())return;lt.supported=!0}catch{}g.deleteTexture(t),Bt=!0}var Ft;typeof document<"u"&&(dt=document.createElement("img"),dt.onload=()=>{Tt&&ui(Tt),Tt=null,Vt=!0},dt.onerror=()=>{Bt=!0,Tt=null},dt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(g){let t,a,c,f;g.resetRequestQueue=()=>{t=[],a=0,c=0,f={}},g.addThrottleControl=z=>{const O=c++;return f[O]=z,O},g.removeThrottleControl=z=>{delete f[z],b()},g.getImage=(z,O,U=!0)=>new Promise(((H,q)=>{lt.supported&&(z.headers||(z.headers={}),z.headers.accept="image/webp,*/*"),u.e(z,{type:"image"}),t.push({abortController:O,requestParameters:z,supportImageRefresh:U,state:"queued",onError:Q=>{q(Q)},onSuccess:Q=>{H(Q)}}),b()}));const v=z=>u._(this,void 0,void 0,(function*(){z.state="running";const{requestParameters:O,supportImageRefresh:U,onError:H,onSuccess:q,abortController:Q}=z,re=U===!1&&!u.i(self)&&!u.g(O.url)&&(!O.headers||Object.keys(O.headers).reduce(((fe,_e)=>fe&&_e==="accept"),!0));a++;const de=re?C(O,Q):u.m(O,Q);try{const fe=yield de;delete z.abortController,z.state="completed",fe.data instanceof HTMLImageElement||u.b(fe.data)?q(fe):fe.data&&q({data:yield(pe=fe.data,typeof createImageBitmap=="function"?u.f(pe):u.h(pe)),cacheControl:fe.cacheControl,expires:fe.expires})}catch(fe){delete z.abortController,H(fe)}finally{a--,b()}var pe})),b=()=>{const z=(()=>{for(const O of Object.keys(f))if(f[O]())return!0;return!1})()?u.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:u.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let O=a;O<z&&t.length>0;O++){const U=t.shift();U.abortController.signal.aborted?O--:v(U)}},C=(z,O)=>new Promise(((U,H)=>{const q=new Image,Q=z.url,re=z.credentials;re&&re==="include"?q.crossOrigin="use-credentials":(re&&re==="same-origin"||!u.d(Q))&&(q.crossOrigin="anonymous"),O.signal.addEventListener("abort",(()=>{q.src="",H(new u.a(O.signal.reason))})),q.fetchPriority="high",q.onload=()=>{q.onerror=q.onload=null,U({data:q})},q.onerror=()=>{q.onerror=q.onload=null,O.signal.aborted||H(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."))},q.src=Q}))})(Ft||(Ft={})),Ft.resetRequestQueue();class vi{constructor(t){this._transformRequestFn=t??null}transformRequest(t,a){return this._transformRequestFn&&this._transformRequestFn(t,a)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function Kt(g){const t=[];if(typeof g=="string")t.push({id:"default",url:g});else if(g&&g.length>0){const a=[];for(const{id:c,url:f}of g){const v=`${c}${f}`;a.indexOf(v)===-1&&(a.push(v),t.push({id:c,url:f}))}}return t}function qt(g,t,a){try{const c=new URL(g);return c.pathname+=`${t}${a}`,c.toString()}catch{throw new Error(`Invalid sprite URL "${g}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Ht(g){const{userImage:t}=g;return!!(t&&t.render&&t.render())&&(g.data.replace(new Uint8Array(t.data.buffer)),!0)}class Xt extends u.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(const t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:a,promiseResolve:c}of this.requestors)c(this._getImagesForIds(a));this.requestors=[]}}getImage(t){const a=this.images[t];if(a&&!a.data&&a.spriteData){const c=a.spriteData;a.data=new u.R({width:c.width,height:c.height},c.context.getImageData(c.x,c.y,c.width,c.height).data),a.spriteData=null}return a}addImage(t,a){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,a)&&(this.images[t]=a)}_validate(t,a){let c=!0;const f=a.data||a.spriteData;return this._validateStretch(a.stretchX,f&&f.width)||(this.fire(new u.k(new Error(`Image "${t}" has invalid "stretchX" value`))),c=!1),this._validateStretch(a.stretchY,f&&f.height)||(this.fire(new u.k(new Error(`Image "${t}" has invalid "stretchY" value`))),c=!1),this._validateContent(a.content,a)||(this.fire(new u.k(new Error(`Image "${t}" has invalid "content" value`))),c=!1),c}_validateStretch(t,a){if(!t)return!0;let c=0;for(const f of t){if(f[0]<c||f[1]<f[0]||a<f[1])return!1;c=f[1]}return!0}_validateContent(t,a){if(!t)return!0;if(t.length!==4)return!1;const c=a.spriteData,f=c&&c.width||a.data.width,v=c&&c.height||a.data.height;return!(t[0]<0||f<t[0]||t[1]<0||v<t[1]||t[2]<0||f<t[2]||t[3]<0||v<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,a,c=!0){const f=this.getImage(t);if(c&&(f.data.width!==a.data.width||f.data.height!==a.data.height))throw new Error(`size mismatch between old image (${f.data.width}x${f.data.height}) and new image (${a.data.width}x${a.data.height}).`);a.version=f.version+1,this.images[t]=a,this.updatedImages[t]=!0}removeImage(t){const a=this.images[t];delete this.images[t],delete this.patterns[t],a.userImage&&a.userImage.onRemove&&a.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((a,c)=>{let f=!0;if(!this.isLoaded())for(const v of t)this.images[v]||(f=!1);this.isLoaded()||f?a(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:a})}))}_getImagesForIds(t){const a={};for(const c of t){let f=this.getImage(c);f||(this.fire(new u.l("styleimagemissing",{id:c})),f=this.getImage(c)),f?a[c]={data:f.data.clone(),pixelRatio:f.pixelRatio,sdf:f.sdf,version:f.version,stretchX:f.stretchX,stretchY:f.stretchY,content:f.content,textFitWidth:f.textFitWidth,textFitHeight:f.textFitHeight,hasRenderCallback:!!(f.userImage&&f.userImage.render)}:u.w(`Image "${c}" 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 a}getPixelSize(){const{width:t,height:a}=this.atlasImage;return{width:t,height:a}}getPattern(t){const a=this.patterns[t],c=this.getImage(t);if(!c)return null;if(a&&a.position.version===c.version)return a.position;if(a)a.position.version=c.version;else{const f={w:c.data.width+2,h:c.data.height+2,x:0,y:0},v=new u.I(f,c);this.patterns[t]={bin:f,position:v}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const a=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u.T(t,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const v in this.patterns)t.push(this.patterns[v].bin);const{w:a,h:c}=u.p(t),f=this.atlasImage;f.resize({width:a||1,height:c||1});for(const v in this.patterns){const{bin:b}=this.patterns[v],C=b.x+1,z=b.y+1,O=this.getImage(v).data,U=O.width,H=O.height;u.R.copy(O,f,{x:0,y:0},{x:C,y:z},{width:U,height:H}),u.R.copy(O,f,{x:0,y:H-1},{x:C,y:z-1},{width:U,height:1}),u.R.copy(O,f,{x:0,y:0},{x:C,y:z+H},{width:U,height:1}),u.R.copy(O,f,{x:U-1,y:0},{x:C-1,y:z},{width:1,height:H}),u.R.copy(O,f,{x:0,y:0},{x:C+U,y:z},{width:1,height:H})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const a of t){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;const c=this.getImage(a);c||u.w(`Image with ID: "${a}" was not found`),Ht(c)&&this.updateImage(a,c)}}cloneImages(){const t={};for(const a in this.images){const c=this.images[a];t[a]=Object.assign(Object.assign({},c),{data:c.data?c.data.clone():null})}return t}}const si=1e20;function ii(g,t,a,c,f,v,b,C,z){for(let O=t;O<t+c;O++)Vi(g,a*v+O,v,f,b,C,z);for(let O=a;O<a+f;O++)Vi(g,O*v+t,1,c,b,C,z)}function Vi(g,t,a,c,f,v,b){v[0]=0,b[0]=-si,b[1]=si,f[0]=g[t];for(let C=1,z=0,O=0;C<c;C++){f[C]=g[t+C*a];const U=C*C;do{const H=v[z];O=(f[C]-f[H]+U-H*H)/(C-H)/2}while(O<=b[z]&&--z>-1);z++,v[z]=C,b[z]=O,b[z+1]=si}for(let C=0,z=0;C<c;C++){for(;b[z+1]<C;)z++;const O=v[z],U=C-O;g[t+C*a]=f[O]+U*U}}const Ke=u.v.layout_symbol["text-font"].default.join(",");class mt{constructor(t,a,c){this.requestManager=t,this.localIdeographFontFamily=a,this.entries={},this.lang=c}setURL(t){this.url=t}getGlyphs(t){return u._(this,void 0,void 0,(function*(){const a=[];for(const v in t)for(const b of t[v])a.push(this._getAndCacheGlyphsPromise(v,b));const c=yield Promise.all(a),f={};for(const{stack:v,id:b,glyph:C}of c)f[v]||(f[v]={}),f[v][b]=C&&{id:C.id,bitmap:C.bitmap.clone(),metrics:C.metrics};return f}))}_getAndCacheGlyphsPromise(t,a){return u._(this,void 0,void 0,(function*(){let c=this.entries[t];c||(c=this.entries[t]={glyphs:{},requests:{},ranges:{}});let f=c.glyphs[a];return f!==void 0?{stack:t,id:a,glyph:f}:!this.url||this._charUsesLocalIdeographFontFamily(a)?(f=c.glyphs[a]=this._drawGlyph(c,t,a),{stack:t,id:a,glyph:f}):yield this._downloadAndCacheRangePromise(t,a)}))}_downloadAndCacheRangePromise(t,a){return u._(this,void 0,void 0,(function*(){const c=this.entries[t],f=Math.floor(a/256);if(c.ranges[f])return{stack:t,id:a,glyph:null};if(!c.requests[f]){const v=mt.loadGlyphRange(t,f,this.url,this.requestManager);c.requests[f]=v}try{const v=yield c.requests[f];for(const b in v)c.glyphs[+b]=v[+b];return c.ranges[f]=!0,{stack:t,id:a,glyph:v[a]||null}}catch(v){const b=c.glyphs[a]=this._drawGlyph(c,t,a);return this._warnOnMissingGlyphRange(b,f,a,v),{stack:t,id:a,glyph:b}}}))}_warnOnMissingGlyphRange(t,a,c,f){const v=256*a,b=v+255,C=c.toString(16).padStart(4,"0").toUpperCase();u.w(`Unable to load glyph range ${a}, ${v}-${b}. Rendering codepoint U+${C} locally instead. ${f}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&u.q(t)}_drawGlyph(t,a,c){const f=a===Ke&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(c),v=f?"ideographTinySDF":"tinySDF";t[v]||(t[v]=this._createTinySDF(f?this.localIdeographFontFamily:a));const b=t[v].draw(String.fromCodePoint(c)),C=new RegExp("^\\p{gc=Cf}+$","u").test(String.fromCodePoint(c));return{id:c,bitmap:new u.r({width:b.width||60,height:b.height||60},b.data),metrics:{width:C?0:b.glyphWidth/2||24,height:b.glyphHeight/2||24,left:b.glyphLeft/2+.5||0,top:b.glyphTop/2-27.5||-8,advance:C?0:b.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){const a=t?t.split(","):[];a.push("sans-serif");const c=a.map((f=>/[-\w]+/.test(f)?f:`'${CSS.escape(f)}'`)).join(",");return new mt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:c,fontWeight:this._fontWeight(a[0]),fontStyle:this._fontStyle(a[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){const a={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950};let c;for(const[f,v]of Object.entries(a))new RegExp(`\\b${f}\\b`,"i").test(t)&&(c=`${v}`);return c}destroy(){for(const t in this.entries){const a=this.entries[t];a.tinySDF&&(a.tinySDF=null),a.ideographTinySDF&&(a.ideographTinySDF=null),a.glyphs={},a.requests={},a.ranges={}}this.entries={}}}mt.loadGlyphRange=function(g,t,a,c){return u._(this,void 0,void 0,(function*(){const f=256*t,v=f+255,b=c.transformRequest(a.replace("{fontstack}",g).replace("{range}",`${f}-${v}`),"Glyphs"),C=yield u.n(b,new AbortController);if(!C||!C.data)throw new Error(`Could not load glyph range. range: ${t}, ${f}-${v}`);const z={};for(const O of u.o(C.data))z[O.id]=O;return z}))},mt.TinySDF=class{constructor({fontSize:g=24,buffer:t=3,radius:a=8,cutoff:c=.25,fontFamily:f="sans-serif",fontWeight:v="normal",fontStyle:b="normal",lang:C=null}={}){this.buffer=t,this.cutoff=c,this.radius=a,this.lang=C;const z=this.size=g+4*t,O=this._createCanvas(z),U=this.ctx=O.getContext("2d",{willReadFrequently:!0});U.font=`${b} ${v} ${g}px ${f}`,U.textBaseline="alphabetic",U.textAlign="left",U.fillStyle="black",this.gridOuter=new Float64Array(z*z),this.gridInner=new Float64Array(z*z),this.f=new Float64Array(z),this.z=new Float64Array(z+1),this.v=new Uint16Array(z)}_createCanvas(g){const t=document.createElement("canvas");return t.width=t.height=g,t}draw(g){const{width:t,actualBoundingBoxAscent:a,actualBoundingBoxDescent:c,actualBoundingBoxLeft:f,actualBoundingBoxRight:v}=this.ctx.measureText(g),b=Math.ceil(a),C=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(v-f))),z=Math.min(this.size-this.buffer,b+Math.ceil(c)),O=C+2*this.buffer,U=z+2*this.buffer,H=Math.max(O*U,0),q=new Uint8ClampedArray(H),Q={data:q,width:O,height:U,glyphWidth:C,glyphHeight:z,glyphTop:b,glyphLeft:0,glyphAdvance:t};if(C===0||z===0)return Q;const{ctx:re,buffer:de,gridInner:pe,gridOuter:fe}=this;this.lang&&(re.lang=this.lang),re.clearRect(de,de,C,z),re.fillText(g,de,de+b);const _e=re.getImageData(de,de,C,z);fe.fill(si,0,H),pe.fill(0,0,H);for(let Me=0;Me<z;Me++)for(let me=0;me<C;me++){const Ce=_e.data[4*(Me*C+me)+3]/255;if(Ce===0)continue;const Le=(Me+de)*O+me+de;if(Ce===1)fe[Le]=0,pe[Le]=si;else{const we=.5-Ce;fe[Le]=we>0?we*we:0,pe[Le]=we<0?we*we:0}}ii(fe,0,0,O,U,O,this.f,this.v,this.z),ii(pe,de,de,C,z,O,this.f,this.v,this.z);for(let Me=0;Me<H;Me++){const me=Math.sqrt(fe[Me])-Math.sqrt(pe[Me]);q[Me]=Math.round(255-255*(me/this.radius+this.cutoff))}return Q}};class gt{constructor(){this.specification=u.u.light.position}possiblyEvaluate(t,a){return u.F(t.expression.evaluate(a))}interpolate(t,a,c){return{x:u.G.number(t.x,a.x,c),y:u.G.number(t.y,a.y,c),z:u.G.number(t.z,a.z,c)}}}let Yt;class It extends u.E{constructor(t){super(),Yt=Yt||new u.t({anchor:new u.D(u.u.light.anchor),position:new gt,color:new u.D(u.u.light.color),intensity:new u.D(u.u.light.intensity)}),this._transitionable=new u.x(Yt,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,a={}){if(!this._validate(u.y,t,a))for(const c in t){const f=t[c];c.endsWith(u.z)?this._transitionable.setTransition(c.slice(0,-u.z.length),f):this._transitionable.setValue(c,f)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,a,c){return(!c||c.validate!==!1)&&u.B(this,t.call(u.C,{value:a,style:{glyphs:!0,sprite:!0},styleSpec:u.u}))}}const ze=new u.t({"sky-color":new u.D(u.u.sky["sky-color"]),"horizon-color":new u.D(u.u.sky["horizon-color"]),"fog-color":new u.D(u.u.sky["fog-color"]),"fog-ground-blend":new u.D(u.u.sky["fog-ground-blend"]),"horizon-fog-blend":new u.D(u.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new u.D(u.u.sky["sky-horizon-blend"]),"atmosphere-blend":new u.D(u.u.sky["atmosphere-blend"])});class rt extends u.E{constructor(t){super(),this._transitionable=new u.x(ze,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new u.H(0))}setSky(t,a={}){if(!this._validate(u.J,t,a)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const c in t){const f=t[c];c.endsWith(u.z)?this._transitionable.setTransition(c.slice(0,-u.z.length),f):this._transitionable.setValue(c,f)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,a,c={}){return c?.validate!==!1&&u.B(this,t.call(u.C,u.e({value:a,style:{glyphs:!0,sprite:!0},styleSpec:u.u})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class Et{constructor(t,a){this.width=t,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,a){const c=t.join(",")+String(a);return this.dashEntry[c]||(this.dashEntry[c]=this.addDash(t,a)),this.dashEntry[c]}getDashRanges(t,a,c){const f=[];let v=t.length%2==1?-t[t.length-1]*c:0,b=t[0]*c,C=!0;f.push({left:v,right:b,isDash:C,zeroLength:t[0]===0});let z=t[0];for(let O=1;O<t.length;O++){C=!C;const U=t[O];v=z*c,z+=U,b=z*c,f.push({left:v,right:b,isDash:C,zeroLength:U===0})}return f}addRoundDash(t,a,c){const f=a/2;for(let v=-c;v<=c;v++){const b=this.width*(this.nextRow+c+v);let C=0,z=t[C];for(let O=0;O<this.width;O++){O/z.right>1&&(z=t[++C]);const U=Math.abs(O-z.left),H=Math.abs(O-z.right),q=Math.min(U,H);let Q;const re=v/c*(f+1);if(z.isDash){const de=f-Math.abs(re);Q=Math.sqrt(q*q+de*de)}else Q=f-Math.sqrt(q*q+re*re);this.data[b+O]=Math.max(0,Math.min(255,Q+128))}}}addRegularDash(t){for(let C=t.length-1;C>=0;--C){const z=t[C],O=t[C+1];z.zeroLength?t.splice(C,1):O&&O.isDash===z.isDash&&(O.left=z.left,t.splice(C,1))}const a=t[0],c=t[t.length-1];a.isDash===c.isDash&&(a.left=c.left-this.width,c.right=a.right+this.width);const f=this.width*this.nextRow;let v=0,b=t[v];for(let C=0;C<this.width;C++){C/b.right>1&&(b=t[++v]);const z=Math.abs(C-b.left),O=Math.abs(C-b.right),U=Math.min(z,O);this.data[f+C]=Math.max(0,Math.min(255,(b.isDash?U:-U)+128))}}addDash(t,a){const c=a?7:0,f=2*c+1;if(this.nextRow+f>this.height)return u.w("LineAtlas out of space"),null;let v=0;for(let C=0;C<t.length;C++)v+=t[C];if(v!==0){const C=this.width/v,z=this.getDashRanges(t,this.width,C);a?this.addRoundDash(z,C,c):this.addRegularDash(z)}const b={y:this.nextRow+c,height:2*c,width:v};return this.nextRow+=f,this.dirty=!0,b}bind(t){const a=t.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))}}const Pt="maplibre_preloaded_worker_pool";class St{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<St.workerCount;)this.workers.push(new Worker(u.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach((a=>{a.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Pt]}numActive(){return Object.keys(this.active).length}}const Ct=Math.floor(Se.hardwareConcurrency/2);let ri,wi;function Wi(){return ri||(ri=new St),ri}St.workerCount=u.K(globalThis)?Math.max(Math.min(Ct,3),1):1;class vr{constructor(t,a){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a;const c=this.workerPool.acquire(a);for(let f=0;f<c.length;f++){const v=new u.L(c[f],a);v.name=`Worker ${f}`,this.actors.push(v)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,a){const c=[];for(const f of this.actors)c.push(f.sendAsync({type:t,data:a}));return Promise.all(c)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach((a=>{a.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,a){for(const c of this.actors)c.registerMessageHandler(t,a)}unregisterMessageHandler(t){for(const a of this.actors)a.unregisterMessageHandler(t)}}function Ur(){return wi||(wi=new vr(Wi(),u.M),wi.registerMessageHandler("GR",((g,t,a)=>u.m(t,a)))),wi}function xr(g,t){const a=u.N();return u.O(a,a,[1,1,0]),u.Q(a,a,[.5*g.width,.5*g.height,1]),g.calculatePosMatrix?u.S(a,a,g.calculatePosMatrix(t.toUnwrapped())):a}function Ho(g,t,a,c,f,v,b){var C;const z=(function(q,Q,re){if(q)for(const de of q){const pe=Q[de];if(pe&&pe.source===re&&pe.type==="fill-extrusion")return!0}else for(const de in Q){const pe=Q[de];if(pe.source===re&&pe.type==="fill-extrusion")return!0}return!1})((C=f?.layers)!==null&&C!==void 0?C:null,t,g.id),O=v.maxPitchScaleFactor(),U=g.tilesIn(c,O,z);U.sort(En);const H=[];for(const q of U)H.push({wrappedTileID:q.tileID.wrapped().key,queryResults:q.tile.queryRenderedFeatures(t,a,g.getState(),q.queryGeometry,q.cameraQueryGeometry,q.scale,f,v,O,xr(v,q.tileID),b?(Q,re)=>b(q.tileID,Q,re):void 0)});return(function(q,Q){for(const re in q)for(const de of q[re])Vr(de,Q);return q})((function(q){const Q={},re={};for(const de of q){const pe=de.queryResults,fe=de.wrappedTileID,_e=re[fe]=re[fe]||{};for(const Me in pe){const me=pe[Me],Ce=_e[Me]=_e[Me]||{},Le=Q[Me]=Q[Me]||[];for(const we of me)Ce[we.featureIndex]||(Ce[we.featureIndex]=!0,Le.push(we))}}return Q})(H),g)}function En(g,t){const a=g.tileID,c=t.tileID;return a.overscaledZ-c.overscaledZ||a.canonical.y-c.canonical.y||a.wrap-c.wrap||a.canonical.x-c.canonical.x}function Vr(g,t){const a=g.feature,c=t.getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=c}function ta(g,t,a,c){return u._(this,void 0,void 0,(function*(){let f=g;if(g.url?f=(yield u.j(t.transformRequest(g.url,"Source"),a)).data:yield Se.frameAsync(a,c),!f)return null;const v=u.U(u.e(f,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in f&&f.vector_layers&&(v.vectorLayerIds=f.vector_layers.map((b=>b.id))),v}))}class yn{constructor(t,a){t&&(a?this.setSouthWest(t).setNorthEast(a):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof u.V?new u.V(t.lng,t.lat):u.V.convert(t),this}setSouthWest(t){return this._sw=t instanceof u.V?new u.V(t.lng,t.lat):u.V.convert(t),this}extend(t){const a=this._sw,c=this._ne;let f,v;if(t instanceof u.V)f=t,v=t;else{if(!(t instanceof yn))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(yn.convert(t)):this.extend(u.V.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(u.V.convert(t)):this;if(f=t._sw,v=t._ne,!f||!v)return this}return a||c?(a.lng=Math.min(f.lng,a.lng),a.lat=Math.min(f.lat,a.lat),c.lng=Math.max(v.lng,c.lng),c.lat=Math.max(v.lat,c.lat)):(this._sw=new u.V(f.lng,f.lat),this._ne=new u.V(v.lng,v.lat)),this}getCenter(){return new u.V((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new u.V(this.getWest(),this.getNorth())}getSouthEast(){return new u.V(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:a,lat:c}=u.V.convert(t);let f=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(f=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=c&&c<=this._ne.lat&&f}intersects(t){if(!((t=yn.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;const a=Math.abs(this.getEast()-this.getWest()),c=Math.abs(t.getEast()-t.getWest());if(a>=360||c>=360)return!0;const f=u.W(this.getWest(),-180,180),v=u.W(this.getEast(),-180,180),b=u.W(t.getWest(),-180,180),C=u.W(t.getEast(),-180,180),z=f>=v,O=b>=C;return!(!z||!O)||(z?C>=f||b<=v:O?v>=b||f<=C:b<=v&&C>=f)}static convert(t){return t instanceof yn?t:t&&new yn(t)}static fromLngLat(t,a=0){const c=360*a/40075017,f=c/Math.cos(Math.PI/180*t.lat);return new yn(new u.V(t.lng-f,t.lat-c),new u.V(t.lng+f,t.lat+c))}adjustAntiMeridian(){const t=new u.V(this._sw.lng,this._sw.lat),a=new u.V(this._ne.lng,this._ne.lat);return new yn(t,t.lng>a.lng?new u.V(a.lng+360,a.lat):a)}}class Ta{constructor(t,a,c){this.bounds=yn.convert(this.validateBounds(t)),this.minzoom=a||0,this.maxzoom=c||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const a=Math.pow(2,t.z),c=Math.floor(u.Y(this.bounds.getWest())*a),f=Math.floor(u.X(this.bounds.getNorth())*a),v=Math.ceil(u.Y(this.bounds.getEast())*a),b=Math.ceil(u.X(this.bounds.getSouth())*a);return t.x>=c&&t.x<v&&t.y>=f&&t.y<b}}class mo extends u.E{constructor(t,a,c,f){if(super(),this.id=t,this.dispatcher=c,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.e(this,u.U(a,["url","scheme","tileSize","promoteId","encoding"])),this._options=u.e({type:"vector"},a),this._collectResourceTiming=a.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}load(){return u._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new u.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield ta(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,this.map.style.tileManagers[this.id].clearTiles(),t&&(u.e(this,t),t.bounds&&(this.tileBounds=new Ta(t.bounds,this.minzoom,this.maxzoom)),this.fire(new u.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.l("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,u.Z(t)||this.fire(new u.k(t))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return u.e({},this._options)}loadTile(t){return u._(this,void 0,void 0,(function*(){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(a,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:this._getOverzoomParameters(t)};c.request.collectResourceTiming=this._collectResourceTiming;let f="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise(((v,b)=>{t.reloadPromise={resolve:v,reject:b}}))}else t.actor=this.dispatcher.getActor(),f="LT";t.abortController=new AbortController;try{const v=yield t.actor.sendAsync({type:f,data:c},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,v)}catch(v){if(delete t.abortController,t.aborted)return;if(v&&v.status!==404)throw v;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;const a=t.tileID.scaledTo(this.maxzoom).canonical,c=a.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:a,overzoomRequest:this.map._requestManager.transformRequest(c,"Tile")}}_afterTileLoadWorkerResponse(t,a){if(a&&a.resourceTiming&&(t.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&t.setExpiryData(a),t.loadVectorData(a,this.map.painter),t.reloadPromise){const c=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(c.resolve).catch(c.reject)}}abortTile(t){return u._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return u._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class js extends u.E{constructor(t,a,c,f){super(),this.id=t,this.dispatcher=c,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.e({type:"raster"},a),u.e(this,u.U(a,["url","scheme","tileSize"]))}load(){return u._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new u.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const a=yield ta(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,a&&(u.e(this,a),a.bounds&&(this.tileBounds=new Ta(a.bounds,this.minzoom,this.maxzoom)),this.fire(new u.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(a){this._tileJSONRequest=null,this._loaded=!0,u.Z(a)||this.fire(new u.k(a))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return u.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return u._(this,void 0,void 0,(function*(){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const c=yield Ft.getImage(this.map._requestManager.transformRequest(a,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(c&&c.data){this.map._refreshExpiredTiles&&(c.cacheControl||c.expires)&&t.setExpiryData({cacheControl:c.cacheControl,expires:c.expires});const f=this.map.painter.context,v=f.gl,b=c.data;t.texture=this.map.painter.getTileTexture(b.width),t.texture?t.texture.update(b,{useMipmap:!0}):(t.texture=new u.T(f,b,v.RGBA,{useMipmap:!0}),t.texture.bind(v.LINEAR,v.CLAMP_TO_EDGE,v.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(c){if(delete t.abortController,t.aborted)t.state="unloaded";else if(c)throw t.state="errored",c}}))}abortTile(t){return u._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return u._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class ia extends js{constructor(t,a,c,f){super(t,a,c,f),this.type="raster-dem",this.maxzoom=22,this._options=u.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(t){return u._(this,void 0,void 0,(function*(){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c=this.map._requestManager.transformRequest(a,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const f=yield Ft.getImage(c,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(f&&f.data){const v=f.data;this.map._refreshExpiredTiles&&(f.cacheControl||f.expires)&&t.setExpiryData({cacheControl:f.cacheControl,expires:f.expires});const b=u.b(v)&&u.$()?v:yield this.readImageNow(v),C={type:this.type,uid:t.uid,source:this.id,rawImageData:b,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();const z=yield t.actor.sendAsync({type:"LDT",data:C});t.dem=z,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(f){if(delete t.abortController,t.aborted)t.state="unloaded";else if(f)throw t.state="errored",f}}))}readImageNow(t){return u._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&u.a0()){const a=t.width+2,c=t.height+2;try{return new u.R({width:a,height:c},yield u.a1(t,-1,-1,a,c))}catch{}}return Se.getImageData(t,1)}))}_getNeighboringTiles(t){const a=t.canonical,c=Math.pow(2,a.z),f=(a.x-1+c)%c,v=a.x===0?t.wrap-1:t.wrap,b=(a.x+1+c)%c,C=a.x+1===c?t.wrap+1:t.wrap,z={};return z[new u.a2(t.overscaledZ,v,a.z,f,a.y).key]={backfilled:!1},z[new u.a2(t.overscaledZ,C,a.z,b,a.y).key]={backfilled:!1},a.y>0&&(z[new u.a2(t.overscaledZ,v,a.z,f,a.y-1).key]={backfilled:!1},z[new u.a2(t.overscaledZ,t.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},z[new u.a2(t.overscaledZ,C,a.z,b,a.y-1).key]={backfilled:!1}),a.y+1<c&&(z[new u.a2(t.overscaledZ,v,a.z,f,a.y+1).key]={backfilled:!1},z[new u.a2(t.overscaledZ,t.wrap,a.z,a.x,a.y+1).key]={backfilled:!1},z[new u.a2(t.overscaledZ,C,a.z,b,a.y+1).key]={backfilled:!1}),z}unloadTile(t){return u._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}function ps(g){return g.type==="GeometryCollection"?g.geometries.map((t=>t.coordinates)).flat(1/0):g.coordinates.flat(1/0)}function go(g){const t=new yn;let a;switch(g.type){case"FeatureCollection":a=g.features.map((c=>ps(c.geometry))).flat(1/0);break;case"Feature":a=ps(g.geometry);break;default:a=ps(g)}if(a.length==0)return t;for(let c=0;c<a.length-1;c+=2)t.extend([a[c],a[c+1]]);return t}class pr extends u.E{constructor(t,a,c,f){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:a.data},this.actor=c.getActor(),this.setEventedParent(f),this._data=typeof a.data=="string"?{url:a.data}:{geojson:a.data},this._options=u.e({},a),this._collectResourceTiming=a.collectResourceTiming,a.maxzoom!==void 0&&(this.maxzoom=a.maxzoom),a.type&&(this.type=a.type),a.attribution&&(this.attribution=a.attribution),this.promoteId=a.promoteId,a.clusterMaxZoom!==void 0&&this.maxzoom<=a.clusterMaxZoom&&u.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${a.clusterMaxZoom}".`),this.workerOptions=u.e({source:this.id,cluster:a.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(a.buffer!==void 0?a.buffer:128),tolerance:this._pixelsToTileUnits(a.tolerance!==void 0?a.tolerance:.375),extent:u.a5,maxZoom:this.maxzoom,lineMetrics:a.lineMetrics||!1,generateId:a.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(a.clusterMaxZoom),minPoints:Math.max(2,a.clusterMinPoints||2),extent:u.a5,radius:this._pixelsToTileUnits(a.clusterRadius||50),log:!1,generateId:a.generateId||!1},clusterProperties:a.clusterProperties,filter:a.filter},a.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.optionsChanged}_pixelsToTileUnits(t){return t*(u.a5/this.tileSize)}_getClusterMaxZoom(t){const a=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||u.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${a}"`),a}load(){return u._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,a){this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};const c=this._updateWorkerData();return a?c:this}updateData(t,a){this._pendingWorkerUpdate.diff=u.a6(this._pendingWorkerUpdate.diff,t);const c=this._updateWorkerData();return a?c:this}getData(){return u._(this,void 0,void 0,(function*(){const t=u.e({type:this.t
23ype},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})}))}getBounds(){return u._(this,void 0,void 0,(function*(){return go(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.optionsChanged=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,a,c){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:a,offset:c}})}_updateWorkerData(){return u._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void u.w(`No pending worker updates for GeoJSONSource ${this.id}.`);const{data:t,diff:a}=this._pendingWorkerUpdate,c=this._getLoadGeoJSONParameters(t,a);t!==void 0?this._pendingWorkerUpdate.data=void 0:a&&(this._pendingWorkerUpdate.diff=void 0),this._pendingWorkerUpdate.optionsChanged=void 0,yield this._dispatchWorkerUpdate(c)}))}_getLoadGeoJSONParameters(t,a){const c=u.e({type:this.type},this.workerOptions);return typeof t=="string"?(c.request=this.map._requestManager.transformRequest(Se.resolveURL(t),"Source"),c.request.collectResourceTiming=this._collectResourceTiming,c):t!==void 0?(c.data=t,c):(a&&(c.dataDiff=a),c)}_dispatchWorkerUpdate(t){return u._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new u.l("dataloading",{dataType:"source"}));try{const a=yield this.actor.sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||a.abandoned)return void this.fire(new u.l("dataabort",{dataType:"source"}));a.data&&(this._data={geojson:a.data});const c=this._applyDiffToSource(t.dataDiff),f=this._getShouldReloadTileOptions(c),v={dataType:"source"};this._applyResourceTiming(v,a),this.fire(new u.l("data",Object.assign(Object.assign({},v),{sourceDataType:"metadata"}))),this.fire(new u.l("data",Object.assign(Object.assign({},v),{sourceDataType:"content",shouldReloadTileOptions:f})))}catch(a){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new u.l("dataabort",{dataType:"source"}));this.fire(new u.k(a))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(t,a){var c;if(!this._collectResourceTiming)return;const f=(c=a.resourceTiming)===null||c===void 0?void 0:c[this.id];if(!f)return;const v=f.slice(0);v?.length&&u.e(t,{resourceTiming:v})}_applyDiffToSource(t){if(!t)return;const a=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){const f=u.a7(this._data.geojson,a);if(!f)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:f}}if(!this._data.updateable)return;const c=u.a8(this._data.updateable,t,a);return t.removeAll||this._options.cluster?void 0:c}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((a=>go(a)))}}shouldReloadTile(t,{affectedBounds:a}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;const{buffer:c,extent:f}=this.workerOptions.geojsonVtOptions,v=(function({x:b,y:C,z},O=0){const U=u.a3((b-O)/Math.pow(2,z)),H=u.a4((C+1+O)/Math.pow(2,z)),q=u.a3((b+1+O)/Math.pow(2,z)),Q=u.a4((C-O)/Math.pow(2,z));return new yn([U,H],[q,Q])})(t.tileID.canonical,c/f);for(const b of a)if(v.intersects(b))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return u._(this,void 0,void 0,(function*(){const a=t.actor?"RT":"LT";t.actor=this.actor;const c={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;const f=yield this.actor.sendAsync({type:a,data:c},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(f,this.map.painter,a==="RT")}))}abortTile(t){return u._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return u._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.t
vendor: 8,448 bytes, line 23
23ype,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return u.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class Sa extends u.E{constructor(t,a,c,f){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=c,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=a}load(t){return u._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new u.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const a=yield Ft.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a&&a.data&&(this.image=a.data,t&&(this.coordinates=t),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,u.Z(a)||this.fire(new u.k(a))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const a=t.map(u.a9.fromLngLat);var c;return this.tileID=(function(f){const v=u.aa.fromPoints(f),b=v.width(),C=v.height(),z=Math.max(b,C),O=Math.max(0,Math.floor(-Math.log(z)/Math.LN2)),U=Math.pow(2,O);return new u.ac(O,Math.floor((v.minX+v.maxX)/2*U),Math.floor((v.minY+v.maxY)/2*U))})(a),this.terrainTileRanges=this._getOverlappingTileRanges(a),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=a.map((f=>this.tileID.getTilePoint(f)._round())),this.flippedWindingOrder=((c=this.tileCoords)[1].x-c[0].x)*(c[2].y-c[0].y)-(c[1].y-c[0].y)*(c[2].x-c[0].x)<0,this.fire(new u.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,a=t.gl;this.texture||(this.texture=new u.T(t,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let c=!1;for(const f in this.tiles){const v=this.tiles[f];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,c=!0)}c&&this.fire(new u.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return u._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){const{minX:a,minY:c,maxX:f,maxY:v}=u.aa.fromPoints(t),b={};for(let C=0;C<=u.ab;C++){const z=Math.pow(2,C),O=Math.floor(a*z),U=Math.floor(c*z),H=Math.floor(f*z),q=Math.floor(v*z),Q=(O%z+z)%z,re=H%z,de=Math.floor(O/z),pe=Math.floor(H/z);b[C]={minWrap:de,maxWrap:pe,minTileXWrapped:Q,maxTileXWrapped:re,minTileY:U,maxTileY:q}}return b}}class Ha extends Sa{constructor(t,a,c,f){super(t,a,c,f),this.roundZoom=!0,this.type="video",this.options=a}load(){return u._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const a of t.urls)this.urls.push(this.map._requestManager.transformRequest(a,"Source").url);try{const a=yield u.ad(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new u.k(a))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const a=this.video.seekable;t<a.start(0)||t>a.end(0)?this.fire(new u.k(new u.ae(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,a=t.gl;this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new u.T(t,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let c=!1;for(const f in this.tiles){const v=this.tiles[f];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,c=!0)}c&&this.fire(new u.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class $o extends Sa{constructor(t,a,c,f){super(t,a,c,f),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some((v=>!Array.isArray(v)||v.length!==2||v.some((b=>typeof b!="number"))))||this.fire(new u.k(new u.ae(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.k(new u.ae(`sources.${t}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new u.k(new u.ae(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new u.k(new u.ae(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new u.k(new u.ae(`sources.${t}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return u._(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 u.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const a=this.map.painter.context,c=a.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new u.T(a,this.canvas,c.RGBA,{premultiply:!0}),this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE));let f=!1;for(const v in this.tiles){const b=this.tiles[v];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,f=!0)}f&&this.fire(new u.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const ms={},Al=g=>{switch(g){case"geojson":return pr;case"image":return Sa;case"raster":return js;case"raster-dem":return ia;case"vector":return mo;case"video":return Ha;case"canvas":return $o}return ms[g]},Be="RTLPluginLoaded";class ee extends u.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Ur()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((a=>{throw this.status="error",a}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return u._(this,arguments,void 0,(function*(a,c=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Se.resolveURL(a),!this.url)throw new Error(`requested url ${a}
23 is invalid`);if(this.status==="unavailable"){if(!c)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return u._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new u.l(Be))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let ie=null;function ae(){return ie||(ie=new ee),ie}var be,Pe;(function(g){g[g.Base=0]="Base",g[g.Parent=1]="Parent"})(be||(be={})),(function(g){g[g.Departing=0]="Departing",g[g.Incoming=1]="Incoming"})(Pe||(Pe={}));class Fe{constructor(t,a){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=u.af(),this.uses=0,this.tileSize=a,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"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:a,fadingParentID:c,fadeEndTime:f}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=a,this.fadingParentID=c,this.fadeEndTime=f}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Te(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,a,c){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=(function(f,v){const b={};if(!v)return b;for(const C of f){const z=C.layerIds.map((O=>v.getLayer(O))).filter(Boolean);if(z.length!==0){C.layers=z,C.stateDependentLayerIds&&(C.stateDependentLayers=C.stateDependentLayerIds.map((O=>z.filter((U=>U.id===O))[0])));for(const O of z)b[O.id]=C}}return b})(t.buckets,a?.style),this.hasSymbolBuckets=!1;for(const f in this.buckets){const v=this.buckets[f];if(v instanceof u.ah){if(this.hasSymbolBuckets=!0,!c)break;v.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const f in this.buckets){const v=this.buckets[f];if(v instanceof u.ah&&v.hasRTLText){this.hasRTLText=!0,ae().lazyLoad();break}}this.queryPadding=0;for(const f in this.buckets){const v=this.buckets[f];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(f).queryRadius(v))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new u.ag}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const c in this.buckets){const f=this.buckets[c];f.uploadPending()&&f.upload(t)}const a=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u.T(t,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u.T(t,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,a,c,f,v,b,C,z,O,U,H){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:f,cameraQueryGeometry:v,scale:b,tileSize:this.tileSize,pixelPosMatrix:U,transform:z,params:C,queryPadding:this.queryPadding*O,getElevation:H},t,a,c):{}}querySourceFeatures(t,a){const c=this.latestFeatureIndex;if(!c||!c.rawTileData)return;const f=c.loadVTLayers(),v=a&&a.sourceLayer?a.sourceLayer:"",b=f[u.ai]||f[v];if(!b)return;const C=u.aj(a?.filter,a?.globalState),{z,x:O,y:U}=this.tileID.canonical,H={z,x:O,y:U};for(let q=0;q<b.length;q++){const Q=b.feature(q);if(C.needGeometry){const pe=u.ak(Q,!0);
vendor: 6,401 bytes, line 23
23if(!C.filter(new u.H(this.tileID.overscaledZ),pe,this.tileID.canonical))continue}else if(!C.filter(new u.H(this.tileID.overscaledZ),Q))continue;const re=c.getId(Q,v),de=new u.al(Q,z,O,U,re);de.tile=H,t.push(de)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const a=this.expirationTime;if(t.cacheControl){const c=u.am(t.cacheControl);c["max-age"]&&(this.expirationTime=Date.now()+1e3*c["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const c=Date.now();let f=!1;if(this.expirationTime>c)f=!1;else if(a)if(this.expirationTime<a)f=!0;else{const v=this.expirationTime-a;v?this.expirationTime=c+Math.max(v,3e4):f=!0}else f=!0;f?(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(t,a){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const c=this.latestFeatureIndex.loadVTLayers();for(const f in this.buckets){if(!a.style.hasLayer(f))continue;const v=this.buckets[f],b=v.layers[0].sourceLayer||u.ai,C=c[b],z=t[b];if(!C||!z||Object.keys(z).length===0)continue;v.update(z,C,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});const O=a&&a.style&&a.style.getLayer(f);O&&(this.queryPadding=Math.max(this.queryPadding,O.queryRadius(v)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Te()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=Te()+t}setDependencies(t,a){const c={};for(const f of a)c[f]=!0;this.dependencies[t]=c}hasDependency(t,a){for(const c of t){const f=this.dependencies[c];if(f){for(const v of a)if(f[v])return!0}}return!1}}class Ue{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,a,c){const f=String(a);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][f]=this.stateChanges[t][f]||{},u.e(this.stateChanges[t][f],c),this.deletedStates[t]===null){this.deletedStates[t]={};for(const v in this.state[t])v!==f&&(this.deletedStates[t][v]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][f]===null){this.deletedStates[t][f]={};for(const v in this.state[t][f])c[v]||(this.deletedStates[t][f][v]=null)}else for(const v in c)this.deletedStates[t]&&this.deletedStates[t][f]&&this.deletedStates[t][f][v]===null&&delete this.deletedStates[t][f][v]}removeFeatureState(t,a,c){if(this.deletedStates[t]===null)return;const f=String(a);if(this.deletedStates[t]=this.deletedStates[t]||{},c&&a!==void 0)this.deletedStates[t][f]!==null&&(this.deletedStates[t][f]=this.deletedStates[t][f]||{},this.deletedStates[t][f][c]=null);else if(a!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][f])for(c in this.deletedStates[t][f]={},this.stateChanges[t][f])this.deletedStates[t][f][c]=null;else this.deletedStates[t][f]=null;else this.deletedStates[t]=null}getState(t,a){const c=String(a),f=u.e({},(this.state[t]||{})[c],(this.stateChanges[t]||{})[c]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const v=this.deletedStates[t][a];if(v===null)return{};for(const b in v)delete f[b]}return f}initializeTileState(t,a){t.setFeatureState(this.state,a)}coalesceChanges(t,a){const c={};for(const f in this.stateChanges){this.state[f]=this.state[f]||{};const v={};for(const b in this.stateChanges[f])this.state[f][b]||(this.state[f][b]={}),u.e(this.state[f][b],this.stateChanges[f][b]),v[b]=this.state[f][b];c[f]=v}for(const f in this.deletedStates){this.state[f]=this.state[f]||{};const v={};if(this.deletedStates[f]===null)for(const b in this.state[f])v[b]={},this.state[f][b]={};else for(const b in this.deletedStates[f]){if(this.deletedStates[f][b]===null)this.state[f][b]={};else for(const C of Object.keys(this.deletedStates[f][b]))delete this.state[f][b][C];v[b]=this.state[f][b]}c[f]=c[f]||{},u.e(c[f],v)}this.stateChanges={},this.deletedStates={},Object.keys(c).length!==0&&t.setFeatureState(c,a)}}const Ne=89.25;function Ze(g,t){const a=u.an(t.lat,-u.ao,u.ao);return new u.P(u.Y(t.lng)*g,u.X(a)*g)}function ct(g,t){return new u.a9(t.x/g,t.y/g).toLngLat()}function it(g){return g.cameraToCenterDistance*Math.min(.85*Math.tan(u.ap(90-g.pitch)),Math.tan(u.ap(Ne-g.pitch)))}function yt(g,t){const a=g.canonical,c=t/u.aq(a.z),f=a.x+Math.pow(2,a.z)*g.wrap,v=u.ar(new Float64Array(16));return u.O(v,v,[f*c,a.y*c,0]),u.Q(v,v,[c/u.a5,c/u.a5,1]),v}function ke(g,t,a,c,f){const v=u.a9.fromLngLat(g,t),b=f*u.as(1,g.lat),{x:C,y:z,z:O}=oi(a,c);return new u.a9(v.x+b*-C,v.y+b*-z,v.z+b*-O)}function oi(g,t){const a=u.ap(g),c=u.ap(t),f=Math.cos(-a),v=Math.sin(a);return{x:v*Math.sin(c),y:-v*Math.cos(c),z:f}}function Hi(g,t,a){const c=t.intersectsFrustum(g);if(!a||c===0)return c;const f=t.intersectsPlane(a);return f===0?0:c===2&&f===2?2:1}function Gt(g,t,a){let c=0;const f=(a-t)/10;for(let v=0;v<10;v++)c+=f*Math.pow(Math.cos(t+(v+.5)/10*(a-t)),g);return c}function Wt(g,t){return function(a,c,f,v,b){const C=2*((g-1)/u.at(Math.cos(u.ap(Ne-b))/Math.cos(u.ap(Ne)))-1),z=Math.acos(f/v),O=2*Gt(C-1,0,u.ap(b/2)),U=Math.min(u.ap(Ne),z+u.ap(b/2)),H=Gt(C-1,Math.min(U,z-u.ap(b/2)),U),q=Math.atan(c/f),Q=Math.hypot(c,f);let re=a;return re+=u.at(v/Q/Math.max(.5,Math.cos(u.ap(b/2)))),re+=C*u.at(Math.cos(q))/2,re-=u.at(Math.max(1,H/O/t))/2,re}}const yi=Wt(9.314,3);function rn(g,t){const a=(t.roundZoom?Math.round:Math.floor)(g.zoom+u.at(g.tileSize/t.tileSize));return Math.max(0,a)}function dn(g,t){const a=g.getCameraFrustum(),c=g.getClippingPlane(),f=g.screenPointToMercatorCoordinate(g.getCameraPoint()),v=u.a9.fromLngLat(g.center,g.elevation);f.z=v.z+Math.cos(g.pitchInRadians)*g.cameraToCenterDistance/g.worldSize;const b=g.getCoveringTilesDetailsProvider(),C=b.allowVariableZoom(g,t),z=rn(g,t),O=t.minzoom||0,U=t.maxzoom!==void 0?t.maxzoom:g.maxZoom,H=Math.min(Math.max(0,z),U),q=Math.pow(2,H),Q=[q*f.x,q*f.y,0],re=[q*v.x,q*v.y,0],de=Math.hypot(v.x-f.x,v.y-f.y),pe=Math.abs(v.z-f.z),fe=Math.hypot(de,pe),_e=Ce=>({zoom:0,x:0,y:0,wrap:Ce,fullyVisible:!1}),Me=[],me=[];
23if(g.renderWorldCopies&&b.allowWorldCopies())for(let Ce=1;Ce<=3;Ce++)Me.push(_e(-Ce)),Me.push(_e(Ce));for(Me.push(_e(0));Me.length>0;){const Ce=Me.pop(),Le=Ce.x,we=Ce.y;let Re=Ce.fullyVisible;const Ye={x:Le,y:we,z:Ce.zoom},qe=b.getTileBoundingVolume(Ye,Ce.wrap,g.elevation,t);if(!Re){const At=Hi(a,qe,c);if(At===0)continue;Re=At===2}const $e=b.distanceToTile2d(f.x,f.y,Ye,qe);let Xe=z;C&&(Xe=(t.calculateTileZoom||yi)(g.zoom+u.at(g.tileSize/t.tileSize),$e,pe,fe,g.fov)),Xe=(t.roundZoom?Math.round:Math.floor)(Xe),Xe=Math.max(0,Xe);const Mt=Math.min(Xe,U);if(Ce.wrap=b.getWrap(v,Ye,Ce.wrap),Ce.zoom>=Mt){if(Ce.zoom<O)continue;const At=H-Ce.zoom,pt=Q[0]-.5-(Le<<At),Lt=Q[1]-.5-(we<<At),_i=t.reparseOverscaled?Math.max(Ce.zoom,Xe):Ce.zoom;me.push({tileID:new u.a2(Ce.zoom===U?_i:Ce.zoom,Ce.wrap,Ce.zoom,Le,we),distanceSq:u.au([re[0]-.5-Le,re[1]-.5-we]),tileDistanceToCamera:Math.sqrt(pt*pt+Lt*Lt)})}else for(let At=0;At<4;At++)Me.push({zoom:Ce.zoom+1,x:(Le<<1)+At%2,y:(we<<1)+(At>>1),wrap:Ce.wrap,fullyVisible:Re})}return me.sort(((Ce,Le)=>Ce.distanceSq-Le.distanceSq)).map((Ce=>Ce.tileID))}const tr=u.aa.fromPoints([new u.P(0,0),new u.P(u.a5,u.a5)]);function ir(g){return g==="raster"||g==="image"||g==="video"}function An(g,t,a,c,f,v,b){if(!t.hasData())return!1;const{tileID:C,fadingRole:z,fadingDirection:O,fadingParentID:U}=t;if(z===be.Base&&O===Pe.Incoming&&U)return a[U.key]=U,!0;const H=Math.max(C.overscaledZ-f,v);for(let q=C.overscaledZ-1;q>=H;q--){const Q=C.scaledTo(q),re=g.getLoadedTile(Q);if(re)return t.setCrossFadeLogic({fadingRole:be.Base,fadingDirection:Pe.Incoming,fadingParentID:re.tileID,fadeEndTime:c+b}),re.setCrossFadeLogic({fadingRole:be.Parent,fadingDirection:Pe.Departing,fadeEndTime:c+b}),a[Q.key]=Q,!0}return!1}function Qi(g,t,a,c,f,v){if(!t.hasData())return!1;const b=t.tileID.children(f);let C=Ve(g,t,b,a,c,f,v);if(C)return!0;for(const z of b)Ve(g,t,z.children(f),a,c,f,v)&&(C=!0);return C}function Ve(g,t,a,c,f,v,b){if(a[0].overscaledZ>=v)return!1;let C=!1;for(const z of a){const O=g.getLoadedTile(z);if(!O)continue;const{fadingRole:U,fadingDirection:H,fadingParentID:q}=O;U===be.Base&&H===Pe.Departing&&q||(O.setCrossFadeLogic({fadingRole:be.Base,fadingDirection:Pe.Departing,fadingParentID:t.tileID,fadeEndTime:f+b}),t.setCrossFadeLogic({fadingRole:be.Parent,fadingDirection:Pe.Incoming,fadeEndTime:f+b})),c[z.key]=z,C=!0}return C}function kn(g,t,a,c){const f=g.tileID;return!!g.selfFading||!g.hasData()&&!!t.has(f)&&(g.setSelfFadeLogic(a+c),!0)}function Pr(g,t){var a;g.needsHillshadePrepare=!0,g.needsTerrainPrepare=!0;let c=t.tileID.canonical.x-g.tileID.canonical.x;const f=t.tileID.canonical.y-g.tileID.canonical.y,v=Math.pow(2,g.tileID.canonical.z),b=t.tileID.key;c===0&&f===0||Math.abs(f)>1||(Math.abs(c)>1&&(Math.abs(c+v)===1?c+=v:Math.abs(c-v)===1&&(c-=v)),t.dem&&g.dem&&(g.dem.backfillBorder(t.dem,c,f),!((a=g.neighboringTiles)===null||a===void 0)&&a[b]&&(g.neighboringTiles[b].backfilled=!0)))}class Zr{constructor(){this._tiles={}}handleWrapJump(t){const a={};for(const c in this._tiles){const f=this._tiles[c];f.tileID=f.tileID.unwrapTo(f.tileID.wrap+t),a[f.tileID.key]=f}this._tiles=a}setFeatureState(t,a){for(const c in this._tiles)this._tiles[c].setFeatureState(t,a)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map((a=>a.tileID)).sort(u.aw).map((a=>a.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,a){this._tiles[t]=a}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){const a=this.getTileById(t.key);return a?.hasData()?a:null}isIdRenderable(t,a=!1){var c;return(c=this.getTileById(t))===null||c===void 0?void 0:c.isRenderable(a)}getRenderableIds(t=0,a){const c=[];for(const f of this.getAllIds())this.isIdRenderable(f,a)&&c.push(this.getTileById(f));return a?c.sort(((f,v)=>{const b=f.tileID,C=v.tileID,z=new u.P(b.canonical.x,b.canonical.y)._rotate(-t),O=new u.P(C.canonical.x,C.canonical.y)._rotate(-t);return b.overscaledZ-C.overscaledZ||O.y-z.y||O.x-z.x})).map((f=>f.tileID.key)):c.map((f=>f.tileID)).sort(u.aw).map((f=>f.key))}}
23class Pi extends u.E{constructor(t,a,c){super(),this.id=t,this.dispatcher=c,this.on("data",(f=>this._dataHandler(f))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((f,v,b,C)=>{const z=new(Al(v.type))(f,v,b,C);if(z.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${z.id}`);return z})(t,a,c,this),this._inViewTiles=new Zr,this._outOfViewCache=new u.ax(0,(f=>this._unloadTile(f))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new Ue,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){for(const a of this._inViewTiles.getAllTiles())a.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t),this._inViewTiles=new Zr}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 t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,a,c){return u._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,a,c)}catch(f){t.state="errored",f.status!==404?this._source.fire(new u.k(f,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new u.l("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(const a of this._inViewTiles.getAllTiles())a.upload(t),a.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var a;return this._inViewTiles.getRenderableIds((a=this.transform)===null||a===void 0?void 0:a.bearingInRadians,t)}hasRenderableParent(t){const a=t.overscaledZ-1;if(a>=this._source.minzoom){const c=this.getLoadedTile(t.scaledTo(a));if(c)return this._inViewTiles.isIdRenderable(c.tileID.key)}return!1}reload(t,a=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(const c of this._inViewTiles.getAllIds()){const f=this._inViewTiles.getTileById(c);a&&!this._source.shouldReloadTile(f,a)||(t?this._reloadTile(c,"expired"):f.state!=="errored"&&this._reloadTile(c,"reloading"))}}}_reloadTile(t,a){return u._(this,void 0,void 0,(function*(){const c=this._inViewTiles.getTileById(t);c&&(c.state!=="loading"&&(c.state=a),yield this._loadTile(c,t,a))}))}_tileLoaded(t,a,c){t.timeAdded=Te(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),c==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(a,t),this.getSource().type==="raster-dem"&&t.dem&&(function(f,v){var b,C;const z=v.getRenderableIds();for(const O of z){if(!f.neighboringTiles||!f.neighboringTiles[O])continue;const U=v.getTileById(O);f.neighboringTiles[O].backfilled||Pr(f,U),!((C=(b=U.neighboringTiles)===null||b===void 0?void 0:b[f.tileID.key])===null||C===void 0)&&C.backfilled||Pr(U,f)}})(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new u.l("data",{dataType:"source",tile:t,coord:t.tileID}))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,a){const c=this._getLoadedDescendents(a),f=new Set;for(const v of a){const b=c[v.key];if(!b?.length){f.add(v);continue}const C=v.overscaledZ+Pi.maxOverzooming,z=b.filter((H=>H.tileID.overscaledZ<=C));if(!z.length){f.add(v);continue}const O=Math.min(...z.map((H=>
23H.tileID.overscaledZ))),U=z.filter((H=>H.tileID.overscaledZ===O)).map((H=>H.tileID));for(const H of U)t[H.key]=H;this._areDescendentsComplete(U,O,v.overscaledZ)||f.add(v)}return f}_getLoadedDescendents(t){var a;const c={};for(const f of this._inViewTiles.getAllTiles().filter((v=>v.hasData())))for(const v of t)f.tileID.isChildOf(v)&&(c[a=v.key]||(c[a]=[])).push(f);return c}_areDescendentsComplete(t,a,c){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===a:Math.pow(4,a-c)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){const a=Math.ceil(t.width/this._source.tileSize)+1,c=Math.ceil(t.height/this._source.tileSize)+1,f=Math.floor(a*c*(this._maxTileCacheZoomLevels===null?u.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),v=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._outOfViewCache.setMaxSize(v)}handleWrapJump(t){const a=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);this._prevLng=t,a&&(this._inViewTiles.handleWrapJump(a),this._resetTileReloadTimers())}update(t,a){if(!this._sourceLoaded||this._paused)return;let c;this.transform=t,this.terrain=a,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?c=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((z=>new u.a2(z.canonical.z,z.wrap,z.canonical.z,z.canonical.x,z.canonical.y))):(c=dn(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:a,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(c=c.filter((z=>this._source.hasTile(z))))):c=[],this.usedForTerrain&&(c=this._addTerrainIdealTiles(c));const f=c.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,f&&this.fire(new u.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const v=rn(t,this._source),b=this._updateRetainedTiles(c,v),C=ir(this._source.type);C&&this._rasterFadeDuration>0&&!a&&(function(z,O,U,H,q,Q,re){const de=Te(),pe=u.av(O);for(const fe of O){const _e=z.getTileById(fe.key);_e.fadingDirection!==Pe.Departing&&_e.fadeOpacity!==0||_e.resetFadeLogic(),An(z,_e,U,de,H,q,re)||Qi(z,_e,U,de,Q,re)||kn(_e,pe,de,re)||_e.resetFadeLogic()}})(this._inViewTiles,c,b,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),C?this._cleanUpRasterTiles(b):this._cleanUpVectorTiles(b)}_cleanUpRasterTiles(t){for(const a of this._inViewTiles.getAllIds())t[a]||this._removeTile(a)}_cleanUpVectorTiles(t){for(const a of this._inViewTiles.getAllIds()){const c=this._inViewTiles.getTileById(a);t[a]?c.clearSymbolFadeHold():c.hasSymbolBuckets?c.holdingForSymbolFade()?c.symbolFadeFinished()&&this._removeTile(a):c.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(a)}}_addTerrainIdealTiles(t){const a=[];for(const c of t)if(c.canonical.z>this._source.minzoom){const f=c.scaledTo(c.canonical.z-1);a.push(f);const v=c.scaledTo(Math.max(this._source.minzoom,Math.min(c.canonical.z,5)));a.push(v)}return t.concat(a)}releaseSymbolFadeTiles(){for(const t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,a){var c;const f=new Set;for(const O of t)this._addTile(O).hasData()||f.add(O);const v=t.reduce(((O,U)=>(O[U.key]=U,O)),{}),b=this._retainLoadedChildren(v,f),C={},z=Math.max(a-Pi.maxUnderzooming,this._source.minzoom);for(const O of b){let U=this._inViewTiles.getTileById(O.key),H=U?.wasRequested();for(let q=O.overscaledZ-1;q>=z;--q){const Q=O.scaledTo(q);if(C[Q.key])break;if(C[Q.key]=!0,U=this.getTile(Q),!U&&H&&(U=this._addTile(Q)),U){const re=U.hasData();if((re||!(!((c=this.map)===null||c===void 0)&&c.cancelPendingTileRequestsWhileZooming)||H)&&(v[Q.key]=Q),H=U.wasRequested(),re)break}}}return v}_addTile(t){let a=this._inViewTiles.getTileById(t.key);if(a)return a;a=this._outOfViewCache.getAndRemove(t),a&&(a.resetFadeLogic(),this._setTileReloadTimer(t.key,a),a.tileID=t,this._state.initializeTileState(a,this.map?this.map.painter:null));const c=a;return a||(a=new Fe(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(a,t.key,a.state)),a.uses++,this._inViewTiles.setTile(t.key,a),c||this._source.fire(new u.l("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(t,a){this._clearTileReloadTimer(t);const c=a.getExpiryTimeout();c&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),c))}_clearTileReloadTimer(t){const a=this._timers[t];a&&(clearTimeout(a),delete this._timers[t])}_resetTileReloadTimers(){for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t of this._inViewTiles.getAllIds()){const a=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,a)}}refreshTiles(t){for(const a of this._inViewTiles.getAllIds()){const c=this._inViewTiles.getTileById(a);(this._inViewTiles.isIdRenderable(a)||c.state=="errored")&&t.some((f=>f.equals(c.tileID.canonical)))&&this._reloadTile(a,"expired")}}_removeTile(t){const a=this._inViewTiles.getTileById(t);a&&(a.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._outOfViewCache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(t){t.dataType==="source"&&(t.sourceDataType!=="metadata"?t.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,a,c){const f=[],v=this.transform;if(!v)return f;const b=v.getCoveringTilesDetailsProvider().allowWorldCopies(),C=c?v.getCameraQueryGeometry(t):t,z=Q=>v.screenPointToMercatorCoordinate(Q,this.terrain),O=this.transformBbox(t,z,!b),U=this.transformBbox(C,z,!b),H=this.getIds(),q=u.aa.fromPoints(U);for(let Q=0;Q<H.length;Q++){const re=this._inViewTiles.getTileById(H[Q]);if(re.holdingForSymbolFade())continue;const de=b?[re.tileID]:[re.tileID.unwrapTo(-1),re.tileID.unwrapTo(0)],pe=Math.pow(2,v.zoom-re.tileID.overscaledZ
23),fe=a*re.queryPadding*u.a5/re.tileSize/pe;for(const _e of de){const Me=q.map((me=>_e.getTilePoint(new u.a9(me.x,me.y))));if(Me.expandBy(fe),Me.intersects(tr)){const me=O.map((Le=>_e.getTilePoint(Le))),Ce=U.map((Le=>_e.getTilePoint(Le)));f.push({tile:re,tileID:b?_e:_e.unwrapTo(0),queryGeometry:me,cameraQueryGeometry:Ce,scale:pe})}}}return f}transformBbox(t,a,c){let f=t.map(a);if(c){const v=u.aa.fromPoints(t);v.shrinkBy(.001*Math.min(v.width(),v.height()));const b=v.map(a);u.aa.fromPoints(f).covers(b)||(f=f.map((C=>C.x>.5?new u.a9(C.x-1,C.y,C.z):C)))}return f}getVisibleCoordinates(t){const a=this.getRenderableIds(t).map((c=>this._inViewTiles.getTileById(c).tileID));return this.transform&&this.transform.populateCache(a),a}hasTransition(){return!!this._source.hasTransition()||!(!ir(this._source.type)||!(function(t,a){if(a<=0)return!1;const c=Te();for(const f of t.getAllTiles())if(f.fadeEndTime>=c)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,a,c){this._state.updateState(t=t||u.ai,a,c)}removeFeatureState(t,a,c){this._state.removeFeatureState(t=t||u.ai,a,c)}getFeatureState(t,a){return this._state.getState(t=t||u.ai,a)}setDependencies(t,a,c){const f=this._inViewTiles.getTileById(t);f&&f.setDependencies(a,c)}reloadTilesForDependencies(t,a){for(const c of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(c).hasDependency(t,a)&&this._reloadTile(c,"reloading");this._outOfViewCache.filter((c=>!c.hasDependency(t,a)))}areTilesLoaded(){for(const t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}Pi.maxUnderzooming=10,Pi.maxOverzooming=3;class bt{constructor(t,a){this.reset(t,a)}reset(t,a){this.points=t||[],this._distances=[0];for(let c=1;c<this.points.length;c++)this._distances[c]=this._distances[c-1]+this.points[c].dist(this.points[c-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(a||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=u.an(t,0,1);let a=1,c=this._distances[a];const f=t*this.paddedLength+this.padding;for(;c<f&&a<this._distances.length;)c=this._distances[++a];const v=a-1,b=this._distances[v],C=c-b,z=C>0?(f-b)/C:0;return this.points[v].mult(1-z).add(this.points[a].mult(z))}}function li(g,t){let a=!0;return g==="always"||g!=="never"&&t!=="never"||(a=!1),a}class hi{constructor(t,a,c){const f=this.boxCells=[],v=this.circleCells=[];this.xCellCount=Math.ceil(t/c),this.yCellCount=Math.ceil(a/c);for(let b=0;b<this.xCellCount*this.yCellCount;b++)f.push([]),v.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=a,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,a,c,f,v){this._forEachCell(a,c,f,v,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(a),this.bboxes.push(c),this.bboxes.push(f),this.bboxes.push(v)}insertCircle(t,a,c,f){this._forEachCell(a-f,c-f,a+f,c+f,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(a),this.circles.push(c),this.circles.push(f)}_insertBoxCell(t,a,c,f,v,b){this.boxCells[v].push(b)}_insertCircleCell(t,a,c,f,v,b){this.circleCells[v].push(b)}_query(t,a,c,f,v,b,C){if(c<0||t>this.width||f<0||a>this.height)return[];const z=[];if(t<=0&&a<=0&&this.width<=c&&this.height<=f){if(v)return[{key:null,x1:t,y1:a,x2:c,y2:f}];for(let O=0;O<this.boxKeys.length;O++)z.push({key:this.boxKeys[O],x1:this.bboxes[4*O],y1:this.bboxes[4*O+1],x2:this.bboxes[4*O+2],y2:this.bboxes[4*O+3]});for(let O=0;O<this.circleKeys.length;O++){const U=this.circles[3*O],H=this.circles[3*O+1],q=this.circles[3*O+2];z.push({key:this.circleKeys[O],x1:U-q,y1:H-q,x2:U+q,y2:H+q})}}else this._forEachCell(t,a,c,f,this._queryCell,z,{hitTest:v,overlapMode:b,seenUids:{box:{},circle:{}}},C);return z}query(t,a,c,f){return this._query(t,a,c,f,!1,null)}hitTest(t,a,c,f,v,b){return this._query(t,a,c,f,!0,v,b).length>0}hitTestCircle(t,a,c,f,v){const b=t-c,C=t+c,z=a-c,O=a+c;if(C<0||b>this.width||O<0||z>this.height)return!1;const U=[];
vendor: 4,512 bytes, line 23
23return this._forEachCell(b,z,C,O,this._queryCellCircle,U,{hitTest:!0,overlapMode:f,circle:{x:t,y:a,radius:c},seenUids:{box:{},circle:{}}},v),U.length>0}_queryCell(t,a,c,f,v,b,C,z){const{seenUids:O,hitTest:U,overlapMode:H}=C,q=this.boxCells[v];if(q!==null){const re=this.bboxes;for(const de of q)if(!O.box[de]){O.box[de]=!0;const pe=4*de,fe=this.boxKeys[de];if(t<=re[pe+2]&&a<=re[pe+3]&&c>=re[pe+0]&&f>=re[pe+1]&&(!z||z(fe))&&(!U||!li(H,fe.overlapMode))&&(b.push({key:fe,x1:re[pe],y1:re[pe+1],x2:re[pe+2],y2:re[pe+3]}),U))return!0}}const Q=this.circleCells[v];if(Q!==null){const re=this.circles;for(const de of Q)if(!O.circle[de]){O.circle[de]=!0;const pe=3*de,fe=this.circleKeys[de];if(this._circleAndRectCollide(re[pe],re[pe+1],re[pe+2],t,a,c,f)&&(!z||z(fe))&&(!U||!li(H,fe.overlapMode))){const _e=re[pe],Me=re[pe+1],me=re[pe+2];if(b.push({key:fe,x1:_e-me,y1:Me-me,x2:_e+me,y2:Me+me}),U)return!0}}}return!1}_queryCellCircle(t,a,c,f,v,b,C,z){const{circle:O,seenUids:U,overlapMode:H}=C,q=this.boxCells[v];if(q!==null){const re=this.bboxes;for(const de of q)if(!U.box[de]){U.box[de]=!0;const pe=4*de,fe=this.boxKeys[de];if(this._circleAndRectCollide(O.x,O.y,O.radius,re[pe+0],re[pe+1],re[pe+2],re[pe+3])&&(!z||z(fe))&&!li(H,fe.overlapMode))return b.push(!0),!0}}const Q=this.circleCells[v];if(Q!==null){const re=this.circles;for(const de of Q)if(!U.circle[de]){U.circle[de]=!0;const pe=3*de,fe=this.circleKeys[de];if(this._circlesCollide(re[pe],re[pe+1],re[pe+2],O.x,O.y,O.radius)&&(!z||z(fe))&&!li(H,fe.overlapMode))return b.push(!0),!0}}}_forEachCell(t,a,c,f,v,b,C,z){const O=this._convertToXCellCoord(t),U=this._convertToYCellCoord(a),H=this._convertToXCellCoord(c),q=this._convertToYCellCoord(f);for(let Q=O;Q<=H;Q++)for(let re=U;re<=q;re++)if(v.call(this,t,a,c,f,this.xCellCount*re+Q,b,C,z))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,a,c,f,v,b){const C=f-t,z=v-a,O=c+b;return O*O>C*C+z*z}_circleAndRectCollide(t,a,c,f,v,b,C){const z=(b-f)/2,O=Math.abs(t-(f+z));if(O>z+c)return!1;const U=(C-v)/2,H=Math.abs(a-(v+U));if(H>U+c)return!1;if(O<=z||H<=U)return!0;const q=O-z,Q=H-U;return q*q+Q*Q<=c*c}}function na(g,t,a){const c=u.N();if(!g){const{vecSouth:H,vecEast:q}=gs(t),Q=X();Q[0]=q[0],Q[1]=q[1],Q[2]=H[0],Q[3]=H[1],f=Q,(U=(b=(v=Q)[0])*(O=v[3])-(z=v[2])*(C=v[1]))&&(f[0]=O*(U=1/U),f[1]=-C*U,f[2]=-z*U,f[3]=b*U),c[0]=Q[0],c[1]=Q[1],c[4]=Q[2],c[5]=Q[3]}var f,v,b,C,z,O,U;return u.Q(c,c,[1/a,1/a,1]),c}function Nu(g,t,a,c){if(g){const f=u.N();if(!t){const{vecSouth:v,vecEast:b}=gs(a);f[0]=b[0],f[1]=b[1],f[4]=v[0],f[5]=v[1]}return u.Q(f,f,[c,c,1]),f}return a.pixelsToClipSpaceMatrix}function gs(g){const t=Math.cos(g.rollInRadians),a=Math.sin(g.rollInRadians),c=Math.cos(g.pitchInRadians),f=Math.cos(g.bearingInRadians),v=Math.sin(g.bearingInRadians),b=u.aC();b[0]=-f*c*a-v*t,b[1]=-v*c*a+f*t;const C=u.aD(b);C<1e-9?u.aE(b):u.aF(b,b,1/C);const z=u.aC();z[0]=f*c*t-v*a,z[1]=v*c*t+f*a;const O=u.aD(z);return O<1e-9?u.aE(z):u.aF(z,z,1/O),{vecEast:z,vecSouth:b}}function fi(g,t,a,c){let f;c?(f=[g,t,c(g,t),1],u.aH(f,f,a)):(f=[g,t,0,1],qr(f,f,a));const v=f[3];return{point:new u.P(f[0]/v,f[1]/v),signedDistanceFromCamera:v,isOccluded:!1}}function Xo(g,t){return .5+g/t*.5}function $a(g,t){return g.x>=-t[0]&&g.x<=t[0]&&g.y>=-t[1]&&g.y<=t[1]}function Us(g,t,a,c,f,v,b,C,z,O,U,H,q){const Q=a?g.textSizeData:g.iconSizeData,re=u.ay(Q,t.transform.zoom),de=[256/t.width*2+1,256/t.height*2+1],pe=a?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;pe.clear();const fe=g.lineVertexArray,_e=a?g.text.placedSymbolArray:g.icon.placedSymbolArray,Me=t.transform.width/t.transform.height;let me=!1;for(let Ce=0;Ce<_e.length;Ce++){const Le=_e.get(Ce);if(Le.hidden||Le.writingMode===u.az.vertical&&!me){$i(Le.numGlyphs,pe);continue}me=!1;const we=new u.P(Le.anchorX,Le.anchorY),Re={getElevation:q,pitchedLabelPlaneMatrix:c,lineVertexArray:fe,pitchWithMap:v,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:we,unwrappedTileID:z,width:O,height:U,translation:H},Ye=ys(Le.anchorX,Le.anchorY,Re);if(!$a(Ye.point,de)){$i(Le.numGlyphs,pe);continue}const qe=Xo(t.transform.cameraToCenterDistance,Ye.signedDistanceFromCamera),$e=u.aA(Q,re,Le),Xe=v?$e*t.transform.getPitchedTextCorrection(Le.anchorX,Le.anchorY,z)/qe:$e*qe,Mt=Rn({projectionContext:Re,pitchedLabelPlaneMatr
vendor: 1,426 bytes, line 23
23ixInverse:f,symbol:Le,fontSize:Xe,flip:!1,keepUpright:b,glyphOffsetArray:g.glyphOffsetArray,dynamicLayoutVertexArray:pe,aspectRatio:Me,rotateToLine:C});me=Mt.useVertical,(Mt.notEnoughRoom||me||Mt.needsFlipping&&Rn({projectionContext:Re,pitchedLabelPlaneMatrixInverse:f,symbol:Le,fontSize:Xe,flip:!0,keepUpright:b,glyphOffsetArray:g.glyphOffsetArray,dynamicLayoutVertexArray:pe,aspectRatio:Me,rotateToLine:C}).notEnoughRoom)&&$i(Le.numGlyphs,pe)}a?g.text.dynamicLayoutVertexBuffer.updateData(pe):g.icon.dynamicLayoutVertexBuffer.updateData(pe)}function Ca(g,t,a,c,f,v,b,C){const z=v.glyphStartIndex+v.numGlyphs,O=v.lineStartIndex,U=v.lineStartIndex+v.lineLength,H=t.getoffsetX(v.glyphStartIndex),q=t.getoffsetX(z-1),Q=Gr(g*H,a,c,f,v.segment,O,U,C,b);if(!Q)return null;const re=Gr(g*q,a,c,f,v.segment,O,U,C,b);return re?C.projectionCache.anyProjectionOccluded?null:{first:Q,last:re}:null}function _s(g,t,a,c){return g===u.az.horizontal&&Math.abs(a.y-t.y)>Math.abs(a.x-t.x)*c?{useVertical:!0}:(g===u.az.vertical?t.y<a.y:t.x>a.x)?{needsFlipping:!0}:null}function Rn(g){const{projectionContext:t,pitchedLabelPlaneMatrixInverse:a,symbol:c,fontSize:f,flip:v,keepUpright:b,glyphOffsetArray:C,dynamicLayoutVertexArray:z,aspectRatio:O,rotateToLine:U}=g,H=f/24,q=c.lineOffsetX*H,Q=c.lineOffsetY*H;let re;if(c.numGlyphs>1){const de=c.glyphStartIndex+c.numGlyphs,pe=c.lineStartIndex,fe=c.lineStartIndex+c.lineLength,_e=Ca(H,C,q,Q,v,c,U,t);
vendor: 35,538 bytes, lines 23-50
23if(!_e)return{notEnoughRoom:!0};const Me=Xa(_e.first.point.x,_e.first.point.y,t,a),me=Xa(_e.last.point.x,_e.last.point.y,t,a);if(b&&!v){const Ce=_s(c.writingMode,Me,me,O);if(Ce)return Ce}re=[_e.first];for(let Ce=c.glyphStartIndex+1;Ce<de-1;Ce++){const Le=Gr(H*C.getoffsetX(Ce),q,Q,v,c.segment,pe,fe,t,U);if(!Le)return{notEnoughRoom:!0};re.push(Le)}re.push(_e.last)}else{if(b&&!v){const pe=Oi(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,fe=c.lineStartIndex+c.segment+1,_e=new u.P(t.lineVertexArray.getx(fe),t.lineVertexArray.gety(fe)),Me=Oi(_e.x,_e.y,t),me=Me.signedDistanceFromCamera>0?Me.point:Pl(t.tileAnchorPoint,_e,pe,1,t),Ce=Xa(pe.x,pe.y,t,a),Le=Xa(me.x,me.y,t,a),we=_s(c.writingMode,Ce,Le,O);if(we)return we}const de=Gr(H*C.getoffsetX(c.glyphStartIndex),q,Q,v,c.segment,c.lineStartIndex,c.lineStartIndex+c.lineLength,t,U);if(!de||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};re=[de]}for(const de of re)u.aG(z,de.point,de.angle);return{}}function Pl(g,t,a,c,f){const v=g.add(g.sub(t)._unit()),b=Oi(v.x,v.y,f).point,C=a.sub(b);return a.add(C._mult(c/C.mag()))}function zr(g,t,a){const c=t.projectionCache;if(c.projections[g])return c.projections[g];const f=new u.P(t.lineVertexArray.getx(g),t.lineVertexArray.gety(g)),v=Oi(f.x,f.y,t);if(v.signedDistanceFromCamera>0)return c.projections[g]=v.point,c.anyProjectionOccluded=c.anyProjectionOccluded||v.isOccluded,v.point;const b=g-a.direction;return Pl(a.distanceFromAnchor===0?t.tileAnchorPoint:new u.P(t.lineVertexArray.getx(b),t.lineVertexArray.gety(b)),f,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,t)}function Oi(g,t,a){const c=g+a.translation[0],f=t+a.translation[1];let v;return a.pitchWithMap?(v=fi(c,f,a.pitchedLabelPlaneMatrix,a.getElevation),v.isOccluded=!1):(v=a.transform.projectTileCoordinates(c,f,a.unwrappedTileID,a.getElevation),v.point.x=(.5*v.point.x+.5)*a.width,v.point.y=(.5*-v.point.y+.5)*a.height),v}function Xa(g,t,a,c){if(a.pitchWithMap){const f=[g,t,0,1];return u.aH(f,f,c),a.transform.projectTileCoordinates(f[0]/f[3],f[1]/f[3],a.unwrappedTileID,a.getElevation).point}return{x:g/a.width*2-1,y:1-t/a.height*2}}function ys(g,t,a){return a.transform.projectTileCoordinates(g,t,a.unwrappedTileID,a.getElevation)}function Yo(g,t,a){return g._unit()._perp()._mult(t*a)}function Vs(g,t,a,c,f,v,b,C,z){if(C.projectionCache.offsets[g])return C.projectionCache.offsets[g];const O=a.add(t);if(g+z.direction<c||g+z.direction>=f)return C.projectionCache.offsets[g]=O,O;const U=zr(g+z.direction,C,z),H=Yo(U.sub(a),b,z.direction),q=a.add(H),Q=U.add(H);return C.projectionCache.offsets[g]=u.aI(v,O,q,Q)||O,C.projectionCache.offsets[g]}function Gr(g,t,a,c,f,v,b,C,z){const O=c?g-t:g+t;let U=O>0?1:-1,H=0;c&&(U*=-1,H=Math.PI),U<0&&(H+=Math.PI);let q,Q=U>0?v+f:v+f+1;C.projectionCache.cachedAnchorPoint?q=C.projectionCache.cachedAnchorPoint:(q=Oi(C.tileAnchorPoint.x,C.tileAnchorPoint.y,C).point,C.projectionCache.cachedAnchorPoint=q);let re,de,pe=q,fe=q,_e=0,Me=0;const me=Math.abs(O),Ce=[];let Le;for(;_e+Me<=me;){if(Q+=U,Q<v||Q>=b)return null;_e+=Me,fe=pe,de=re;const Ye={absOffsetX:me,direction:U,distanceFromAnchor:_e,previousVertex:fe};if(pe=zr(Q,C,Ye),a===0)Ce.push(fe),Le=pe.sub(fe);else{let qe;const $e=pe.sub(fe);qe=$e.mag()===0?Yo(zr(Q+U,C,Ye).sub(pe),a,U):Yo($e,a,U),de||(de=fe.add(qe)),re=Vs(Q,qe,pe,v,b,de,a,C,Ye),Ce.push(de),Le=re.sub(de)}Me=Le.mag()}const we=Le._mult((me-_e)/Me)._add(de||fe),Re=H+Math.atan2(pe.y-fe.y,pe.x-fe.x);return Ce.push(we),{point:we,angle:z?Re:0,path:Ce}}const Bi=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function $i(g,t){for(let a=0;a<g;a++){const c=t.length;t.resize(c+4),t.float32.set(Bi,3*c)}}function qr(g,t,a){const c=t[0],f=t[1];return g[0]=a[0]*c+a[4]*f+a[12],g[1]=a[1]*c+a[5]*f+a[13],g[3]=a[3]*c+a[7]*f+a[15],g}const zi=100;class _o{constructor(t,a=new hi(t.width+200,t.height+200,25),c=new hi(t.width+200,t.height+200,25)){this.transform=t,this.grid=a,this.ignoredGrid=c,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+zi,this.screenBottomBoundary=t.height+zi,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,a,c,f,v,b,C,z,O,U,H,q){const Q=this.projectAndGetPerspectiveRatio(t.anchorPointX+z[0],t.anchorPointY+z[1],v,U,q),re=c*Q.perspectiveRatio;let de;if(b||C)de=this._projectCollisionBox(t,re,f,v,b,C,z,Q,U,H,q);else{const Le=Q.x+(H?H.x*re:0),we=Q.y+(H?H.y*re:0);de={allPointsOccluded:!1,box:[Le+t.x1*re,we+t.y1*re,Le+t.x2*re,we+t.y2*re]}}const[pe,fe,_e,Me]=de.box,me=b?de.allPointsOccluded:Q.isOccluded;let Ce=me;return Ce||(Ce=Q.perspectiveRatio<this.perspectiveRatioCutoff),Ce||(Ce=!this.isInsideGrid(pe,fe,_e,Me)),Ce||a!=="always"&&this.grid.hitTest(pe,fe,_e,Me,a,O)?{box:[pe,fe,_e,Me],placeable:!1,offscreen:!1,occluded:me}:{box:[pe,fe,_e,Me],placeable:!0,offscreen:this.isOffscreen(pe,fe,_e,Me),occluded:me}}placeCollisionCircles(t,a,c,f,v,b,C,z,O,U,H,q,Q,re){const de=[],pe=new u.P(a.anchorX,a.anchorY),fe=this.getPerspectiveRatio(pe.x,pe.y,b,re),_e=(O?v*this.transform.getPitchedTextCorrection(a.anchorX,a.anchorY,b)/fe:v*fe)/u.aM,Me={getElevation:re,pitchedLabelPlaneMatrix:C,lineVertexArray:c,pitchWithMap:O,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:pe,unwrappedTileID:b,width:this.transform.width,height:this.transform.height,translation:Q},me=Ca(_e,f,a.lineOffsetX*_e,a.lineOffsetY*_e,!1,a,!1,Me);let Ce=!1,Le=!1,we=!0;if(me){const Re=.5*H*fe+q,Ye=new u.P(-100,-100),qe=new u.P(this.screenRightBoundary,this.screenBottomBoundary),$e=new bt,Xe=me.first,Mt=me.last;let At=[];for(let _i=Xe.path.length-1;_i>=1;_i--)At.push(Xe.path[_i]);for(let _i=1;_i<Mt.path.length;_i++)At.push(Mt.path[_i]);const pt=2.5*Re;if(O){const _i=this.projectPathToScreenSpace(At,Me);At=_i.some((nn=>nn.signedDistanceFromCamera<=0))?[]:_i.map((nn=>nn.point))}let Lt=[];if(At.length>0){const _i=At[0].clone(),nn=At[0].clone();for(let bn=1;bn<At.length;bn++)_i.x=Math.min(_i.x,At[bn].x),_i.y=Math.min(_i.y,At[bn].y),nn.x=Math.max(nn.x,At[bn].x),nn.y=Math.max(nn.y,At[bn].y);Lt=_i.x>=Ye.x&&nn.x<=qe.x&&_i.y>=Ye.y&&nn.y<=qe.y?[At]:nn.x<Ye.x||_i.x>qe.x||nn.y<Ye.y||_i.y>qe.y?[]:u.aJ([At],Ye.x,Ye.y,qe.x,qe.y)}for(const _i of Lt){$e.reset(_i,.25*Re);let nn=0;nn=$e.length<=.5*Re?1:Math.ceil($e.paddedLength/pt)+1;for(let bn=0;bn<nn;bn++){const pn=bn/Math.max(nn-1,1),Dn=$e.lerp(pn),ln=Dn.x+zi,qn=Dn.y+zi;de.push(ln,qn,Re,0);const In=ln-Re,Lr=qn-Re,Wn=ln+Re,Kn=qn+Re;if(we=we&&this.isOffscreen(In,Lr,Wn,Kn),Le=Le||this.isInsideGrid(In,Lr,Wn,Kn),t!=="always"&&this.grid.hitTestCircle(ln,qn,Re,t,U)&&(Ce=!0,!z))return{circles:[],offscreen:!1,collisionDetected:Ce}}}}return{circles:!z&&Ce||!Le||fe<this.perspectiveRatioCutoff?[]:de,offscreen:we,collisionDetected:Ce}}projectPathToScreenSpace(t,a){const c=(function(f,v){const b=u.N();return u.aB(b,v.pitchedLabelPlaneMatrix),f.map((C=>{const z=fi(C.x,C.y,b,v.getElevation),O=v.transform.projectTileCoordinates(z.point.x,z.point.y,v.unwrappedTileID,v.getElevation);return O.point.x=(.5*O.point.x+.5)*v.width,O.point.y=(.5*-O.point.y+.5)*v.height,O}))})(t,a);return(function(f){let v=0,b=0,C=0,z=0;for(let O=0;O<f.length;O++)f[O].isOccluded?(C=O+1,z=0):(z++,z>b&&(b=z,v=C));return f.slice(v,v+b)})(c)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const a=[],c=new u.aa;for(const H of t){const q=new u.P(H.x+zi,H.y+zi);c.extend(q),a.push(q)}const{minX:f,minY:v,maxX:b,maxY:C}=c,z=this.grid.query(f,v,b,C).concat(this.ignoredGrid.query(f,v,b,C)),O={},U={};for(const H of z){const q=H.key;if(O[q.bucketInstanceId]===void 0&&(O[q.bucketInstanceId]={}),O[q.bucketInstanceId][q.featureIndex])continue;const Q=[new u.P(H.x1,H.y1),new u.P(H.x2,H.y1),new u.P(H.x2,H.y2),new u.P(H.x1,H.y2)];u.aK(a,Q)&&(O[q.bucketInstanceId][q.featureIndex]=!0,U[q.bucketInstanceId]===void 0&&(U[q.bucketInstanceId]=[]),U[q.bucketInstanceId].push(q.featureIndex))}return U}insertCollisionBox(t,a,c,f,v,b){(c?this.ignoredGrid:this.grid).insert({bucketInstanceId:f,featureIndex:v,collisionGroupID:b,overlapMode:a},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,a,c,f,v,b){const C=c?this.ignoredGrid:this.grid,z={bucketInstanceId:f,featureIndex:v,collisionGroupID:b,overlapMode:a};for(let O=0;O<t.length;O+=4)C.insertCircle(z,t[O],t[O+1],t[O+2])}projectAndGetPerspectiveRatio(t,a,c,f,v){if(v){let b;f?(b=[t,a,f(t,a),1],u.aH(b,b,v)):(b=[t,a,0,1],qr(b,b,v));const C=b[3];return{x:(b[0]/C+1)/2*this.transform.width+zi,y:(-b[1]/C+1)/2*this.transform.height+zi,perspectiveRatio:.5+this.transform.cameraToCenterDistance/C*.5,isOccluded:!1,signedDistanceFromCamera:C}}{const b=this.transform.projectTileCoordinates(t,a,c,f);return{x:(b.point.x+1)/2*this.transform.width+zi,y:(1-b.point.y)/2*this.transform.height+zi,perspectiveRatio:.5+this.transform.cameraToCenterDistance/b.signedDistanceFromCamera*.5,isOccluded:b.isOccluded,signedDistanceFromCamera:b.signedDistanceFromCamera}}}getPerspectiveRatio(t,a,c,f){const v=this.transform.projectTileCoordinates(t,a,c,f);return .5+this.transform.cameraToCenterDistance/v.signedDistanceFromCamera*.5}isOffscreen(t,a,c,f){return c<zi||t>=this.screenRightBoundary||f<zi||a>this.screenBottomBoundary}isInsideGrid(t,a,c,f){return c>=0&&t<this.gridRightBoundary&&f>=0&&a<this.gridBottomBoundary}getViewportMatrix(){const t=u.ar([]);return u.O(t,t,[-100,-100,0]),t}_projectCollisionBox(t,a,c,f,v,b,C,z,O,U,H){let q=1,Q=0,re=0,de=1;const pe=t.anchorPointX+C[0],fe=t.anchorPointY+C[1];if(b&&!v){const At=this.projectAndGetPerspectiveRatio(pe+1,fe,f,O,H),pt=At.x-z.x,Lt=Math.atan((At.y-z.y)/pt)+(pt<0?Math.PI:0),_i=Math.sin(Lt),nn=Math.cos(Lt);q=nn,Q=_i,re=-_i,de=nn}else if(!b&&v){const At=gs(this.transform);q=At.vecEast[0],Q=At.vecEast[1],re=At.vecSouth[0],de=At.vecSouth[1]}let _e=z.x,Me=z.y,me=a;v&&(_e=pe,Me=fe,me=Math.pow(2,-(this.transform.zoom-c.overscaledZ)),me*=this.transform.getPitchedTextCorrection(pe,fe,f),U||(me*=u.an(.5+z.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),U&&(_e+=q*U.x*me+re*U.y*me,Me+=Q*U.x*me+de*U.y*me);const Ce=t.x1*me,Le=t.x2*me,we=(Ce+Le)/2,Re=t.y1*me,Ye=t.y2*me,qe=(Re+Ye)/2,$e=[{offsetX:Ce,offsetY:Re},{offsetX:we,offsetY:Re},{offsetX:Le,offsetY:Re},{offsetX:Le,offsetY:qe},{offsetX:Le,offsetY:Ye},{offsetX:we,offsetY:Ye},{offsetX:Ce,offsetY:Ye},{offsetX:Ce,offsetY:qe}];let Xe=[];for(const{offsetX:At,offsetY:pt}of $e)Xe.push(new u.P(_e+q*At+re*pt,Me+Q*At+de*pt));let Mt=!1;if(v){const At=Xe.map((pt=>this.projectAndGetPerspectiveRatio(pt.x,pt.y,f,O,H)));Mt=At.some((pt=>!pt.isOccluded)),Xe=At.map((pt=>new u.P(pt.x,pt.y)))}else Mt=!0;return{box:u.aL(Xe),allPointsOccluded:!Mt}}}class Fu{constructor(t,a,c,f){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?a:-a))):f&&c?1:0,this.placed=c}isHidden(){return this.opacity===0&&!this.placed}}class xi{constructor(t,a,c,f,v){this.text=new Fu(t?t.text:null,a,c,v),this.icon=new Fu(t?t.icon:null,a,f,v)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class On{constructor(t,a,c){this.text=t,this.icon=a,this.skipFade=c}}class Wo{constructor(t,a,c,f,v){this.bucketInstanceId=t,this.featureIndex=a,this.sourceLayerIndex=c,this.bucketIndex=f,this.tileID=v}}class Ql{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const a=++this.maxGroupID;this.collisionGroups[t]={ID:a,predicate:c=>c.collisionGroupID===a}}return this.collisionGroups[t]}}function vn(g,t,a,c,f){const{horizontalAlign:v,verticalAlign:b}=u.aS(g);return new u.P(-(v-.5)*t+c[0]*f,-(b-.5)*a+c[1]*f)}class Jl{constructor(t,a,c,f,v){this.transform=t.clone(),this.terrain=a,this.collisionIndex=new _o(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new Ql(f),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=v,v&&(v.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const a=this.terrain;return a?(c,f)=>a.getElevation(t,c,f):null}getBucketParts(t,a,c,f){const v=c.getBucket(a),b=c.latestFeatureIndex;if(!v||!b||a.id!==v.layerIds[0])return;const C=c.collisionBoxArray,z=v.layers[0].layout,O=v.layers[0].paint,U=Math.pow(2,this.transform.zoom-c.tileID.overscaledZ),H=c.tileSize/u.a5,q=c.tileID.toUnwrapped(),Q=z.get("text-rotation-alignment")==="map",re=u.aN(c,1,this.transform.zoom),de=u.aO(this.collisionIndex.transform,c,O.get("text-translate"),O.get("text-translate-anchor")),pe=u.aO(this.collisionIndex.transform,c,O.get("icon-translate"),O.get("icon-translate-anchor")),fe=na(Q,this.transform,re);this.retainedQueryData[v.bucketInstanceId]=new Wo(v.bucketInstanceId,b,v.sourceLayerIndex,v.index,c.tileID);const _e={bucket:v,layout:z,translationText:de,translationIcon:pe,unwrappedTileID:q,pitchedLabelPlaneMatrix:fe,scale:U,textPixelRatio:H,holdingForFade:c.holdingForSymbolFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:u.ay(v.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(v.sourceID)};if(f)for(const Me of v.sortKeyRanges){const{sortKey:me,symbolInstanceStart:Ce,symbolInstanceEnd:Le}=Me;t.push({sortKey:me,symbolInstanceStart:Ce,symbolInstanceEnd:Le,parameters:_e})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:v.symbolInstances.length,parameters:_e})}attemptAnchorPlacement(t,a,c,f,v,b,C,z,O,U,H,q,Q,re,de,pe,fe,_e,Me,me){const Ce=u.aP[t.textAnchor],Le=[t.textOffset0,t.textOffset1],we=vn(Ce,c,f,Le,v),Re=this.collisionIndex.placeCollisionBox(a,q,z,O,U,C,b,pe,H.predicate,Me,we,me);if((!_e||this.collisionIndex.placeCollisionBox(_e,q,z,O,U,C,b,fe,H.predicate,Me,we,me).placeable)&&Re.placeable){let Ye;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Q.crossTileID]&&this.prevPlacement.placements[Q.crossTileID]&&this.prevPlacement.placements[Q.crossTileID].text&&(Ye=this.prevPlacement.variableOffsets[Q.crossTileID].anchor),Q.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Q.crossTileID]={textOffset:Le,width:c,height:f,anchor:Ce,textBoxScale:v,prevAnchor:Ye},this.markUsedJustification(re,Ce,Q,de),re.allowVerticalPlacement&&(this.markUsedOrientation(re,de,Q),this.placedOrientations[Q.crossTileID]=de),{shift:we,placedGlyphBoxes:Re}}}placeLayerBucketPart(t,a,c){const{bucket:f,layout:v,translationText:b,translationIcon:C,unwrappedTileID:z,pitchedLabelPlaneMatrix:O,textPixelRatio:U,holdingForFade:H,collisionBoxArray:q,partiallyEvaluatedTextSize:Q,collisionGroup:re}=t.parameters,de=v.get("text-optional"),pe=v.get("icon-optional"),fe=u.aQ(v,"text-overlap","text-allow-overlap"),_e=fe==="always",Me=u.aQ(v,"icon-overlap","icon-allow-overlap"),me=Me==="always",Ce=v.get("text-rotation-alignment")==="map",Le=v.get("text-pitch-alignment")==="map",we=v.get("icon-text-fit")!=="none",Re=v.get("symbol-z-order")==="viewport-y",Ye=_e&&(me||!f.hasIconData()||pe),qe=me&&(_e||!f.hasTextData()||de);!f.collisionArrays&&q&&f.deserializeCollisionBoxes(q);const $e=this.retainedQueryData[f.bucketInstanceId].tileID,Xe=this._getTerrainElevationFunc($e),Mt=this.transform.getFastPathSimpleProjectionMatrix($e),At=(pt,Lt,_i)=>{var nn,bn;if(a[pt.crossTileID])return;if(H)return void(this.placements[pt.crossTileID]=new On(!1,!1,!1));let pn=!1,Dn=!1,ln=!0,qn=null,In={box:null,placeable:!1,offscreen:null,occluded:!1},Lr={placeable:!1},Wn=null,Kn=null,Dr=null,Uo=0,Vo=0,ao=0;Lt.textFeatureIndex?Uo=Lt.textFeatureIndex:pt.useRuntimeCollisionCircles&&(Uo=pt.featureIndex),Lt.verticalTextFeatureIndex&&(Vo=Lt.verticalTextFeatureIndex);const Ba=Lt.textBox;if(Ba){const Na=sn=>{let mn=u.az.horizontal;if(f.allowVerticalPlacement&&!sn&&this.prevPlacement){const cr=this.prevPlacement.placedOrientations[pt.crossTileID];cr&&(this.placedOrientations[pt.crossTileID]=cr,mn=cr,this.markUsedOrientation(f,mn,pt))}return mn},ls=(sn,mn)=>{if(f.allowVerticalPlacement&&pt.numVerticalGlyphVertices>0&&Lt.verticalTextBox){for(const cr of f.writingModes)if(cr===u.az.vertical?(In=mn(),Lr=In):In=sn(),In&&In.placeable)break}else In=sn()},Ls=pt.textAnchorOffsetStartIndex,Ds=pt.textAnchorOffsetEndIndex;if(Ds===Ls){const sn=(mn,cr)=>{const gr=this.collisionIndex.placeCollisionBox(mn,fe,U,$e,z,Le,Ce,b,re.predicate,Xe,void 0,Mt);return gr&&gr.placeable&&(this.markUsedOrientation(f,cr,pt),this.placedOrientations[pt.crossTileID]=cr),gr};ls((()=>sn(Ba,u.az.horizontal)),(()=>{const mn=Lt.verticalTextBox;return f.allowVerticalPlacement&&pt.numVerticalGlyphVertices>0&&mn?sn(mn,u.az.vertical):{box:null,offscreen:null}})),Na(In&&In.placeable)}else{let sn=u.aP[(bn=(nn=this.prevPlacement)===null||nn===void 0?void 0:nn.variableOffsets[pt.crossTileID])===null||bn===void 0?void 0:bn.anchor];const mn=(gr,xh,bh)=>{const Zl=gr.x2-gr.x1,Hd=gr.y2-gr.y1,Gl=pt.textBoxScale,wh=we&&Me==="never"?xh:null;let vl=null,xl=fe==="never"?1:2,oo="never";sn&&xl++;for(let Th=0;Th<xl;Th++){for(let Uc=Ls;Uc<Ds;Uc++){const Vc=f.textAnchorOffsets.get(Uc);if(sn&&Vc.textAnchor!==sn)continue;const Zc=this.attemptAnchorPlacement(Vc,gr,Zl,Hd,Gl,Ce,Le,U,$e,z,re,oo,pt,f,bh,b,C,wh,Xe);if(Zc&&(vl=Zc.placedGlyphBoxes,vl&&vl.placeable))return pn=!0,qn=Zc.shift,vl}sn?sn=null:oo=fe}return c&&!vl&&(vl={box:this.collisionIndex.placeCollisionBox(Ba,"always",U,$e,z,Le,Ce,b,re.predicate,Xe,void 0,Mt).box,offscreen:!1,placeable:!1,occluded:!1}),vl};ls((()=>mn(Ba,Lt.iconBox,u.az.horizontal)),(()=>{const gr=Lt.verticalTextBox;return f.allowVerticalPlacement&&(!In||!In.placeable)&&pt.numVerticalGlyphVertices>0&&gr?mn(gr,Lt.verticalIconBox,u.az.vertical):{box:null,occluded:!0,offscreen:null}})),In&&(pn=In.placeable,ln=In.offscreen);const cr=Na(In&&In.placeable);if(!pn&&this.prevPlacement){const gr=this.prevPlacement.variableOffsets[pt.crossTileID];gr&&(this.variableOffsets[pt.crossTileID]=gr,this.markUsedJustification(f,gr.anchor,pt,cr))}}}if(Wn=In,pn=Wn&&Wn.placeable,ln=Wn&&Wn.offscreen,pt.useRuntimeCollisionCircles&&pt.centerJustifiedTextSymbolIndex>=0){const Na=f.text.placedSymbolArray.get(pt.centerJustifiedTextSymbolIndex),ls=u.aA(f.textSizeData,Q,Na),Ls=v.get("text-padding");Kn=this.collisionIndex.placeCollisionCircles(fe,Na,f.lineVertexArray,f.glyphOffsetArray,ls,z,O,c,Le,re.predicate,pt.collisionCircleDiameter,Ls,b,Xe),Kn.circles.length&&Kn.collisionDetected&&!c&&u.w("Collisions detected, but collision boxes are not shown"),pn=_e||Kn.circles.length>0&&!Kn.collisionDetected,ln=ln&&Kn.offscreen}if(Lt.iconFeatureIndex&&(ao=Lt.iconFeatureIndex),Lt.iconBox){const Na=ls=>this.collisionIndex.placeCollisionBox(ls,Me,U,$e,z,Le,Ce,C,re.predicate,Xe,we&&qn?qn:void 0,Mt);Lr&&Lr.placeable&&Lt.verticalIconBox?(Dr=Na(Lt.verticalIconBox),Dn=Dr.placeable):(Dr=Na(Lt.iconBox),Dn=Dr.placeable),ln=ln&&Dr.offscreen}const xu=de||pt.numHorizontalGlyphVertices===0&&pt.numVerticalGlyphVertices===0,rc=pe||pt.numIconVertices===0;xu||rc?rc?xu||(Dn=Dn&&pn):pn=Dn&&pn:Dn=pn=Dn&&pn;const so=Dn&&Dr.placeable;if(pn&&Wn.placeable&&this.collisionIndex.insertCollisionBox(Wn.box,fe,v.get("text-ignore-placement"),f.bucketInstanceId,Lr&&Lr.placeable&&Vo?Vo:Uo,re.ID),so&&this.collisionIndex.insertCollisionBox(Dr.box,Me,v.get("icon-ignore-placement"),f.bucketInstanceId,ao,re.ID),Kn&&pn&&this.collisionIndex.insertCollisionCircles(Kn.circles,fe,v.get("text-ignore-placement"),f.bucketInstanceId,Uo,re.ID),c&&this.storeCollisionData(f.bucketInstanceId,_i,Lt,Wn,Dr,Kn),pt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(f.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[pt.crossTileID]=new On((pn||Ye)&&!Wn?.occluded,(Dn||qe)&&!Dr?.occluded,ln||f.justReloaded),a[pt.crossTileID]=!0};if(Re){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const pt=f.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let Lt=pt.length-1;Lt>=0;--Lt){const _i=pt[Lt];At(f.symbolInstances.get(_i),f.collisionArrays[_i],_i)}}else for(let pt=t.symbolInstanceStart;pt<t.symbolInstanceEnd;pt++)At(f.symbolInstances.get(pt),f.collisionArrays[pt],pt);f.justReloaded=!1}storeCollisionData(t,a,c,f,v,b){if(c.textBox||c.iconBox){let C,z;this.collisionBoxArrays.has(t)?C=this.collisionBoxArrays.get(t):(C=new Map,this.collisionBoxArrays.set(t,C)),C.has(a)?z=C.get(a):(z={text:null,icon:null},C.set(a,z)),c.textBox&&(z.text=f.box),c.iconBox&&(z.icon=v.box)}if(b){let C=this.collisionCircleArrays[t];C===void 0&&(C=this.collisionCircleArrays[t]=[]);for(let z=0;z<b.circles.length;z+=4)C.push(b.circles[z+0]-zi),C.push(b.circles[z+1]-zi),C.push(b.circles[z+2]),C.push(b.collisionDetected?1:0)}}markUsedJustification(t,a,c,f){let v;v=f===u.az.vertical?c.verticalPlacedTextSymbolIndex:{left:c.leftJustifiedTextSymbolIndex,center:c.centerJustifiedTextSymbolIndex,right:c.rightJustifiedTextSymbolIndex}[u.aR(a)];const b=[c.leftJustifiedTextSymbolIndex,c.centerJustifiedTextSymbolIndex,c.rightJustifiedTextSymbolIndex,c.verticalPlacedTextSymbolIndex];for(const C of b)C>=0&&(t.text.placedSymbolArray.get(C).crossTileID=v>=0&&C!==v?0:c.crossTileID)}markUsedOrientation(t,a,c){const f=a===u.az.horizontal||a===u.az.horizontalOnly?a:0,v=a===u.az.vertical?a:0,b=[c.leftJustifiedTextSymbolIndex,c.centerJustifiedTextSymbolIndex,c.rightJustifiedTextSymbolIndex];for(const C of b)t.text.placedSymbolArray.get(C).placedOrientation=f;c.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(c.verticalPlacedTextSymbolIndex).placedOrientation=v)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const a=this.prevPlacement;let c=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;const f=a?a.symbolFadeChange(t):1,v=a?a.opacities:{},b=a?a.variableOffsets:{},C=a?a.placedOrientations:{};for(const z in this.placements){const O=this.placements[z],U=v[z];U?(this.opacities[z]=new xi(U,f,O.text,O.icon),c=c||O.text!==U.text.placed||O.icon!==U.icon.placed):(this.opacities[z]=new xi(null,f,O.text,O.icon,O.skipFade),c=c||O.text||O.icon)}for(const z in v){const O=v[z];if(!this.opacities[z]){const U=new xi(O,f,!1,!1);U.isHidden()||(this.opacities[z]=U,c=c||O.text.placed||O.icon.placed)}}for(const z in b)this.variableOffsets[z]||!this.opacities[z]||this.opacities[z].isHidden()||(this.variableOffsets[z]=b[z]);for(const z in C)this.placedOrientations[z]||!this.opacities[z]||this.opacities[z].isHidden()||(this.placedOrientations[z]=C[z]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");c?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:t)}updateLayerOpacities(t,a){const c={};for(const f of a){const v=f.getBucket(t);v&&f.latestFeatureIndex&&t.id===v.layerIds[0]&&this.updateBucketOpacities(v,f.tileID,c,f.collisionBoxArray)}}updateBucketOpacities(t,a,c,f){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const v=t.layers[0],b=v.layout,C=new xi(null,0,!1,!1,!0),z=b.get("text-allow-overlap"),O=b.get("icon-allow-overlap"),U=v._unevaluatedLayout.hasValue("text-variable-anchor")||v._unevaluatedLayout.hasValue("text-variable-anchor-offset"),H=b.get("text-rotation-alignment")==="map",q=b.get("text-pitch-alignment")==="map",Q=b.get("icon-text-fit")!=="none",re=new xi(null,0,z&&(O||!t.hasIconData()||b.get("icon-optional")),O&&(z||!t.hasTextData()||b.get("text-optional")),!0);!t.collisionArrays&&f&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(f);const de=(fe,_e,Me)=>{for(let me=0;me<_e/4;me++)fe.opacityVertexArray.emplaceBack(Me);fe.hasVisibleVertices=fe.hasVisibleVertices||Me!==Zs},pe=this.collisionBoxArrays.get(t.bucketInstanceId);for(let fe=0;fe<t.symbolInstances.length;fe++){const _e=t.symbolInstances.get(fe),{numHorizontalGlyphVertices:Me,numVerticalGlyphVertices:me,crossTileID:Ce}=_e;let Le=this.opacities[Ce];c[Ce]?Le=C:Le||(Le=re,this.opacities[Ce]=Le),c[Ce]=!0;const we=_e.numIconVertices>0,Re=this.placedOrientations[_e.crossTileID],Ye=Re===u.az.vertical,qe=Re===u.az.horizontal||Re===u.az.horizontalOnly;if(Me>0||me>0){const Xe=zl(Le.text);de(t.text,Me,Ye?Zs:Xe),de(t.text,me,qe?Zs:Xe);const Mt=Le.text.isHidden();[_e.rightJustifiedTextSymbolIndex,_e.centerJustifiedTextSymbolIndex,_e.leftJustifiedTextSymbolIndex].forEach((Lt=>{Lt>=0&&(t.text.placedSymbolArray.get(Lt).hidden=Mt||Ye?1:0)})),_e.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(_e.verticalPlacedTextSymbolIndex).hidden=Mt||qe?1:0);const At=this.variableOffsets[_e.crossTileID];At&&this.markUsedJustification(t,At.anchor,_e,Re);const pt=this.placedOrientations[_e.crossTileID];pt&&(this.markUsedJustification(t,"left",_e,pt),this.markUsedOrientation(t,pt,_e))}if(we){const Xe=zl(Le.icon),Mt=!(Q&&_e.verticalPlacedIconSymbolIndex&&Ye);_e.placedIconSymbolIndex>=0&&(de(t.icon,_e.numIconVertices,Mt?Xe:Zs),t.icon.placedSymbolArray.get(_e.placedIconSymbolIndex).hidden=Le.icon.isHidden()),_e.verticalPlacedIconSymbolIndex>=0&&(de(t.icon,_e.numVerticalIconVertices,Mt?Zs:Xe),t.icon.placedSymbolArray.get(_e.verticalPlacedIconSymbolIndex).hidden=Le.icon.isHidden())}const $e=pe&&pe.has(fe)?pe.get(fe):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Xe=t.collisionArrays[fe];if(Xe){let Mt=new u.P(0,0);if(Xe.textBox||Xe.verticalTextBox){let At=!0;if(U){const pt=this.variableOffsets[Ce];pt?(Mt=vn(pt.anchor,pt.width,pt.height,pt.textOffset,pt.textBoxScale),H&&Mt._rotate(q?-this.transform.bearingInRadians:this.transform.bearingInRadians)):At=!1}if(Xe.textBox||Xe.verticalTextBox){let pt;Xe.textBox&&(pt=Ye),Xe.verticalTextBox&&(pt=qe),Ko(t.textCollisionBox.collisionVertexArray,Le.text.placed,!At||pt,$e.text,Mt.x,Mt.y)}}if(Xe.iconBox||Xe.verticalIconBox){const At=!!(!qe&&Xe.verticalIconBox);let pt;Xe.iconBox&&(pt=At),Xe.verticalIconBox&&(pt=!At),Ko(t.iconCollisionBox.collisionVertexArray,Le.icon.placed,pt,$e.icon,Q?Mt.x:0,Q?Mt.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,a){const c=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*c>t}setStale(){this.stale=!0}}function Ko(g,t,a,c,f,v){c&&c.length!==0||(c=[0,0,0,0]);const b=c[0]-zi,C=c[1]-zi,z=c[2]-zi,O=c[3]-zi;g.emplaceBack(t?1:0,a?1:0,f||0,v||0,b,C),g.emplaceBack(t?1:0,a?1:0,f||0,v||0,z,C),g.emplaceBack(t?1:0,a?1:0,f||0,v||0,z,O),g.emplaceBack(t?1:0,a?1:0,f||0,v||0,b,O)}const Ya=Math.pow(2,25),fn=Math.pow(2,24),yo=Math.pow(2,17),vs=Math.pow(2,16),Ma=Math.pow(2,9),ju=Math.pow(2,8),Wa=Math.pow(2,1);function zl(g){if(g.opacity===0&&!g.placed)return 0;if(g.opacity===1&&g.placed)return 4294967295;const t=g.placed?1:0,a=Math.floor(127*g.opacity);return a*Ya+t*fn+a*yo+t*vs+a*Ma+t*ju+a*Wa+t}const Zs=0;class Ka{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,a,c,f,v){const b=this._bucketParts;for(;this._currentTileIndex<t.length;)if(a.getBucketParts(b,f,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,v())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,b.sort(((C,z)=>C.sortKey-z.sortKey)));this._currentPartIndex<b.length;)if(a.placeLayerBucketPart(b[this._currentPartIndex],this._seenCrossTileIDs,c),this._currentPartIndex++,v())return!0;return!1}}class vo{constructor(t,a,c,f,v,b,C,z){this.placement=new Jl(t,a,b,C,z),this._currentPlacementIndex=c.length-1,this._forceFullPlacement=f,this._showCollisionBoxes=v,this._done=!1}isDone(){return this._done}continuePlacement(t,a,c){const f=Te(),v=()=>!this._forceFullPlacement&&Te()-f>2;for(;this._currentPlacementIndex>=0;){const b=a[t[this._currentPlacementIndex]],C=this.placement.collisionIndex.transform.zoom;if(b.type==="symbol"&&(!b.minzoom||b.minzoom<=C)&&(!b.maxzoom||b.maxzoom>C)){if(this._inProgressLayer||(this._inProgressLayer=new Ka(b)),this._inProgressLayer.continuePlacement(c[b.source],this.placement,this._showCollisionBoxes,b,v))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const mi=512/u.a5/2;class ra{constructor(t,a,c){this.tileID=t,this.bucketInstanceId=c,this._symbolsByKey={};const f=new Map;for(let v=0;v<a.length;v++){const b=a.get(v),C=b.key,z=f.get(C);z?z.push(b):f.set(C,[b])}for(const[v,b]of f){const C={positions:b.map((z=>({x:Math.floor(z.anchorX*mi),y:Math.floor(z.anchorY*mi)}))),crossTileIDs:b.map((z=>z.crossTileID))};if(C.positions.length>128){const z=new u.aT(C.positions.length,16,Uint16Array);for(const{x:O,y:U}of C.positions)z.add(O,U);z.finish(),delete C.positions,C.index=z}this._symbolsByKey[v]=C}}getScaledCoordinates(t,a){const{x:c,y:f,z:v}=this.tileID.canonical,{x:b,y:C,z}=a.canonical,O=mi/Math.pow(2,z-v),U=(C*u.a5+t.anchorY)*O,H=f*u.a5*mi;return{x:Math.floor((b*u.a5+t.anchorX)*O-c*u.a5*mi),y:Math.floor(U-H)}}findMatches(t,a,c){const f=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z);for(let v=0;v<t.length;v++){const b=t.get(v);if(b.crossTileID)continue;const C=this._symbolsByKey[b.key];if(!C)continue;const z=this.getScaledCoordinates(b,a);if(C.index){const O=C.index.range(z.x-f,z.y-f,z.x+f,z.y+f).sort();for(const U of O){const H=C.crossTileIDs[U];if(!c[H]){c[H]=!0,b.crossTileID=H;break}}}else if(C.positions)for(let O=0;O<C.positions.length;O++){const U=C.positions[O],H=C.crossTileIDs[O];if(Math.abs(U.x-z.x)<=f&&Math.abs(U.y-z.y)<=f&&!c[H]){c[H]=!0,b.crossTileID=H;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class Uu{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Qo{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const a=Math.round((t-this.lng)/360);if(a!==0)for(const c in this.indexes){const f=this.indexes[c],v={};for(const b in f){const C=f[b];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+a),v[C.tileID.key]=C}this.indexes[c]=v}this.lng=t}addBucket(t,a,c){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let v=0;v<a.symbolInstances.length;v++)a.symbolInstances.get(v).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const f=this.usedCrossTileIDs[t.overscaledZ];for(const v in this.indexes){const b=this.indexes[v];if(Number(v)>t.overscaledZ)for(const C in b){const z=b[C];z.tileID.isChildOf(t)&&z.findMatches(a.symbolInstances,t,f)}else{const C=b[t.scaledTo(Number(v)).key];C&&C.findMatches(a.symbolInstances,t,f)}}for(let v=0;v<a.symbolInstances.length;v++){const b=a.symbolInstances.get(v);b.crossTileID||(b.crossTileID=c.generate(),f[b.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new ra(t,a.symbolInstances,a.bucketInstanceId),!0}removeBucketCrossTileIDs(t,a){for(const c of a.getCrossTileIDsLists())for(const f of c)delete this.usedCrossTileIDs[t][f]}removeStaleBuckets(t){let a=!1;for(const c in this.indexes){const f=this.indexes[c];for(const v in f)t[f[v].bucketInstanceId]||(this.removeBucketCrossTileIDs(c,f[v]),delete f[v],a=!0)}return a}}class or{constructor(){this.layerIndexes={},this.crossTileIDs=new Uu,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,a,c){let f=this.layerIndexes[t.id];f===void 0&&(f=this.layerIndexes[t.id]=new Qo);let v=!1;const b={};f.handleWrapJump(c);for(const C of a){const z=C.getBucket(t);z&&t.id===z.layerIds[0]&&(z.bucketInstanceId||(z.bucketInstanceId=++this.maxBucketInstanceId),f.addBucket(C.tileID,z,this.crossTileIDs)&&(v=!0),b[z.bucketInstanceId]=!0)}return f.removeStaleBuckets(b)&&(v=!0),v}pruneUnusedLayers(t){const a={};t.forEach((c=>{a[c]=!0}));for(const c in this.layerIndexes)a[c]||delete this.layerIndexes[c]}}var Qt="void main() {fragColor=vec4(1.0);}";const Ni={prelude:jt(`#ifdef GL_ES
24precision mediump float;
25#else
26#if !defined(lowp)
27#define lowp
28#endif
29#if !defined(mediump)
30#define mediump
31#endif
32#if !defined(highp)
33#define highp
34#endif
35#endif
36out highp vec4 fragColor;`,`#ifdef GL_ES
37precision highp float;
38#else
39#if !defined(lowp)
40#define lowp
41#endif
42#if !defined(mediump)
43#define mediump
44#endif
45#if !defined(highp)
46#define highp
47#endif
48#endif
49vec2 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
50);}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);
50return (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
51);}
52#ifdef TERRAIN3D
53uniform 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;
54#endif
55const 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) {
56#ifdef TERRAIN3D
57highp 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));
58#else
59return 1.0;
60#endif
61}float calculate_visibility(vec4 pos) {
62#ifdef TERRAIN3D
63vec3 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;
64#else
65return 1.0;
66#endif
67}float ele(vec2 pos) {
68#ifdef TERRAIN3D
69vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
70#else
71return 0.0;
72#endif
73}float get_elevation(vec2 pos) {
74#ifdef TERRAIN3D
75#ifdef GLOBE
76if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
77#endif
78vec2 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;
79#else
80return 0.0;
81#endif
82}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:jt("","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:jt("",`#define GLOBE_RADIUS 6371008.8
83uniform 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
84);}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); 
85if (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
86);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:jt(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
87#ifdef OVERDRAW_INSPECTOR
88fragColor=vec4(1.0);
89#endif
90}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:jt(`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;
90uniform 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;
91#ifdef OVERDRAW_INSPECTOR
92fragColor=vec4(1.0);
93#endif
94}`,"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:jt(`in vec3 v_data;in float v_visibility;
95#pragma mapbox: define highp vec4 color
96#pragma mapbox: define mediump float radius
97#pragma mapbox: define lowp float blur
98#pragma mapbox: define lowp float opacity
99#pragma mapbox: define highp vec4 stroke_color
100#pragma mapbox: define mediump float stroke_width
101#pragma mapbox: define lowp float stroke_opacity
102void main() {
103#pragma mapbox: initialize highp vec4 color
104#pragma mapbox: initialize mediump float radius
105#pragma mapbox: initialize lowp float blur
106#pragma mapbox: initialize lowp float opacity
107#pragma mapbox: initialize highp vec4 stroke_color
108#pragma mapbox: initialize mediump float stroke_width
109#pragma mapbox: initialize lowp float stroke_opacity
110vec2 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;}
111#ifdef OVERDRAW_INSPECTOR
112fragColor=vec4(1.0);
113#endif
114}`,`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;
115#pragma mapbox: define highp vec4 color
116#pragma mapbox: define mediump float radius
117#pragma mapbox: define lowp float blur
118#pragma mapbox: define lowp float opacity
119#pragma mapbox: define highp vec4 stroke_color
120#pragma mapbox: define mediump float stroke_width
121#pragma mapbox: define lowp float stroke_opacity
122void main(void) {
123#pragma mapbox: initialize highp vec4 color
124#pragma mapbox: initialize mediump float radius
125#pragma mapbox: initialize lowp float blur
126#pragma mapbox: initialize lowp float opacity
127#pragma mapbox: initialize highp vec4 stroke_color
128#pragma mapbox: initialize mediump float stroke_width
129#pragma mapbox: initialize lowp float stroke_opacity
130vec2 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) {
131#ifdef GLOBE
132vec3 center_vector=projectToSphere(circle_center);
133#endif
134float 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 {
135#ifdef GLOBE
136vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
137#else
138vec4 projected_center=projectTileWithElevation(circle_center,ele);
139#endif
140corner_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);}
141#ifdef GLOBE
142vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
143#else
144gl_Position=projectTileWithElevation(corner_position,ele);
145#endif
146} 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:jt(Qt,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:jt(`uniform highp float u_intensity;in vec2 v_extrude;
147#pragma mapbox: define highp float weight
148#define GAUSS_COEF 0.3989422804014327
149void main() {
150#pragma mapbox: initialize highp float weight
151float 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);
152#ifdef OVERDRAW_INSPECTOR
153fragColor=vec4(1.0);
154#endif
155}`,`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;
156#pragma mapbox: define highp float weight
157#pragma mapbox: define mediump float radius
158const highp float ZERO=1.0/255.0/16.0;
159#define GAUSS_COEF 0.3989422804014327
160void main(void) {
161#pragma mapbox: initialize highp float weight
162#pragma mapbox: initialize mediump float radius
163vec2 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);
164#ifdef GLOBE
165vec2 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);
166#else
167gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
168#endif
169}`),heatmapTexture:jt(`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;
170#ifdef OVERDRAW_INSPECTOR
171fragColor=vec4(0.0);
172#endif
173}`,"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:jt("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:jt("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:jt(`#ifdef GL_ES
174precision highp float;
175#endif
176uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else
177{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));
178#ifdef OVERDRAW_INSPECTOR
179fragColor=vec4(1.0);
180#endif
181}`,"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:jt("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:jt(Qt,`in vec2 a_pos;void main() {
182#ifdef GLOBE
183gl_Position=projectTileFor3D(a_pos,0.0);
184#else
185gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
186#endif
187}`),fill:jt(`#pragma mapbox: define highp vec4 color
188#pragma mapbox: define lowp float opacity
189void main() {
190#pragma mapbox: initialize highp vec4 color
191#pragma mapbox: initialize lowp float opacity
192fragColor=color*opacity;
193#ifdef OVERDRAW_INSPECTOR
194fragColor=vec4(1.0);
195#endif
196}`,`uniform vec2 u_fill_translate;in vec2 a_pos;
197#pragma mapbox: define highp vec4 color
198#pragma mapbox: define lowp float opacity
199void main() {
200#pragma mapbox: initialize highp vec4 color
201#pragma mapbox: initialize lowp float opacity
202gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:jt(`in vec2 v_pos;
203#ifdef GLOBE
204in float v_depth;
205#endif
206#pragma mapbox: define highp vec4 outline_color
207#pragma mapbox: define lowp float opacity
208void main() {
209#pragma mapbox: initialize highp vec4 outline_color
210#pragma mapbox: initialize lowp float opacity
211float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
212#ifdef GLOBE
213if (v_depth > 1.0) {discard;}
214#endif
215#ifdef OVERDRAW_INSPECTOR
216fragColor=vec4(1.0);
217#endif
218}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
219#ifdef GLOBE
220out float v_depth;
221#endif
222#pragma mapbox: define highp vec4 outline_color
223#pragma mapbox: define lowp float opacity
224void main() {
225#pragma mapbox: initialize highp vec4 outline_color
226#pragma mapbox: initialize lowp float opacity
227gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
228#ifdef GLOBE
229v_depth=gl_Position.z/gl_Position.w;
230#endif
231}`),fillOutlinePattern:jt(`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;
232#ifdef GLOBE
233in float v_depth;
234#endif
235#pragma mapbox: define lowp float opacity
236#pragma mapbox: define lowp vec4 pattern_from
237#pragma mapbox: define lowp vec4 pattern_to
238void main() {
239#pragma mapbox: initialize lowp float opacity
240#pragma mapbox: initialize mediump vec4 pattern_from
241#pragma mapbox: initialize mediump vec4 pattern_to
242vec2 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;
243#ifdef GLOBE
244if (v_depth > 1.0) {discard;}
245#endif
246#ifdef OVERDRAW_INSPECTOR
247fragColor=vec4(1.0);
248#endif
249}`,`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;
250#ifdef GLOBE
251out float v_depth;
252#endif
253#pragma mapbox: define lowp float opacity
254#pragma mapbox: define lowp vec4 pattern_from
255#pragma mapbox: define lowp vec4 pattern_to
256#pragma mapbox: define lowp float pixel_ratio_from
257#pragma mapbox: define lowp float pixel_ratio_to
258void main() {
259#pragma mapbox: initialize lowp float opacity
260#pragma mapbox: initialize mediump vec4 pattern_from
261#pragma mapbox: initialize mediump vec4 pattern_to
262#pragma mapbox: initialize lowp float pixel_ratio_from
263#pragma mapbox: initialize lowp float pixel_ratio_to
264vec2 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;
265#ifdef GLOBE
266v_depth=gl_Position.z/gl_Position.w;
267#endif
268}`),fillPattern:jt(`#ifdef GL_ES
269precision highp float;
270#endif
271uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
272#pragma mapbox: define lowp float opacity
273#pragma mapbox: define lowp vec4 pattern_from
274#pragma mapbox: define lowp vec4 pattern_to
275void main() {
276#pragma mapbox: initialize lowp float opacity
277#pragma mapbox: initialize mediump vec4 pattern_from
278#pragma mapbox: initialize mediump vec4 pattern_to
279vec2 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;
280#ifdef OVERDRAW_INSPECTOR
281fragColor=vec4(1.0);
282#endif
283}`,`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;
284#pragma mapbox: define lowp float opacity
285#pragma mapbox: define lowp vec4 pattern_from
286#pragma mapbox: define lowp vec4 pattern_to
287#pragma mapbox: define lowp float pixel_ratio_from
288#pragma mapbox: define lowp float pixel_ratio_to
289void main() {
290#pragma mapbox: initialize lowp float opacity
291#pragma mapbox: initialize mediump vec4 pattern_from
292#pragma mapbox: initialize mediump vec4 pattern_to
293#pragma mapbox: initialize lowp float pixel_ratio_from
294#pragma mapbox: initialize lowp float pixel_ratio_to
295vec2 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_siz
295e_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:jt(`in vec4 v_color;void main() {fragColor=v_color;
296#ifdef OVERDRAW_INSPECTOR
297fragColor=vec4(1.0);
298#endif
299}`,`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;
300#ifdef TERRAIN3D
301in vec2 a_centroid;
302#endif
303out vec4 v_color;
304#pragma mapbox: define highp float base
305#pragma mapbox: define highp float height
306#pragma mapbox: define highp vec4 color
307void main() {
308#pragma mapbox: initialize highp float base
309#pragma mapbox: initialize highp float height
310#pragma mapbox: initialize highp vec4 color
311vec3 normal=a_normal_ed.xyz;
312#ifdef TERRAIN3D
313float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
314#else
315float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
316#endif
317base=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;
318#ifdef GLOBE
319vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
320#else
321gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
322#endif
323float 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);
324#ifdef GLOBE
325mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
326#endif
327directional=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:jt(`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;
328#pragma mapbox: define lowp float base
329#pragma mapbox: define lowp float height
330#pragma mapbox: define lowp vec4 pattern_from
331#pragma mapbox: define lowp vec4 pattern_to
332#pragma mapbox: define lowp float pixel_ratio_from
333#pragma mapbox: define lowp float pixel_ratio_to
334void main() {
335#pragma mapbox: initialize lowp float base
336#pragma mapbox: initialize lowp float height
337#pragma mapbox: initialize mediump vec4 pattern_from
338#pragma mapbox: initialize mediump vec4 pattern_to
339#pragma mapbox: initialize lowp float pixel_ratio_from
340#pragma mapbox: initialize lowp float pixel_ratio_to
341vec2 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;
342#ifdef OVERDRAW_INSPECTOR
343fragColor=vec4(1.0);
344#endif
345}`,`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;
346#ifdef TERRAIN3D
347in vec2 a_centroid;
348#endif
349#ifdef GLOBE
350out vec3 v_sphere_pos;
351#endif
352out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
353#pragma mapbox: define lowp float base
354#pragma mapbox: define lowp float height
355#pragma mapbox: define lowp vec4 pattern_from
356#pragma mapbox: define lowp vec4 pattern_to
357#pragma mapbox: define lowp float pixel_ratio_from
358#pragma mapbox: define lowp float pixel_ratio_to
359void main() {
360#pragma mapbox: initialize lowp float base
361#pragma mapbox: initialize lowp float height
362#pragma mapbox: initialize mediump vec4 pattern_from
363#pragma mapbox: initialize mediump vec4 pattern_to
364#pragma mapbox: initialize lowp float pixel_ratio_from
365#pragma mapbox: initialize lowp float pixel_ratio_to
366vec2 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;
367#ifdef TERRAIN3D
368float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
369#else
370float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
371#endif
372base=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;
373#ifdef GLOBE
374vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
375#else
376gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
377#endif
378vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
379? a_pos
380: 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:jt(`#ifdef GL_ES
381precision highp float;
382#endif
383uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/p
383ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);
384#ifdef OVERDRAW_INSPECTOR
385fragColor=vec4(1.0);
386#endif
387}`,"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:jt(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];
388#define PI 3.141592653589793
389#define STANDARD 0
390#define COMBINED 1
391#define IGOR 2
392#define MULTIDIRECTIONAL 3
393#define BASIC 4
394float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else
395{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else
396{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}
397#ifdef OVERDRAW_INSPECTOR
398fragColor=vec4(1.0);
399#endif
400}`,"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:jt(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
401#ifdef GLOBE
402in float v_depth;
403#endif
404#pragma mapbox: define highp vec4 color
405#pragma mapbox: define lowp float blur
406#pragma mapbox: define lowp float opacity
407void main() {
408#pragma mapbox: initialize highp vec4 color
409#pragma mapbox: initialize lowp float blur
410#pragma mapbox: initialize lowp float opacity
411float 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);
412#ifdef GLOBE
413if (v_depth > 1.0) {discard;}
414#endif
415#ifdef OVERDRAW_INSPECTOR
416fragColor=vec4(1.0);
417#endif
418}`,`
419#define scale 0.015873016
420in 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;
421#ifdef GLOBE
422out float v_depth;
423#endif
424#pragma mapbox: define highp vec4 color
425#pragma mapbox: define lowp float blur
426#pragma mapbox: define lowp float opacity
427#pragma mapbox: define mediump float gapwidth
428#pragma mapbox: define lowp float offset
429#pragma mapbox: define mediump float width
430void main() {
431#pragma mapbox: initialize highp vec4 color
432#pragma mapbox: initialize lowp float blur
433#pragma mapbox: initialize lowp float opacity
434#pragma mapbox: initialize mediump float gapwidth
435#pragma mapbox: initialize lowp float offset
436#pragma mapbox: initialize mediump float width
437float 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);
437float 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;
438#ifdef GLOBE
439v_depth=gl_Position.z/gl_Position.w;
440#endif
441#ifdef TERRAIN3D
442v_gamma_scale=1.0;
443#else
444float 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;
445#endif
446v_width2=vec2(outset,inset);}`),lineGradient:jt(`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;
447#ifdef GLOBE
448in float v_depth;
449#endif
450#pragma mapbox: define lowp float blur
451#pragma mapbox: define lowp float opacity
452void main() {
453#pragma mapbox: initialize lowp float blur
454#pragma mapbox: initialize lowp float opacity
455float 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);
456#ifdef GLOBE
457if (v_depth > 1.0) {discard;}
458#endif
459#ifdef OVERDRAW_INSPECTOR
460fragColor=vec4(1.0);
461#endif
462}`,`
463#define scale 0.015873016
464in 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;
465#ifdef GLOBE
466out float v_depth;
467#endif
468#pragma mapbox: define lowp float blur
469#pragma mapbox: define lowp float opacity
470#pragma mapbox: define mediump float gapwidth
471#pragma mapbox: define lowp float offset
472#pragma mapbox: define mediump float width
473void main() {
474#pragma mapbox: initialize lowp float blur
475#pragma mapbox: initialize lowp float opacity
476#pragma mapbox: initialize mediump float gapwidth
477#pragma mapbox: initialize lowp float offset
478#pragma mapbox: initialize mediump float width
479float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
480#ifdef GLOBE
481v_depth=gl_Position.z/gl_Position.w;
482#endif
483#ifdef TERRAIN3D
484v_gamma_scale=1.0;
485#else
486float 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;
487#endif
488v_width2=vec2(outset,inset);}`),linePattern:jt(`#ifdef GL_ES
489precision highp float;
490#endif
491uniform 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;
492#ifdef GLOBE
493in float v_depth;
494#endif
495#pragma mapbox: define lowp vec4 pattern_from
496#pragma mapbox: define lowp vec4 pattern_to
497#pragma mapbox: define lowp float pixel_ratio_from
498#pragma mapbox: define lowp float pixel_ratio_to
499#pragma mapbox: define lowp float blur
500#pragma mapbox: define lowp float opacity
501void main() {
502#pragma mapbox: initialize mediump vec4 pattern_from
503#pragma mapbox: initialize mediump vec4 pattern_to
504#pragma mapbox: initialize lowp float pixel_ratio_from
505#pragma mapbox: initialize lowp float pixel_ratio_to
506#pragma mapbox: initialize lowp float blur
507#pragma mapbox: initialize lowp float opacity
508vec2 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;
509#ifdef GLOBE
510if (v_depth > 1.0) {discard;}
511#endif
512#ifdef OVERDRAW_INSPECTOR
513fragColor=vec4(1.0);
514#endif
515}`,`
516#define scale 0.015873016
517#define LINE_DISTANCE_SCALE 2.0
518in 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;
519#ifdef GLOBE
520out float v_depth;
521#endif
522#pragma mapbox: define lowp float blur
523#pragma mapbox: define lowp float opacity
524#pragma mapbox: define lowp float offset
525#pragma mapbox: define mediump float gapwidth
526#pragma mapbox: define mediump float width
527#pragma mapbox: define lowp float floorwidth
528#pragma mapbox: define lowp vec4 pattern_from
529#pragma mapbox: define lowp vec4 pattern_to
530#pragma mapbox: define lowp float pixel_ratio_from
531#pragma mapbox: define lowp float pixel_ratio_to
532void main() {
533#pragma mapbox: initialize lowp float blur
534#pragma mapbox: initialize lowp float opacity
535#pragma mapbox: initialize lowp float offset
536#pragma mapbox: initialize mediump float gapwidth
537#pragma mapbox: initialize mediump float width
538#pragma mapbox: initialize lowp float floorwidth
539#pragma mapbox: initialize mediump vec4 pattern_from
540#pragma mapbox: initialize mediump vec4 pattern_to
541#pragma mapbox: initialize lowp float pixel_ratio_from
542#pragma mapbox: initialize lowp float pixel_ratio_to
543float 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);
543float 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;
544#ifdef GLOBE
545v_depth=gl_Position.z/gl_Position.w;
546#endif
547#ifdef TERRAIN3D
548v_gamma_scale=1.0;
549#else
550float 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;
551#endif
552v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:jt(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;
553#ifdef GLOBE
554in float v_depth;
555#endif
556#pragma mapbox: define highp vec4 color
557#pragma mapbox: define lowp float blur
558#pragma mapbox: define lowp float opacity
559#pragma mapbox: define mediump float width
560#pragma mapbox: define lowp float floorwidth
561#pragma mapbox: define mediump vec4 dasharray_from
562#pragma mapbox: define mediump vec4 dasharray_to
563void main() {
564#pragma mapbox: initialize highp vec4 color
565#pragma mapbox: initialize lowp float blur
566#pragma mapbox: initialize lowp float opacity
567#pragma mapbox: initialize mediump float width
568#pragma mapbox: initialize lowp float floorwidth
569#pragma mapbox: initialize mediump vec4 dasharray_from
570#pragma mapbox: initialize mediump vec4 dasharray_to
571float 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);
571float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
572#ifdef GLOBE
573if (v_depth > 1.0) {discard;}
574#endif
575#ifdef OVERDRAW_INSPECTOR
576fragColor=vec4(1.0);
577#endif
578}`,`
579#define scale 0.015873016
580#define LINE_DISTANCE_SCALE 2.0
581in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
582#ifdef GLOBE
583out float v_depth;
584#endif
585#pragma mapbox: define highp vec4 color
586#pragma mapbox: define lowp float blur
587#pragma mapbox: define lowp float opacity
588#pragma mapbox: define mediump float gapwidth
589#pragma mapbox: define lowp float offset
590#pragma mapbox: define mediump float width
591#pragma mapbox: define lowp float floorwidth
592#pragma mapbox: define mediump vec4 dasharray_from
593#pragma mapbox: define mediump vec4 dasharray_to
594void main() {
595#pragma mapbox: initialize highp vec4 color
596#pragma mapbox: initialize lowp float blur
597#pragma mapbox: initialize lowp float opacity
598#pragma mapbox: initialize mediump float gapwidth
599#pragma mapbox: initialize lowp float offset
600#pragma mapbox: initialize mediump float width
601#pragma mapbox: initialize lowp float floorwidth
602#pragma mapbox: initialize mediump vec4 dasharray_from
603#pragma mapbox: initialize mediump vec4 dasharray_to
604float 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;
605#ifdef GLOBE
606v_depth=gl_Position.z/gl_Position.w;
607#endif
608#ifdef TERRAIN3D
609v_gamma_scale=1.0;
610#else
611float 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;
612#endif
613float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:jt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;
614#ifdef GLOBE
615in float v_depth;
616#endif
617#pragma mapbox: define lowp float blur
618#pragma mapbox: define lowp float opacity
619#pragma mapbox: define mediump float width
620#pragma mapbox: define lowp float floorwidth
621#pragma mapbox: define mediump vec4 dasharray_from
622#pragma mapbox: define mediump vec4 dasharray_to
623void main() {
624#pragma mapbox: initialize lowp float blur
625#pragma mapbox: initialize lowp float opacity
626#pragma mapbox: initialize mediump float width
627#pragma mapbox: initialize lowp float floorwidth
628#pragma mapbox: initialize mediump vec4 dasharray_from
629#pragma mapbox: initialize mediump vec4 dasharray_to
630float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
630float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);
631#ifdef GLOBE
632if (v_depth > 1.0) {discard;}
633#endif
634#ifdef OVERDRAW_INSPECTOR
635fragColor=vec4(1.0);
636#endif
637}`,`
638#define scale 0.015873016
639#define LINE_DISTANCE_SCALE 2.0
640in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;
641#ifdef GLOBE
642out float v_depth;
643#endif
644#pragma mapbox: define lowp float blur
645#pragma mapbox: define lowp float opacity
646#pragma mapbox: define mediump float gapwidth
647#pragma mapbox: define lowp float offset
648#pragma mapbox: define mediump float width
649#pragma mapbox: define lowp float floorwidth
650#pragma mapbox: define mediump vec4 dasharray_from
651#pragma mapbox: define mediump vec4 dasharray_to
652void main() {
653#pragma mapbox: initialize lowp float blur
654#pragma mapbox: initialize lowp float opacity
655#pragma mapbox: initialize mediump float gapwidth
656#pragma mapbox: initialize lowp float offset
657#pragma mapbox: initialize mediump float width
658#pragma mapbox: initialize lowp float floorwidth
659#pragma mapbox: initialize mediump vec4 dasharray_from
660#pragma mapbox: initialize mediump vec4 dasharray_to
661float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
662#ifdef GLOBE
663v_depth=gl_Position.z/gl_Position.w;
664#endif
665#ifdef TERRAIN3D
666v_gamma_scale=1.0;
667#else
668float 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;
669#endif
670float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:jt(`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);
671#ifdef OVERDRAW_INSPECTOR
672fragColor=vec4(1.0);
673#endif
674}`,`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;
675#ifdef GLOBE
676if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
677#endif
678v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:jt(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;
679#pragma mapbox: define lowp float opacity
680void main() {
681#pragma mapbox: initialize lowp float opacity
682lowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;
683#ifdef OVERDRAW_INSPECTOR
684fragColor=vec4(1.0);
685#endif
686}`,`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;
687#pragma mapbox: define lowp float opacity
688void main() {
689#pragma mapbox: initialize lowp float opacity
690vec2 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 ?
691camera_to_anchor_distance/u_camera_to_center_distance :
692u_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;
693#ifdef GLOBE
694if(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);}
695#endif
696vec4 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:jt(`#define SDF_PX 8.0
697uniform 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;
698#pragma mapbox: define highp vec4 fill_color
699#pragma mapbox: define highp vec4 halo_color
700#pragma mapbox: define lowp float opacity
701#pragma mapbox: define lowp float halo_width
702#pragma mapbox: define lowp float halo_blur
703void main() {
704#pragma mapbox: initialize highp vec4 fill_color
705#pragma mapbox: initialize highp vec4 halo_color
706#pragma mapbox: initialize lowp float opacity
707#pragma mapbox: initialize lowp float halo_width
708#pragma mapbox: initialize lowp float halo_blur
709float 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);
710#ifdef OVERDRAW_INSPECTOR
711fragColor=vec4(1.0);
712#endif
713}`,`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;
714#pragma mapbox: define highp vec4 fill_color
715#pragma mapbox: define highp vec4 halo_color
716#pragma mapbox: define lowp float opacity
717#pragma mapbox: define lowp float halo_width
718#pragma mapbox: define lowp float halo_blur
719void main() {
720#pragma mapbox: initialize highp vec4 fill_color
721#pragma mapbox: initialize highp vec4 halo_color
722#pragma mapbox: initialize lowp float opacity
723#pragma mapbox: initialize lowp float halo_width
724#pragma mapbox: initialize lowp float halo_blur
725vec2 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 ?
726camera_to_anchor_distance/u_camera_to_center_distance :
727u_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;
728#ifdef GLOBE
729if(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);}
730#endif
731vec4 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:jt(`#define SDF_PX 8.0
732#define SDF 1.0
733#define ICON 0.0
734uniform 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;
735#pragma mapbox: define highp vec4 fill_color
736#pragma mapbox: define highp vec4 halo_color
737#pragma mapbox: define lowp float opacity
738#pragma mapbox: define lowp float halo_width
739#pragma mapbox: define lowp float halo_blur
740void main() {
741#pragma mapbox: initialize highp vec4 fill_color
742#pragma mapbox: initialize highp vec4 halo_color
743#pragma mapbox: initialize lowp float opacity
744#pragma mapbox: initialize lowp float halo_width
745#pragma mapbox: initialize lowp float halo_blur
746float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
746fragColor=texture(u_texture_icon,tex_icon)*alpha;
747#ifdef OVERDRAW_INSPECTOR
748fragColor=vec4(1.0);
749#endif
750return;}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);
751#ifdef OVERDRAW_INSPECTOR
752fragColor=vec4(1.0);
753#endif
754}`,`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;
755#pragma mapbox: define highp vec4 fill_color
756#pragma mapbox: define highp vec4 halo_color
757#pragma mapbox: define lowp float opacity
758#pragma mapbox: define lowp float halo_width
759#pragma mapbox: define lowp float halo_blur
760void main() {
761#pragma mapbox: initialize highp vec4 fill_color
762#pragma mapbox: initialize highp vec4 halo_color
763#pragma mapbox: initialize lowp float opacity
764#pragma mapbox: initialize lowp float halo_width
765#pragma mapbox: initialize lowp float halo_blur
766vec2 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 ?
767camera_to_anchor_distance/u_camera_to_center_distance :
768u_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;
769#ifdef GLOBE
770if(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);}
771#endif
772vec4 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:jt("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);
772float 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:jt("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:jt("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:jt("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:jt(`#ifdef GL_ES
773precision highp float;
774#endif
775in 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
776);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:jt("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: 10,854 bytes, lines 776-825
776function jt(g,t){const a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,c=t.match(/in ([\w]+) ([\w]+)/g),f=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),v=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),b=v?v.concat(f):f,C={};return{fragmentSource:g=g.replace(a,((z,O,U,H,q)=>(C[q]=!0,O==="define"?`
777#ifndef HAS_UNIFORM_u_${q}
778in ${U} ${H} ${q};
779#else
780uniform ${U} ${H} u_${q};
781#endif
782`:`
783#ifdef HAS_UNIFORM_u_${q}
784    ${U} ${H} ${q} = u_${q};
785#endif
786`))),vertexSource:t=t.replace(a,((z,O,U,H,q)=>{const Q=H==="float"?"vec2":"vec4",re=q.match(/color/)?"color":Q;return C[q]?O==="define"?`
787#ifndef HAS_UNIFORM_u_${q}
788uniform lowp float u_${q}_t;
789in ${U} ${Q} a_${q};
790out ${U} ${H} ${q};
791#else
792uniform ${U} ${H} u_${q};
793#endif
794`:re==="vec4"?`
795#ifndef HAS_UNIFORM_u_${q}
796    ${q} = a_${q};
797#else
798    ${U} ${H} ${q} = u_${q};
799#endif
800`:`
801#ifndef HAS_UNIFORM_u_${q}
802    ${q} = unpack_mix_${re}(a_${q}, u_${q}_t);
803#else
804    ${U} ${H} ${q} = u_${q};
805#endif
806`:O==="define"?`
807#ifndef HAS_UNIFORM_u_${q}
808uniform lowp float u_${q}_t;
809in ${U} ${Q} a_${q};
810#else
811uniform ${U} ${H} u_${q};
812#endif
813`:re==="vec4"?`
814#ifndef HAS_UNIFORM_u_${q}
815    ${U} ${H} ${q} = a_${q};
816#else
817    ${U} ${H} ${q} = u_${q};
818#endif
819`:`
820#ifndef HAS_UNIFORM_u_${q}
821    ${U} ${H} ${q} = unpack_mix_${re}(a_${q}, u_${q}_t);
822#else
823    ${U} ${H} ${q} = u_${q};
824#endif
825`})),staticAttributes:c,staticUniforms:b}}class Ji{constructor(t,a,c){this.vertexBuffer=t,this.indexBuffer=a,this.segments=c}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var aa=u.aU([{name:"a_pos",type:"Int16",components:2}]);const wn="#define PROJECTION_MERCATOR",br="mercator";class Tn{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return br}get shaderDefine(){return wn}get shaderPreludeCode(){return Ni.projectionMercator}get vertexShaderPreludeCode(){return Ni.projectionMercator.vertexSource}get subdivisionGranularity(){return u.aV.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,a,c,f,v){if(this._cachedMesh)return this._cachedMesh;const b=new u.aW;b.emplaceBack(0,0),b.emplaceBack(u.a5,0),b.emplaceBack(0,u.a5),b.emplaceBack(u.a5,u.a5);const C=t.createVertexBuffer(b,aa.members),z=u.aX.simpleSegment(0,0,4,2),O=new u.aY;O.emplaceBack(1,0,2),O.emplaceBack(1,2,3);const U=t.createIndexBuffer(O);return this._cachedMesh=new Ji(C,U,z),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class Hr{constructor(t=0,a=0,c=0,f=0){if(isNaN(t)||t<0||isNaN(a)||a<0||isNaN(c)||c<0||isNaN(f)||f<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=a,this.left=c,this.right=f}interpolate(t,a,c){return a.top!=null&&t.top!=null&&(this.top=u.G.number(t.top,a.top,c)),a.bottom!=null&&t.bottom!=null&&(this.bottom=u.G.number(t.bottom,a.bottom,c)),a.left!=null&&t.left!=null&&(this.left=u.G.number(t.left,a.left,c)),a.right!=null&&t.right!=null&&(this.right=u.G.number(t.right,a.right,c)),this}getCenter(t,a){const c=u.an((this.left+t-this.right)/2,0,t),f=u.an((this.top+a-this.bottom)/2,0,a);return new u.P(c,f)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Hr(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function sa(g,t){if(!g.renderWorldCopies||g.lngRange)return;const a=t.lng-g.center.lng;t.lng+=a>180?-360:a<-180?360:0}function Ti(g){return Math.max(0,Math.floor(g))}class oa{constructor(t,a){var c;this.applyConstrain=(f,v)=>this._constrainOverride!==null?this._constrainOverride(f,v):this._callbacks.defaultConstrain(f,v),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=a?.renderWorldCopies===void 0||!!a?.renderWorldCopies,this._minZoom=a?.minZoom||0,this._maxZoom=a?.maxZoom||22,this._minPitch=a?.minPitch==null?0:a?.minPitch,this._maxPitch=a?.maxPitch==null?60:a?.maxPitch,this._constrainOverride=(c=a?.constrainOverride)!==null&&c!==void 0?c:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new u.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Ti(this._zoom),this._scale=u.aq(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Hr,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,a,c){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=Ti(this._zoom),this._scale=u.aq(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Hr(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!c&&t.autoCalculateNearFarZ,a&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}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(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){t===void 0&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new u.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){const a=u.W(t,-180,180)*Math.PI/180;var c,f,v,b,C,z,O,U,H;this._bearingInRadians!==a&&(this._unmodified=!1,this._bearingInRadians=a,this._calcMatrices(),this._rotationMatrix=X(),c=this._rotationMatrix,v=-this._bearingInRadians,b=(f=this._rotationMatrix)[0],C=f[1],z=f[2],O=f[3],U=Math.sin(v),H=Math.cos(v),c[0]=b*H+z*U,c[1]=C*H+O*U,c[2]=b*-U+z*H,c[3]=C*-U+O*H)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){const a=u.an(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==a&&(this._unmodified=!1,this._pitchInRadians=a,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){const a=t/180*Math.PI;this._rollInRadians!==a&&(this._unmodified=!1,this._rollInRadians=a,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return u.aZ(this._fovInRadians)}setFov(t){t=u.an(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=u.ap(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){const a=this.applyConstrain(this._center,t).zoom;this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this._tileZoom=Math.max(0,Math.floor(a)),this._scale=u.aq(a),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,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(t,a){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=a,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,a,c){this._unmodified=!1,this._edgeInsets.interpolate(t,a,c),this.constrainInternal(),this._calcMatrices()}resize(t,a,c=!0){this._width=t,this._height=a,c&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new yn([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-u.ao,u.ao])}getCameraQueryGeometry(t,a){if(a.length===1)return[a[0],t];{const{minX:c,minY:f,maxX:v,maxY:b}=u.aa.fromPoints(a).extend(t);return[new u.P(c,f),new u.P(v,f),new u.P(v,b),new u.P(c,b),new u.P(c,f)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:a,zoom:c}=this.applyConstrain(this.center,this.zoom);this.setCenter(a),this.setZoom(c),this._unmodified=t,this._constraining=!1}
825_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=u.ar(new Float64Array(16));u.Q(t,t,[this._width/2,-this._height/2,1]),u.O(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=u.ar(new Float64Array(16)),u.Q(t,t,[1,-1,1]),u.O(t,t,[-1,-1,0]),u.Q(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,a,c,f){const v=c!==void 0?c:this.bearing,b=f=f!==void 0?f:this.pitch,{distanceToCenter:C,clampedElevation:z}=this._distanceToCenterFromAltElevationPitch(a,this.elevation,b),{x:O,y:U}=oi(b,v),H=u.a9.fromLngLat(t,a);let q,Q,re=u.a_(1,H.y),de=0;do{if(de+=1,de>10)break;Q=C/re,q=new u.a9(H.x+O*Q,H.y+U*Q),re=1/q.meterInMercatorCoordinateUnits()}while(Math.abs(C-Q*re)>1e-12);return{center:q.toLngLat(),elevation:z,zoom:u.at(this.height/2/Math.tan(this.fovInRadians/2)/Q/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;const a=1/this.worldSize,c=u.as(1,this.center.lat)*this.worldSize,f=u.a9.fromLngLat(this.center,this.elevation),v=f.x/a,b=f.y/a,C=f.z/a,z=this.pitch,O=this.bearing,{x:U,y:H,z:q}=oi(z,O),Q=this.cameraToCenterDistance,re=v+Q*-U,de=b+Q*-H,pe=C+Q*q,{distanceToCenter:fe,clampedElevation:_e}=this._distanceToCenterFromAltElevationPitch(pe/c,t,z),Me=fe*c,me=new u.a9((re+U*Me)*a,(de+H*Me)*a,0).toLngLat(),Ce=u.as(1,me.lat),Le=u.at(this.height/2/Math.tan(this.fovInRadians/2)/fe/Ce/this.tileSize);this._elevation=_e,this._center=me,this.setZoom(Le)}_distanceToCenterFromAltElevationPitch(t,a,c){const f=-Math.cos(u.ap(c)),v=t-a;let b,C=a;return f*v>=0||Math.abs(f)<.1?(b=1e4,C=t+b*f):b=-v/f,{distanceToCenter:b,clampedElevation:C}}getCameraPoint(){const t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const t=u.as(1,this.center.lat)*this.worldSize;return ke(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];const a=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/a,t.canonical.y/a,1/a/u.a5,1/a/u.a5]}}class la{constructor(t,a){this.min=t,this.max=a,this.center=u.a$([],u.b0([],this.min,this.max),.5)}quadrant(t){const a=[t%2==0,t<2],c=u.b1(this.min),f=u.b1(this.max);for(let v=0;v<a.length;v++)c[v]=a[v]?this.min[v]:this.center[v],f[v]=a[v]?this.center[v]:this.max[v];return f[2]=this.max[2],new la(c,f)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let a=!0;for(let c=0;c<t.planes.length;c++){const f=this.intersectsPlane(t.planes[c]);if(f===0)return 0;f===1&&(a=!1)}return a?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let a=t[3],c=t[3];for(let f=0;f<3;f++)t[f]>0?(a+=t[f]*this.min[f],c+=t[f]*this.max[f]):(c+=t[f]*this.min[f],a+=t[f]*this.max[f]);return a>=0?2:c<0?0:1}}class xo{distanceToTile2d(t,a,c,f){const v=f.distanceX([t,a]),b=f.distanceY([t,a]);return Math.hypot(v,b)}getWrap(t,a,c){return c}getTileBoundingVolume(t,a,c,f){var v,b;let C=0,z=0;if(f?.terrain){const U=new u.a2(t.z,a,t.z,t.x,t.y),H=f.terrain.getMinMaxElevation(U);C=(v=H.minElevation)!==null&&v!==void 0?v:Math.min(0,c),z=(b=H.maxElevation)!==null&&b!==void 0?b:Math.max(0,c)}const O=1<<t.z;return new la([a+t.x/O,t.y/O,C],[a+(t.x+1)/O,(t.y+1)/O,z])}allowVariableZoom(t,a){const c=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,f=u.an(78.5-c/2,0,60);return!!a.terrain||t.pitch>f}allowWorldCopies(){return!0}prepareNextFrame(){}}class $r{constructor(t,a,c){this.points=t,this.planes=a,this.aabb=c}static fromInvProjectionMatrix(t,a=1,c=0,f,v){const b=v?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],C=Math.pow(2,c),z=[[-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((q=>(function(Q,re,de,pe){const fe=u.aH([],Q,re),_e=1/fe[3]/de*pe;return u.b6(fe,fe,[_e,_e,1/fe[3],_e])})(q,t,a,C)));
vendor: 75,146 bytes, line 825
825f&&(function(q,Q,re,de){const pe=de?4:0,fe=de?0:4;let _e=0;const Me=[],me=[];for(let we=0;we<4;we++){const Re=u.b2([],q[we+fe],q[we+pe]),Ye=u.b7(Re);u.a$(Re,Re,1/Ye),Me.push(Ye),me.push(Re)}for(let we=0;we<4;we++){const Re=u.b8(q[we+pe],me[we],re);_e=Re!==null&&Re>=0?Math.max(_e,Re):Math.max(_e,Me[we])}const Ce=(function(we,Re){const Ye=u.b2([],we[Re[0]],we[Re[1]]),qe=u.b2([],we[Re[2]],we[Re[1]]),$e=[0,0,0,0];return u.b3($e,u.b4([],Ye,qe)),$e[3]=-u.b5($e,we[Re[0]]),$e})(q,Q),Le=(function(we,Re){const Ye=u.b9(we),qe=u.ba([],we,1/Ye),$e=u.b2([],Re,u.a$([],qe,u.b5(Re,qe))),Xe=u.b9($e);if(Xe>0){const Mt=Math.sqrt(1-qe[3]*qe[3]),At=u.a$([],qe,-qe[3]),pt=u.b0([],At,u.a$([],$e,Mt/Xe));return u.bb(Re,pt)}return null})(re,Ce);if(Le!==null){const we=Le/u.b5(me[0],Ce);_e=Math.min(_e,we)}for(let we=0;we<4;we++){const Re=Math.min(_e,Me[we]);q[we+fe]=[q[we+pe][0]+me[we][0]*Re,q[we+pe][1]+me[we][1]*Re,q[we+pe][2]+me[we][2]*Re,1]}})(z,b[0],f,v);const O=b.map((q=>{const Q=u.b2([],z[q[0]],z[q[1]]),re=u.b2([],z[q[2]],z[q[1]]),de=u.b3([],u.b4([],Q,re)),pe=-u.b5(de,z[q[1]]);return de.concat(pe)})),U=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],H=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const q of z)for(let Q=0;Q<3;Q++)U[Q]=Math.min(U[Q],q[Q]),H[Q]=Math.max(H[Q],q[Q]);return new $r(z,O,new la(U,H))}}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(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,c){return this._helper.interpolatePadding(t,a,c)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,c=!0){this._helper.resize(t,a,c)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}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 constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,a){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(a,c)=>{c=u.an(+c,this.minZoom,this.maxZoom);const f={center:new u.V(a.lng,a.lat),zoom:c};let v=this._helper._lngRange;if(!this._helper._renderWorldCopies&&v===null){const me=179.9999999999;v=[-me,me]}const b=this.tileSize*u.aq(f.zoom);let C=0,z=b,O=0,U=b,H=0,q=0;const{x:Q,y:re}=this.size;if(this._helper._latRange){const me=this._helper._latRange;C=u.X(me[1])*b,z=u.X(me[0])*b,z-C<re&&(H=re/(z-C))}v&&(O=u.W(u.Y(v[0])*b,0,b),U=u.W(u.Y(v[1])*b,0,b),U<O&&(U+=b),U-O<Q&&(q=Q/(U-O)));const{x:de,y:pe}=Ze(b,a);let fe,_e;const Me=Math.max(q||0,H||0);if(Me){const me=new u.P(q?(U+O)/2:de,H?(z+C)/2:pe);return f.center=ct(b,me).wrap(),f.zoom+=u.at(Me),f}if(this._helper._latRange){const me=re/2;pe-me<C&&(_e=C+me),pe+me>z&&(_e=z-me)}if(v){const me=(O+U)/2;let Ce=de;this._helper._renderWorldCopies&&(Ce=u.W(de,me-b/2,me+b/2));const Le=Q/2;Ce-Le<O&&(fe=O+Le),Ce+Le>U&&(fe=U-Le)}if(fe!==void 0||_e!==void 0){const me=new u.P(fe??de,_e??pe);f.center=ct(b,me).wrap()}return f},this.applyConstrain=(a,c)=>this._helper.applyConstrain(a,c),this._helper=new oa({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(a,c)=>this.defaultConstrain(a,c)},t),this._coveringTilesDetailsProvider=new xo}clone(){const t=new $n;return t.apply(this,!1),t}apply(t,a,c){this._helper.apply(t,a,c)}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(t){const a=[new u.bc(0,t)];if(this._helper._renderWorldCopies){const c=this.screenPointToMercatorCoordinate(new u.P(0,0)),f=this.screenPointToMercatorCoordinate(new u.P(this._helper._width,0)),v=this.screenPointToMercatorCoordinate(new u.P(this._helper._width,this._helper._height)),b=this.screenPointToMercatorCoordinate(new u.P(0,this._helper._height)),C=Math.floor(Math.min(c.x,f.x,v.x,b.x)),z=Math.floor(Math.max(c.x,f.x,v.x,b.x)),O=1;for(let U=C-O;U<=z+O;U++)U!==0&&a.push(new u.bc(U,t))}return a}getCameraFrustum(){return $r.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){const a=this.screenPointToLocation(this.centerPoint,t),c=t?t.getElevationForLngLatZoom(a,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(c)}setLocationAtPoint(t,a){const c=u.as(this.elevation,this.center.lat),f=this.screenPointToMercatorCoordinateAtZ(a,c),v=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,c),b=u.a9.fromLngLat(t),C=new u.a9(b.x-(f.x-v.x),b.y-(f.y-v.y));this.setCenter(C?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,a){return a?this.coordinatePoint(u.a9.fromLngLat(t),a.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(u.a9.fromLngLat(t))}screenPointToLocation(t,a){var c;return(c=this.screenPointToMercatorCoordinate(t,a))===null||c===void 0?void 0:c.toLngLat()}screenPointToMercatorCoordinate(t,a){if(a){const c=a.pointCoordinate(t);if(c!=null)return c}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,a){const c=a||0,f=[t.x,t.y,0,1],v=[t.x,t.y,1,1];u.aH(f,f,this._pixelMatrixInverse),u.aH(v,v,this._pixelMatrixInverse);const b=f[3],C=v[3],z=f[1]/b,O=v[1]/C,U=f[2]/b,H=v[2]/C,q=U===H?0:(c-U)/(H-U);return new u.a9(u.G.number(f[0]/b,v[0]/C,q)/this.worldSize,u.G.number(z,O,q)/this.worldSize,c)}coordinatePoint(t,a=0,c=this._pixelMatrix){const f=[t.x*this.worldSize,t.y*this.worldSize,a,1];return u.aH(f,f,c),new u.P(f[0]/f[3],f[1]/f[3])}getBounds(){const t=Math.max(0,this._helper._height/2-it(this));return new yn().extend(this.screenPointToLocation(new u.P(0,t))).extend(this.screenPointToLocation(new u.P(this._helper._width,t))).extend(this.screenPointToLocation(new u.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new u.P(0,this._helper._height)))}isPointOnMapSurface(t,a){return a?a.pointCoordinate(t)!=null:t.y>this.height/2-it(this)}calculatePosMatrix(t,a=!1,c){var f;const v=(f=t.key)!==null&&f!==void 0?f:u.bd(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),b=a?this._alignedPosMatrixCache:this._posMatrixCache;if(b.has(v)){const O=b.get(v);return c?O.f32:O.f64}const C=yt(t,this.worldSize);u.S(C,a?this._alignedProjMatrix:this._viewProjMatrix,C);const z={f64:C,f32:new Float32Array(C)};return b.set(v,z),c?z.f32:z.f64}calculateFogMatrix(t){const a=t.key,c=this._fogMatrixCacheF32;if(c.has(a))return c.get(a);const f=yt(t,this.worldSize);return u.S(f,this._fogMatrix,f),c.set(a,new Float32Array(f)),c.get(a)}calculateCenterFromCameraLngLatAlt(t,a,c,f){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,c,f)}_calculateNearFarZIfNeeded(t,a,c){if(!this._helper.autoCalculateNearFarZ)return;const f=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),v=t-f*this._helper._pixelPerMeter/Math.cos(a),b=f<0?v:t,C=Math.PI/2+this.pitchInRadians,z=u.ap(this.fov)*(Math.abs(Math.cos(u.ap(this.roll)))*this.height+Math.abs(Math.sin(u.ap(this.roll)))*this.width)/this.height*(.5+c.y/this.height),O=Math.sin(z)*b/Math.sin(u.an(Math.PI-C-z,.01,Math.PI-.01)),U=it(this),H=Math.atan(U/this._helper.cameraToCenterDistance),q=u.ap(.75),Q=H>q?2*H*(.5+c.y/(2*U)):q,re=Math.sin(Q)*b/Math.sin(u.an(Math.PI-C-Q,.01,Math.PI-.01)),de=Math.min(O,re);this._helper._farZ=1.01*(Math.cos(Math.PI/2-a)*de+b),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const t=this.centerOffset,a=Ze(this.worldSize,this.center),c=a.x,f=a.y;this._helper._pixelPerMeter=u.as(1,this.center.lat)*this.worldSize;const v=u.ap(Math.min(this.pitch,Ne)),b=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(v));let C;this._calculateNearFarZIfNeeded(b,v,t),C=new Float64Array(16),u.be(C,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),u.aB(this._invProjMatrix,C),C[8]=2*-t.x/this._helper._width,C[9]=2*t.y/this._helper._height,this._projectionMatrix=u.bf(C),u.Q(C,C,[1,-1,1]),u.O(C,C,[0,0,-this._helper.cameraToCenterDistance]),u.bg(C,C,-this.rollInRadians),u.bh(C,C,this.pitchInRadians),u.bg(C,C,-this.bearingInRadians),u.O(C,C,[-c,-f,0]),this._mercatorMatrix=u.Q([],C,[this.worldSize,this.worldSize,this.worldSize]),u.Q(C,C,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=u.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,C),u.O(C,C,[0,0,-this.elevation]),this._viewProjMatrix=C,this._invViewProjMatrix=u.aB([],C);const z=[0,0,-1,1];u.aH(z,z,this._invViewProjMatrix),this._cameraPosition=[z[0]/z[3],z[1]/z[3],z[2]/z[3]],this._fogMatrix=new Float64Array(16),u.be(this._fogMatrix,this.fovInRadians,this.width/this.height,b,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,u.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),u.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),u.bg(this._fogMatrix,this._fogMatrix,-this.rollInRadians),u.bh(this._fogMatrix,this._fogMatrix,this.pitchInRadians),u.bg(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),u.O(this._fogMatrix,this._fogMatrix,[-c,-f,0]),u.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),u.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=u.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,C);const O=this._helper._width%2/2,U=this._helper._height%2/2,H=Math.cos(this.bearingInRadians),q=Math.sin(-this.bearingInRadians),Q=c-Math.round(c)+H*O+q*U,re=f-Math.round(f)+H*U+q*O,de=new Float64Array(C);if(u.O(de,de,[Q>.5?Q-1:Q,re>.5?re-1:re,0]),this._alignedProjMatrix=de,C=u.aB(new Float64Array(16),this._pixelMatrix),!C)throw new Error("failed to invert matrix");this._pixelMatrixInverse=C,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const t=this.screenPointToMercatorCoordinate(new u.P(0,0)),a=[t.x*this.worldSize,t.y*this.worldSize,0,1];return u.aH(a,a,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const t=u.as(1,this.center.lat)*this.worldSize;return ke(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,a){const c=u.a9.fromLngLat(t),f=[c.x*this.worldSize,c.y*this.worldSize,a,1];return u.aH(f,f,this._viewProjMatrix),f[2]/f[3]}getProjectionData(t){const{overscaledTileID:a,aligned:c,applyTerrainMatrix:f}=t,v=this._helper.getMercatorTileCoordinates(a),b=a?this.calculatePosMatrix(a,c,!0):null;let C;return C=a&&a.terrainRttPosMatrix32f&&f?a.terrainRttPosMatrix32f:b||u.bi(),{mainMatrix:C,tileMercatorCoords:v,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:C}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,a,c){return 1}transformLightDirection(t){return u.b1(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,a,c,f){const v=this.calculatePosMatrix(c);let b;f?(b=[t,a,f(t,a),1],u.aH(b,b,v)):(b=[t,a,0,1],qr(b,b,v));const C=b[3];return{point:new u.P(b[0]/C,b[1]/C),signedDistanceFromCamera:C,isOccluded:!1}}populateCache(t){for(const a of t)this.calculatePosMatrix(a)}getMatrixForModel(t,a){const c=u.a9.fromLngLat(t,a),f=c.meterInMercatorCoordinateUnits(),v=u.bj();return u.O(v,v,[c.x,c.y,c.z]),u.bg(v,v,Math.PI),u.bh(v,v,Math.PI/2),u.Q(v,v,[-f,f,f]),v}getProjectionDataForCustomLayer(t=!0){const a=new u.a2(0,0,0,0,0),c=this.getProjectionData({overscaledTileID:a,applyGlobeMatrix:t}),f=yt(a,this.worldSize);u.S(f,this._viewProjMatrix,f),c.tileMercatorCoords=[0,0,1,1];const v=[u.a5,u.a5,this.worldSize/this._helper.pixelsPerMeter],b=u.bk();return u.Q(b,f,v),c.fallbackMatrix=b,c.mainMatrix=b,c}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function wr(){u.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function eu(g){if(g.useSlerp)if(g.k<1){const t=u.bl(g.startEulerAngles.roll,g.startEulerAngles.pitch,g.startEulerAngles.bearing),a=u.bl(g.endEulerAngles.roll,g.endEulerAngles.pitch,g.endEulerAngles.bearing),c=new Float64Array(4);u.bm(c,t,a,g.k);const f=u.bn(c);g.tr.setRoll(f.roll),g.tr.setPitch(f.pitch),g.tr.setBearing(f.bearing)}else g.tr.setRoll(g.endEulerAngles.roll),g.tr.setPitch(g.endEulerAngles.pitch),g.tr.setBearing(g.endEulerAngles.bearing);else g.tr.setRoll(u.G.number(g.startEulerAngles.roll,g.endEulerAngles.roll,g.k)),g.tr.setPitch(u.G.number(g.startEulerAngles.pitch,g.endEulerAngles.pitch,g.k)),g.tr.setBearing(u.G.number(g.startEulerAngles.bearing,g.endEulerAngles.bearing,g.k))}function bo(g,t,a,c,f){const v=f.padding,b=Ze(f.worldSize,a.getNorthWest()),C=Ze(f.worldSize,a.getNorthEast()),z=Ze(f.worldSize,a.getSouthEast()),O=Ze(f.worldSize,a.getSouthWest()),U=u.ap(-c),H=b.rotate(U),q=C.rotate(U),Q=z.rotate(U),re=O.rotate(U),de=new u.P(Math.max(H.x,q.x,re.x,Q.x),Math.max(H.y,q.y,re.y,Q.y)),pe=new u.P(Math.min(H.x,q.x,re.x,Q.x),Math.min(H.y,q.y,re.y,Q.y)),fe=de.sub(pe),_e=(f.width-(v.left+v.right+t.left+t.right))/fe.x,Me=(f.height-(v.top+v.bottom+t.top+t.bottom))/fe.y;if(Me<0||_e<0)return void wr();const me=Math.min(u.at(f.scale*Math.min(_e,Me)),g.maxZoom),Ce=u.P.convert(g.offset),Le=new u.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(u.ap(c)),we=Ce.add(Le).mult(f.scale/u.aq(me));return{center:ct(f.worldSize,b.add(z).div(2).sub(we)),zoom:me,bearing:c}}class Ci{get useGlobeControls(){return!1}handlePanInertia(t,a){const c=t.mag(),f=Math.abs(it(a));return{easingOffset:t.mult(Math.min(.75*f/c,1)),easingCenter:a.center}}handleMapControlsRollPitchBearingZoom(t,a){t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta),t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta)}handleMapControlsPan(t,a,c){t.around.distSqr(a.centerPoint)<.01||a.setLocationAtPoint(c,t.around)}cameraForBoxAndBearing(t,a,c,f,v){return bo(t,a,c,f,v)}handleJumpToCenterZoom(t,a){t.zoom!==(a.zoom!==void 0?+a.zoom:t.zoom)&&t.setZoom(+a.zoom),a.center!==void 0&&t.setCenter(u.V.convert(a.center))}handleEaseTo(t,a){const c=t.zoom,f=t.padding,v={roll:t.roll,pitch:t.pitch,bearing:t.bearing},b={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},C=a.zoom!==void 0,z=!t.isPaddingEqual(a.padding);let O=!1;const U=C?+a.zoom:t.zoom;let H=t.centerPoint.add(a.offsetAsPoint);const q=t.screenPointToLocation(H),{center:Q,zoom:re}=t.applyConstrain(u.V.convert(a.center||q),U??c);sa(t,Q);const de=Ze(t.worldSize,q),pe=Ze(t.worldSize,Q).sub(de),fe=u.aq(re-c);return O=re!==c,{easeFunc:_e=>{if(O&&t.setZoom(u.G.number(c,re,_e)),u.bo(v,b)||eu({startEulerAngles:v,endEulerAngles:b,tr:t,k:_e,useSlerp:v.roll!=b.roll}),z&&(t.interpolatePadding(f,a.padding,_e),H=t.centerPoint.add(a.offsetAsPoint)),a.around)t.setLocationAtPoint(a.around,a.aroundPoint);else{const Me=u.aq(t.zoom-c),me=re>c?Math.min(2,fe):Math.max(.5,fe),Ce=Math.pow(me,1-_e),Le=ct(t.worldSize,de.add(pe.mult(_e*Ce)).mult(Me));t.setLocationAtPoint(t.renderWorldCopies?Le.wrap():Le,H)}},isZooming:O,elevationCenter:Q}}handleFlyTo(t,a){const c=a.zoom!==void 0,f=t.zoom,v=t.applyConstrain(u.V.convert(a.center||a.locationAtOffset),c?+a.zoom:f),b=v.center,C=v.zoom;sa(t,b);const z=Ze(t.worldSize,a.locationAtOffset),O=Ze(t.worldSize,b).sub(z),U=O.mag(),H=u.aq(C-f);let q;if(a.minZoom!==void 0){const Q=Math.min(+a.minZoom,f,C),re=t.applyConstrain(b,Q).zoom;q=u.aq(re-f)}return{easeFunc:(Q,re,de,pe)=>{t.setZoom(Q===1?C:f+u.at(re));const fe=Q===1?b:ct(t.worldSize,z.add(O.mult(de)).mult(re));t.setLocationAtPoint(t.renderWorldCopies?fe.wrap():fe,pe)},scaleOfZoom:H,targetCenter:b,scaleOfMinZoom:q,pixelPathLength:U}}}class en{constructor(t,a,c){this.blendFunction=t,this.blendColor=a,this.mask=c}}en.Replace=[1,0],en.disabled=new en(en.Replace,u.bp.transparent,[!1,!1,!1,!1]),en.unblended=new en(en.Replace,u.bp.transparent,[!0,!0,!0,!0]),en.alphaBlended=new en([1,771],u.bp.transparent,[!0,!0,!0,!0]);const mr=2305;class bi{constructor(t,a,c){this.enable=t,this.mode=a,this.frontFace=c}}bi.disabled=new bi(!1,1029,mr),bi.backCCW=new bi(!0,1029,mr),bi.frontCCW=new bi(!0,1028,mr);class pi{constructor(t,a,c){this.func=t,this.mask=a,this.range=c}}pi.ReadOnly=!1,pi.ReadWrite=!0,pi.disabled=new pi(519,pi.ReadOnly,[0,1]);const Jo=7680;class Di{constructor(t,a,c,f,v,b){this.test=t,this.ref=a,this.mask=c,this.fail=f,this.depthFail=v,this.pass=b}}Di.disabled=new Di({func:519,mask:0},0,0,Jo,Jo,Jo);const tu=new WeakMap;function Ea(g){var t;if(tu.has(g))return tu.get(g);{const a=(t=g.getParameter(g.VERSION))===null||t===void 0?void 0:t.startsWith("WebGL 2.0");return tu.set(g,a),a}}class wo{get awaitingQuery(){return!!this._readbackQueue}constructor(t){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=t;const a=t.context,c=a.gl;this._texFormat=c.RGBA,this._texType=c.UNSIGNED_BYTE;const f=new u.aW;f.emplaceBack(-1,-1),f.emplaceBack(2,-1),f.emplaceBack(-1,2);const v=new u.aY;v.emplaceBack(0,1,2),this._fullscreenTriangle=new Ji(a.createVertexBuffer(f,aa.members),a.createIndexBuffer(v),u.aX.simpleSegment(0,0,f.length,v.length)),this._resultBuffer=new Uint8Array(4),a.activeTexture.set(c.TEXTURE1);const b=c.createTexture();c.bindTexture(c.TEXTURE_2D,b),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST),c.texImage2D(c.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=a.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(b),Ea(c)&&(this._pbo=c.createBuffer(),c.bindBuffer(c.PIXEL_PACK_BUFFER,this._pbo),c.bufferData(c.PIXEL_PACK_BUFFER,4,c.STREAM_READ),c.bindBuffer(c.PIXEL_PACK_BUFFER,null))}destroy(){const t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,a){const c=this._updateCount;return this._readbackQueue?c>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():c>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,a),this._updateCount++,this._measuredError}_bindFramebuffer(){const t=this._cachedRenderContext.context,a=t.gl;t.activeTexture.set(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,a){const c=this._cachedRenderContext.context,f=c.gl;if(this._bindFramebuffer(),c.viewport.set([0,0,this._texWidth,this._texHeight]),c.clear({color:u.bp.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(c,f.TRIANGLES,pi.disabled,Di.disabled,en.unblended,bi.disabled,((v,b)=>({u_input:v,u_output_expected:b}))(t,a),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&Ea(f)){f.bindBuffer(f.PIXEL_PACK_BUFFER,this._pbo),f.readBuffer(f.COLOR_ATTACHMENT0),f.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),f.bindBuffer(f.PIXEL_PACK_BUFFER,null);const v=f.fenceSync(f.SYNC_GPU_COMMANDS_COMPLETE,0);f.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:v}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&Ea(t)){const a=t.clientWaitSync(this._readbackQueue.sync,0,0);if(a===t.WAIT_FAILED)return u.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(a===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=wo._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let a=0;return a+=t[0]/256,a+=t[1]/65536,a+=t[2]/16777216,t[3]<127&&(a=-a),a/128}}const To=u.a5/128;function Vu(g,t){const a=g.granularity!==void 0?Math.max(g.granularity,1):1,c=a+(g.generateBorders?2:0),f=a+(g.extendToNorthPole||g.generateBorders?1:0)+(g.extendToSouthPole||g.generateBorders?1:0),v=c+1,b=f+1,C=g.generateBorders?-1:0,z=g.generateBorders||g.extendToNorthPole?-1:0,O=a+(g.generateBorders?1:0),U=a+(g.generateBorders||g.extendToSouthPole?1:0),H=v*b,q=c*f*6,Q=v*b>65536;if(Q&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const re=Q||t==="32bit",de=new Int16Array(2*H);let pe=0;for(let Me=z;Me<=U;Me++)for(let me=C;me<=O;me++){let Ce=me/a*u.a5;me===-1&&(Ce=-To),me===a+1&&(Ce=u.a5+To);let Le=Me/a*u.a5;Me===-1&&(Le=g.extendToNorthPole?u.br:-To),Me===a+1&&(Le=g.extendToSouthPole?u.bs:u.a5+To),de[pe++]=Ce,de[pe++]=Le}const fe=re?new Uint32Array(q):new Uint16Array(q);let _e=0;for(let Me=0;Me<f;Me++)for(let me=0;me<c;me++){const Ce=me+1+Me*v,Le=me+(Me+1)*v,we=me+1+(Me+1)*v;fe[_e++]=me+Me*v,fe[_e++]=Le,fe[_e++]=Ce,fe[_e++]=Ce,fe[_e++]=Le,fe[_e++]=we}return{vertices:de.buffer.slice(0),indices:fe.buffer.slice(0),uses32bitIndices:re}}const iu=new u.aV({fill:new u.bt(128,2),line:new u.bt(512,0),tile:new u.bt(128,32),stencil:new u.bt(128,1),circle:3});class Da{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 Ni.projectionGlobe}get vertexShaderPreludeCode(){return Ni.projectionMercator.vertexSource}get subdivisionGranularity(){return iu}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new wo(t));const a=u.X(this._errorQueryLatitudeDegrees),c=2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI,f=this._errorMeasurement.updateErrorLoop(a,c),v=Te();f!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=f,this._errorMeasurementLastChangeTime=v);const b=Math.min(Math.max((v-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=u.bu(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,u.bv(b))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,a,c,f,v){const b=(v==="stencil"?iu.stencil:iu.tile).getGranularityForZoomLevel(a.z);return this._getMesh(t,{granularity:b,generateBorders:c,extendToNorthPole:a.y===0&&f,extendToSouthPole:a.y===(1<<a.z)-1&&f})}_getMesh(t,a){const c=this._getMeshKey(a);if(c in this._tileMeshCache)return this._tileMeshCache[c];const f=(function(v,b){const C=Vu(b,"16bit"),z=u.aW.deserialize({arrayBuffer:C.vertices,length:C.vertices.byteLength/2/2}),O=u.aY.deserialize({arrayBuffer:C.indices,length:C.indices.byteLength/2/3});return new Ji(v.createVertexBuffer(z,aa.members),v.createIndexBuffer(O),u.aX.simpleSegment(0,0,z.length,O.length))})(t,a);return this._tileMeshCache[c]=f,f}recalculate(t){}hasTransition(){const t=Te();let a=!1;return a=a||(t-this._errorMeasurementLastChangeTime)/1e3<.7,a=a||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,a}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}const Hh=new u.t({type:new u.D(u.u.projection.type)});class Zu extends u.E{constructor(t){super(),this._transitionable=new u.x(Hh,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new u.H(0)),this._mercatorProjection=new Tn,this._verticalPerspectiveProjection=new Da}get transitionState(){const t=this.properties.get("type");if(typeof t=="string"&&t==="mercator")return 0;if(typeof t=="string"&&t==="vertical-perspective")return 1;if(t instanceof u.bw){if(t.from==="vertical-perspective"&&t.to==="mercator")return 1-t.transition;if(t.from==="mercator"&&t.to==="vertical-perspective")return t.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(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,a,c,f,v){return this.currentProjection.getMeshFromTileID(t,a,c,f,v)}setProjection(t){this._transitionable.setValue("type",t?.type||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function Zn(g){const t=Gs(g.worldSize,g.center.lat);return 2*Math.PI*t}function Qa(g,t,a,c,f){const v=1/(1<<f),b=t/u.a5*v+c*v,C=u.bz((g/u.a5*v+a*v)*Math.PI*2+Math.PI,2*Math.PI),z=2*Math.atan(Math.exp(Math.PI-b*Math.PI*2))-.5*Math.PI,O=Math.cos(z),U=new Float64Array(3);return U[0]=Math.sin(C)*O,U[1]=Math.sin(z),U[2]=Math.cos(C)*O,U}function xn(g){return(function(t,a){const c=Math.cos(a),f=new Float64Array(3);return f[0]=Math.sin(t)*c,f[1]=Math.sin(a),f[2]=Math.cos(t)*c,f})(g.lng*Math.PI/180,g.lat*Math.PI/180)}function Gs(g,t){return g/(2*Math.PI)/Math.cos(t*Math.PI/180)}function nu(g){const t=Math.asin(g[1])/Math.PI*180,a=Math.sqrt(g[0]*g[0]+g[2]*g[2]);if(a>1e-6){const c=g[0]/a,f=Math.acos(g[2]/a),v=(c>0?f:-f)/Math.PI*180;return new u.V(u.W(v,-180,180),t)}return new u.V(0,t)}function Ll(g){return Math.cos(g*Math.PI/180)}function Pn(g,t){const a=Ll(g),c=Ll(t);return u.at(c/a)}function nh(g,t){const a=g.rotate(t.bearingInRadians),c=t.zoom+Pn(t.center.lat,0),f=u.bu(1/Ll(t.center.lat),1/Ll(Math.min(Math.abs(t.center.lat),60)),u.bx(c,7,3,0,1)),v=360/Zn({worldSize:t.worldSize,center:{lat:t.center.lat}});return new u.V(t.center.lng-a.x*v*f,u.an(t.center.lat+a.y*v,-u.ao,u.ao))}function Gu(g){const t=.5*g,a=Math.sin(t),c=Math.cos(t);return Math.log(a+c)-Math.log(c-a)}function qu(g,t,a,c){const f=g.lat+a*c;if(Math.abs(a)>1){const v=(Math.sign(g.lat+a)!==Math.sign(g.lat)?-Math.abs(g.lat):Math.abs(g.lat))*Math.PI/180,b=Math.abs(g.lat+a)*Math.PI/180,C=Gu(v+c*(b-v)),z=Gu(v),O=Gu(b);return new u.V(g.lng+t*((C-z)/(O-z)),f)}return new u.V(g.lng+t*c,f)}class $h{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;const t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,a,c,f){const v=`${t.z}_${t.x}_${t.y}_${f?.terrain?"t":""}`,b=this._cache.get(v);if(b)return b;const C=this._cachePrevious.get(v);if(C)return this._cache.set(v,C),C;const z=this._boundingVolumeFactory(t,a,c,f);return this._cache.set(v,z),this._hadAnyChanges=!0,z}}class el{constructor(t,a,c,f){this.min=c,this.max=f,this.points=t,this.planes=a}static fromAabb(t,a){const c=[];for(let f=0;f<8;f++)c.push([1&~f?t[0]:a[0],(f>>1&1)==1?a[1]:t[1],(f>>2&1)==1?a[2]:t[2]]);return new el(c,[[-1,0,0,a[0]],[1,0,0,-t[0]],[0,-1,0,a[1]],[0,1,0,-t[1]],[0,0,-1,a[2]],[0,0,1,-t[2]]],t,a)}static fromCenterSizeAngles(t,a,c){const f=u.bB([],c[0],c[1],c[2]),v=u.bC([],[a[0],0,0],f),b=u.bC([],[0,a[1],0],f),C=u.bC([],[0,0,a[2]],f),z=[...t],O=[...t];for(let H=0;H<8;H++)for(let q=0;q<3;q++){const Q=t[q]+v[q]*(1&~H?-1:1)+b[q]*((H>>1&1)==1?1:-1)+C[q]*((H>>2&1)==1?1:-1);z[q]=Math.min(z[q],Q),O[q]=Math.max(O[q],Q)}const U=[];for(let H=0;H<8;H++){const q=[...t];u.b0(q,q,u.a$([],v,1&~H?-1:1)),u.b0(q,q,u.a$([],b,(H>>1&1)==1?1:-1)),u.b0(q,q,u.a$([],C,(H>>2&1)==1?1:-1)),U.push(q)}return new el(U,[[...v,-u.b5(v,U[0])],[...b,-u.b5(b,U[0])],[...C,-u.b5(C,U[0])],[-v[0],-v[1],-v[2],-u.b5(v,U[7])],[-b[0],-b[1],-b[2],-u.b5(b,U[7])],[-C[0],-C[1],-C[2],-u.b5(C,U[7])]],z,O)}intersectsFrustum(t){let a=!0;const c=this.points.length,f=this.planes.length,v=t.planes.length,b=t.points.length;for(let C=0;C<v;C++){const z=t.planes[C];let O=0;for(let U=0;U<c;U++){const H=this.points[U];z[0]*H[0]+z[1]*H[1]+z[2]*H[2]+z[3]>=0&&O++}if(O===0)return 0;O<c&&(a=!1)}if(a)return 2;for(let C=0;C<f;C++){const z=this.planes[C];let O=0;for(let U=0;U<b;U++){const H=t.points[U];z[0]*H[0]+z[1]*H[1]+z[2]*H[2]+z[3]>=0&&O++}if(O===0)return 0}return 1}intersectsPlane(t){const a=this.points.length;let c=0;for(let f=0;f<a;f++){const v=this.points[f];t[0]*v[0]+t[1]*v[1]+t[2]*v[2]+t[3]>=0&&c++}return c===a?2:c===0?0:1}}function ru(g,t,a){const c=g-t;return c<0?-c:Math.max(0,c-a)}function qs(g,t,a,c,f){const v=g-a;let b;return b=v<0?Math.min(-v,1+v-f):v>1?Math.min(Math.max(v-f,0),1-v):0,Math.max(b,ru(t,c,f))}class Hs{constructor(){this._boundingVolumeCache=new $h(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,a,c,f){const v=1<<c.z,b=1/v,C=c.x/v,z=c.y/v;let O=2;return O=Math.min(O,qs(t,a,C,z,b)),O=Math.min(O,qs(t,a,C+.5,-z-b,b)),O=Math.min(O,qs(t,a,C+.5,2-z-b,b)),O}getWrap(t,a,c){const f=1<<a.z,v=1/f,b=a.x/f,C=ru(t.x,b,v),z=ru(t.x,b-1,v),O=ru(t.x,b+1,v),U=Math.min(C,z,O);return U===O?1:U===z?-1:0}allowVariableZoom(t,a){return rn(t,a)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,a,c,f){return this._boundingVolumeCache.getTileBoundingVolume(t,a,c,f)}_computeTileBoundingVolume(t,a,c,f){var v,b;let C=0,z=0;if(f?.terrain){const O=new u.a2(t.z,a,t.z,t.x,t.y),U=f.terrain.getMinMaxElevation(O);C=(v=U.minElevation)!==null&&v!==void 0?v:Math.min(0,c),z=(b=U.maxElevation)!==null&&b!==void 0?b:Math.max(0,c)}if(C/=u.bE,z/=u.bE,C+=1,z+=1,t.z<=0)return el.fromAabb([-z,-z,-z],[z,z,z]);if(t.z===1)return el.fromAabb([t.x===0?-z:0,t.y===0?0:-z,-z],[t.x===0?0:z,t.y===0?z:0,z]);{const O=[Qa(0,0,t.x,t.y,t.z),Qa(u.a5,0,t.x,t.y,t.z),Qa(u.a5,u.a5,t.x,t.y,t.z),Qa(0,u.a5,t.x,t.y,t.z)],U=[];for(const $e of O)U.push(u.a$([],$e,z));if(z!==C)for(const $e of O)U.push(u.a$([],$e,C));t.y===0&&U.push([0,1,0]),t.y===(1<<t.z)-1&&U.push([0,-1,0]);const H=[1,1,1],q=[-1,-1,-1];for(const $e of U)for(let Xe=0;Xe<3;Xe++)H[Xe]=Math.min(H[Xe],$e[Xe]),q[Xe]=Math.max(q[Xe],$e[Xe]);const Q=Qa(u.a5/2,u.a5/2,t.x,t.y,t.z),re=u.b4([],[0,1,0],Q);u.b3(re,re);const de=u.b4([],Q,re);u.b3(de,de);const pe=u.b4([],O[2],O[1]);u.b3(pe,pe);const fe=u.b4([],O[0],O[3]);u.b3(fe,fe),U.push(u.a$([],Q,z)),t.y>=(1<<t.z)/2&&U.push(u.a$([],Qa(u.a5/2,0,t.x,t.y,t.z),z)),t.y<(1<<t.z)/2&&U.push(u.a$([],Qa(u.a5/2,u.a5,t.x,t.y,t.z),z));const _e=au(Q,U),Me=au(de,U),me=[-Q[0],-Q[1],-Q[2],_e.max],Ce=[Q[0],Q[1],Q[2],-_e.min],Le=[-de[0],-de[1],-de[2],Me.max],we=[de[0],de[1],de[2],-Me.min],Re=[...pe,0],Ye=[...fe,0],qe=[];return t.y===0?qe.push(u.bD(Ye,Re,me),u.bD(Ye,Re,Ce)):qe.push(u.bD(Le,Re,me),u.bD(Le,Re,Ce),u.bD(Le,Ye,me),u.bD(Le,Ye,Ce)),t.y===(1<<t.z)-1?qe.push(u.bD(Ye,Re,me),u.bD(Ye,Re,Ce)):qe.push(u.bD(we,Re,me),u.bD(we,Re,Ce),u.bD(we,Ye,me),u.bD(we,Ye,Ce)),new el(qe,[me,Ce,Le,we,Re,Ye],H,q)}}}function au(g,t){let a=1/0,c=-1/0;for(const f of t){const v=u.b5(g,f);a=Math.min(a,v),c=Math.max(c,v)}return{min:a,max:c}}class xs{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,c){return this._helper.interpolatePadding(t,a,c)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a){this._helper.resize(t,a)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}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 constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=u.bF(),this._projectionMatrix=u.bj(),this._globeViewProjMatrix32f=u.bi(),this._globeViewProjMatrixNoCorrection=u.bj(),this._globeViewProjMatrixNoCorrectionInverted=u.bj(),this._globeProjMatrixInverted=u.bj(),this._cameraPosition=u.bA(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(a,c)=>{const f=u.an(a.lat,-u.ao,u.ao),v=u.an(+c,this.minZoom+Pn(0,f),this.maxZoom);return{center:new u.V(a.lng,f),zoom:v}},this.applyConstrain=(a,c)=>this._helper.applyConstrain(a,c),this._helper=new oa({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(a,c)=>this.defaultConstrain(a,c)},t),this._coveringTilesDetailsProvider=new Hs}clone(){const t=new xs;return t.apply(this,!1),t}apply(t,a,c){this._globeLatitudeErrorCorrectionRadians=c||0,this._helper.apply(t,a)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const t=u.bA();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){const{overscaledTileID:a,applyGlobeMatrix:c}=t,f=this._helper.getMercatorTileCoordinates(a);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:f,clippingPlane:this._cachedClippingPlane,projectionTransition:c?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){const a=this.pitchInRadians,c=this.cameraToCenterDistance/t,f=Math.sin(a)*c,v=Math.cos(a)*c+1,b=1/Math.sqrt(f*f+v*v)*1;let C=-f,z=v;const O=Math.sqrt(C*C+z*z);C/=O,z/=O;const U=[0,C,z];u.bG(U,U,[0,0,0],-this.bearingInRadians),u.bH(U,U,[0,0,0],-1*this.center.lat*Math.PI/180),u.bI(U,U,[0,0,0],this.center.lng*Math.PI/180);const H=1/u.b7(U);return u.a$(U,U,H),[...U,-b*H]}isLocationOccluded(t){return!this.isSurfacePointVisible(xn(t))}transformLightDirection(t){const a=this._helper._center.lng*Math.PI/180,c=this._helper._center.lat*Math.PI/180,f=Math.cos(c),v=[Math.sin(a)*f,Math.sin(c),Math.cos(a)*f],b=[v[2],0,-v[0]],C=[0,0,0];u.b4(C,b,v),u.b3(b,b),u.b3(C,C);const z=[0,0,0];return u.b3(z,[b[0]*t[0]+C[0]*t[1]+v[0]*t[2],b[1]*t[0]+C[1]*t[1]+v[1]*t[2],b[2]*t[0]+C[2]*t[1]+v[2]*t[2]]),z}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,a,c){const f=(function(C,z,O){const U=1/(1<<O.z);return new u.a9(C/u.a5*U+O.x*U,z/u.a5*U+O.y*U)})(t,a,c.canonical),v=(b=f.y,[u.bz(f.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-b*Math.PI*2))-.5*Math.PI]);var b;return this.getCircleRadiusCorrection()/Math.cos(v[1])}projectTileCoordinates(t,a,c,f){const v=c.canonical,b=Qa(t,a,v.x,v.y,v.z),C=1+(f?f(t,a):0)/u.bE,z=[b[0]*C,b[1]*C,b[2]*C,1];u.aH(z,z,this._globeViewProjMatrixNoCorrection);const O=this._cachedClippingPlane,U=O[0]*b[0]+O[1]*b[1]+O[2]*b[2]+O[3]<0;return{point:new u.P(z[0]/z[3],z[1]/z[3]),signedDistanceFromCamera:z[3],isOccluded:U}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const t=Gs(this.worldSize,this.center.lat),a=u.bk(),c=u.bk();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),u.be(a,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const f=this.centerOffset;a[8]=2*-f.x/this._helper._width,a[9]=2*f.y/this._helper._height,this._projectionMatrix=u.bf(a),this._globeProjMatrixInverted=u.bk(),u.aB(this._globeProjMatrixInverted,a),u.O(a,a,[0,0,-this.cameraToCenterDistance]),u.bg(a,a,this.rollInRadians),u.bh(a,a,-this.pitchInRadians),u.bg(a,a,this.bearingInRadians),u.O(a,a,[0,0,-t]);const v=u.bA();v[0]=t,v[1]=t,v[2]=t,u.bh(c,a,this.center.lat*Math.PI/180),u.bJ(c,c,-this.center.lng*Math.PI/180),u.Q(c,c,v),this._globeViewProjMatrixNoCorrection=c,u.bh(a,a,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),u.bJ(a,a,-this.center.lng*Math.PI/180),u.Q(a,a,v),this._globeViewProjMatrix32f=new Float32Array(a),this._globeViewProjMatrixNoCorrectionInverted=u.bk(),u.aB(this._globeViewProjMatrixNoCorrectionInverted,c);const b=u.bA();this._cameraPosition=u.bA(),this._cameraPosition[2]=this.cameraToCenterDistance/t,u.bG(this._cameraPosition,this._cameraPosition,b,-this.rollInRadians),u.bH(this._cameraPosition,this._cameraPosition,b,this.pitchInRadians),u.bG(this._cameraPosition,this._cameraPosition,b,-this.bearingInRadians),u.b0(this._cameraPosition,this._cameraPosition,[0,0,1]),u.bH(this._cameraPosition,this._cameraPosition,b,-this.center.lat*Math.PI/180),u.bI(this._cameraPosition,this._cameraPosition,b,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);const C=u.bf(this._globeViewProjMatrixNoCorrectionInverted);u.Q(C,C,[1,1,-1]),this._cachedFrustum=$r.fromInvProjectionMatrix(C,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){u.w("calculateFogMatrix is not supported on globe projection.");const a=u.bk();return u.ar(a),a}getVisibleUnwrappedCoordinates(t){return[new u.bc(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&u.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(t,a){if(!this._globeViewProjMatrixNoCorrection)return 1;const c=xn(t);u.a$(c,c,1+a/u.bE);const f=u.bF();return u.aH(f,[c[0],c[1],c[2],1],this._globeViewProjMatrixNoCorrection),f[2]/f[3]}populateCache(t){}getBounds(){const t=.5*this.width,a=.5*this.height,c=[new u.P(0,0),new u.P(t,0),new u.P(this.width,0),new u.P(this.width,a),new u.P(this.width,this.height),new u.P(t,this.height),new u.P(0,this.height),new u.P(0,a)],f=[];for(const H of c)f.push(this.unprojectScreenPoint(H));let v=0,b=0,C=0,z=0;const O=this.center;for(const H of f){const q=u.bK(O.lng,H.lng),Q=u.bK(O.lat,H.lat);q<b&&(b=q),q>v&&(v=q),Q<z&&(z=Q),Q>C&&(C=Q)}const U=[O.lng+b,O.lat+z,O.lng+v,O.lat+C];return this.isSurfacePointOnScreen([0,1,0])&&(U[3]=90,U[0]=-180,U[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(U[1]=-90,U[0]=-180,U[2]=180),new yn(U)}calculateCenterFromCameraLngLatAlt(t,a,c,f){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,c,f)}setLocationAtPoint(t,a){const c=xn(this.unprojectScreenPoint(a)),f=xn(t),v=u.bA();u.bL(v);const b=u.bA();u.bI(b,c,v,-this.center.lng*Math.PI/180),u.bH(b,b,v,this.center.lat*Math.PI/180);const C=f[0]*f[0]+f[2]*f[2],z=b[0]*b[0];if(C<z)return;const O=Math.sqrt(C-z),U=-O,H=u.bM(f[0],f[2],b[0],O),q=u.bM(f[0],f[2],b[0],U),Q=u.bA();u.bI(Q,f,v,-H);const re=u.bM(Q[1],Q[2],b[1],b[2]),de=u.bA();u.bI(de,f,v,-q);const pe=u.bM(de[1],de[2],b[1],b[2]),fe=.5*Math.PI,_e=re>=-fe&&re<=fe,Me=pe>=-fe&&pe<=fe;let me,Ce;if(_e&&Me){const Ye=this.center.lng*Math.PI/180,qe=this.center.lat*Math.PI/180;u.bN(H,Ye)+u.bN(re,qe)<u.bN(q,Ye)+u.bN(pe,qe)?(me=H,Ce=re):(me=q,Ce=pe)}else if(_e)me=H,Ce=re;else{if(!Me)return;me=q,Ce=pe}const Le=me/Math.PI*180,we=Ce/Math.PI*180,Re=this.center.lat;this.setCenter(new u.V(Le,u.an(we,-90,90))),this.setZoom(this.zoom+Pn(Re,this.center.lat))}locationToScreenPoint(t,a){const c=xn(t);if(a){const f=a.getElevationForLngLatZoom(t,this._helper._tileZoom);u.a$(c,c,1+f/u.bE)}return this._projectSurfacePointToScreen(c)}_projectSurfacePointToScreen(t){const a=u.bF();return u.aH(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],new u.P((.5*a[0]+.5)*this.width,(.5*-a[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,a){if(a){const c=a.pointCoordinate(t);if(c)return c}return u.a9.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,a){var c;return(c=this.screenPointToMercatorCoordinate(t,a))===null||c===void 0?void 0:c.toLngLat()}isPointOnMapSurface(t,a){const c=this._cameraPosition,f=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(c,f)}getRayDirectionFromPixel(t){const a=u.bF();a[0]=t.x/this.width*2-1,a[1]=-1*(t.y/this.height*2-1),a[2]=1,a[3]=1,u.aH(a,a,this._globeViewProjMatrixNoCorrectionInverted),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3];const c=u.bA();c[0]=a[0]-this._cameraPosition[0],c[1]=a[1]-this._cameraPosition[1],c[2]=a[2]-this._cameraPosition[2];const f=u.bA();return u.b3(f,c),f}isSurfacePointVisible(t){const a=this._cachedClippingPlane;return a[0]*t[0]+a[1]*t[1]+a[2]*t[2]+a[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;const a=u.bF();return u.aH(a,[...t,1],this._globeViewProjMatrixNoCorrection),a[0]/=a[3],a[1]/=a[3],a[2]/=a[3],a[0]>-1&&a[0]<1&&a[1]>-1&&a[1]<1&&a[2]>-1&&a[2]<1}rayPlanetIntersection(t,a){const c=u.b5(t,a),f=u.bA(),v=u.bA();u.a$(v,a,c),u.b2(f,t,v);const b=1-u.b5(f,f);if(b<0)return null;const C=u.b5(t,t)-1,z=-c+(c<0?1:-1)*Math.sqrt(b),O=C/z,U=z;return{tMin:Math.min(O,U),tMax:Math.max(O,U)}}unprojectScreenPoint(t){const a=this._cameraPosition,c=this.getRayDirectionFromPixel(t),f=this.rayPlanetIntersection(a,c);if(f){const U=u.bA();u.b0(U,a,[c[0]*f.tMin,c[1]*f.tMin,c[2]*f.tMin]);const H=u.bA();return u.b3(H,U),nu(H)}const v=this._cachedClippingPlane,b=v[0]*c[0]+v[1]*c[1]+v[2]*c[2],C=-u.bb(v,a)/b,z=u.bA();if(C>0)u.b0(z,a,[c[0]*C,c[1]*C,c[2]*C]);else{const U=u.bA();u.b0(U,a,[2*c[0],2*c[1],2*c[2]]);const H=u.bb(this._cachedClippingPlane,U);u.b2(z,U,[this._cachedClippingPlane[0]*H,this._cachedClippingPlane[1]*H,this._cachedClippingPlane[2]*H])}const O=(function(U){const H=u.bA();return H[0]=U[0]*-U[3],H[1]=U[1]*-U[3],H[2]=U[2]*-U[3],{center:H,radius:Math.sqrt(1-U[3]*U[3])}})(v);return nu((function(U,H,q){const Q=u.bA();u.b2(Q,q,U);const re=u.bA();return u.by(re,U,Q,H/u.b9(Q)),re})(O.center,O.radius,z))}getMatrixForModel(t,a){const c=u.V.convert(t),f=1/u.bE,v=u.bj();return u.bJ(v,v,c.lng/180*Math.PI),u.bh(v,v,-c.lat/180*Math.PI),u.O(v,v,[0,0,1+a/u.bE]),u.bh(v,v,.5*Math.PI),u.Q(v,v,[f,f,f]),v}getProjectionDataForCustomLayer(t=!0){const a=this.getProjectionData({overscaledTileID:new u.a2(0,0,0,0,0),applyGlobeMatrix:t});return a.tileMercatorCoords=[0,0,1,1],a}getFastPathSimpleProjectionMatrix(t){}}class Tr{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(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,a,c){return this._helper.interpolatePadding(t,a,c)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,a,c=!0){this._helper.resize(t,a,c)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,a){this._helper.overrideNearFarZ(t,a)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}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 constrainOverride(){return this._helper.constrainOverride}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(t,a){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=a,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(a,c)=>this.currentTransform.defaultConstrain(a,c),this.applyConstrain=(a,c)=>this._helper.applyConstrain(a,c),this._helper=new oa({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(a,c)=>this.defaultConstrain(a,c)},t),this._globeness=1,this._mercatorTransform=new $n,this._verticalPerspectiveTransform=new xs}clone(){const t=new Tr;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,a){this._helper.apply(t,a),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,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(t){const a=this._mercatorTransform.getProjectionData(t),c=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?c.mainMatrix:a.mainMatrix,clippingPlane:c.clippingPlane,tileMercatorCoords:c.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:a.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return u.bu(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return u.bu(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,a,c){const f=this._mercatorTransform.getPitchedTextCorrection(t,a,c),v=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,a,c);return u.bu(f,v,this._globeness)}projectTileCoordinates(t,a,c,f){return this.currentTransform.projectTileCoordinates(t,a,c,f)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,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(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,a){return this.currentTransform.lngLatToCameraDepth(t,a)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,a,c,f){return this._helper.calculateCenterFromCameraLngLatAlt(t,a,c,f)}setLocationAtPoint(t,a){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,a),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,a),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,a){return this.currentTransform.locationToScreenPoint(t,a)}screenPointToMercatorCoordinate(t,a){return this.currentTransform.screenPointToMercatorCoordinate(t,a)}screenPointToLocation(t,a){return this.currentTransform.screenPointToLocation(t,a)}isPointOnMapSurface(t,a){return this.currentTransform.isPointOnMapSurface(t,a)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,a){return this.currentTransform.getMatrixForModel(t,a)}getProjectionDataForCustomLayer(t=!0){const a=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return a;const c=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return c.fallbackMatrix=a.mainMatrix,c}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Bn{get useGlobeControls(){return!0}handlePanInertia(t,a){const c=nh(t,a);return Math.abs(c.lng-a.center.lng)>180&&(c.lng=a.center.lng+179.5*Math.sign(c.lng-a.center.lng)),{easingCenter:c,easingOffset:new u.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,a){const c=t.around,f=a.screenPointToLocation(c);t.bearingDelta&&a.setBearing(a.bearing+t.bearingDelta),t.pitchDelta&&a.setPitch(a.pitch+t.pitchDelta),t.rollDelta&&a.setRoll(a.roll+t.rollDelta);const v=a.zoom;t.zoomDelta&&a.setZoom(a.zoom+t.zoomDelta);const b=a.zoom-v;if(b===0)return;const C=u.bK(a.center.lng,f.lng),z=C/(Math.abs(C/180)+1),O=u.bK(a.center.lat,f.lat),U=a.getRayDirectionFromPixel(c),H=a.cameraPosition,q=-1*u.b5(H,U),Q=u.bA();u.b0(Q,H,[U[0]*q,U[1]*q,U[2]*q]);const re=u.b7(Q)-1,de=Math.exp(.5*-Math.max(re-.3,0)),pe=Gs(a.worldSize,a.center.lat)/Math.min(a.width,a.height),fe=u.bx(pe,.9,.5,1,.25),_e=(1-u.aq(-b))*Math.min(de,fe),Me=a.center.lat,me=a.zoom,Ce=new u.V(a.center.lng+z*_e,u.an(a.center.lat+O*_e,-u.ao,u.ao));a.setLocationAtPoint(f,c);const Le=a.center,we=u.bx(Math.abs(C),45,85,0,1),Re=u.bx(pe,.75,.35,0,1),Ye=Math.pow(Math.max(we,Re),.25),qe=u.bK(Le.lng,Ce.lng),$e=u.bK(Le.lat,Ce.lat);a.setCenter(new u.V(Le.lng+qe*Ye,Le.lat+$e*Ye).wrap()),a.setZoom(me+Pn(Me,a.center.lat))}handleMapControlsPan(t,a,c){if(!t.panDelta)return;const f=a.center.lat,v=a.zoom;a.setCenter(nh(t.panDelta,a).wrap()),a.setZoom(v+Pn(f,a.center.lat))}cameraForBoxAndBearing(t,a,c,f,v){const b=bo(t,a,c,f,v),C=a.left/v.width*2-1,z=(v.width-a.right)/v.width*2-1,O=a.top/v.height*-2+1,U=(v.height-a.bottom)/v.height*-2+1,H=u.bK(c.getWest(),c.getEast())<0,q=H?c.getEast():c.getWest(),Q=H?c.getWest():c.getEast(),re=Math.max(c.getNorth(),c.getSouth()),de=Math.min(c.getNorth(),c.getSouth()),pe=q+.5*u.bK(q,Q),fe=re+.5*u.bK(re,de),_e=v.clone();_e.setCenter(b.center),_e.setBearing(b.bearing),_e.setPitch(0),_e.setRoll(0),_e.setZoom(b.zoom);const Me=_e.modelViewProjectionMatrix,me=[xn(c.getNorthWest()),xn(c.getNorthEast()),xn(c.getSouthWest()),xn(c.getSouthEast()),xn(new u.V(Q,fe)),xn(new u.V(q,fe)),xn(new u.V(pe,re)),xn(new u.V(pe,de))],Ce=xn(b.center);let Le=Number.POSITIVE_INFINITY;for(const we of me)C<0&&(Le=Bn.getLesserNonNegativeNonNull(Le,Bn.solveVectorScale(we,Ce,Me,"x",C))),z>0&&(Le=Bn.getLesserNonNegativeNonNull(Le,Bn.solveVectorScale(we,Ce,Me,"x",z))),O>0&&(Le=Bn.getLesserNonNegativeNonNull(Le,Bn.solveVectorScale(we,Ce,Me,"y",O))),U<0&&(Le=Bn.getLesserNonNegativeNonNull(Le,Bn.solveVectorScale(we,Ce,Me,"y",U)));if(Number.isFinite(Le)&&Le!==0)return b.zoom=_e.zoom+u.at(Le),b;wr()}handleJumpToCenterZoom(t,a){const c=t.center.lat,f=t.applyConstrain(a.center?u.V.convert(a.center):t.center,t.zoom).center;t.setCenter(f.wrap());const v=a.zoom!==void 0?+a.zoom:t.zoom+Pn(c,f.lat);t.zoom!==v&&t.setZoom(v)}handleEaseTo(t,a){const c=t.zoom,f=t.center,v=t.padding,b={roll:t.roll,pitch:t.pitch,bearing:t.bearing},C={roll:a.roll===void 0?t.roll:a.roll,pitch:a.pitch===void 0?t.pitch:a.pitch,bearing:a.bearing===void 0?t.bearing:a.bearing},z=a.zoom!==void 0,O=!t.isPaddingEqual(a.padding);let U=!1;const H=a.center?u.V.convert(a.center):f,q=t.applyConstrain(H,c).center;sa(t,q);const Q=t.clone();Q.setCenter(q),Q.setZoom(z?+a.zoom:c+Pn(f.lat,H.lat)),Q.setBearing(a.bearing);const re=new u.P(u.an(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),u.an(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));Q.setLocationAtPoint(q,re);const de=(a.offset&&a.offsetAsPoint.mag())>0?Q.center:q,pe=z?+a.zoom:c+Pn(f.lat,de.lat),fe=c+Pn(f.lat,0),_e=pe+Pn(de.lat,0),Me=u.bK(f.lng,de.lng),me=u.bK(f.lat,de.lat),Ce=u.aq(_e-fe);return U=pe!==c,{easeFunc:Le=>{if(u.bo(b,C)||eu({startEulerAngles:b,endEulerAngles:C,tr:t,k:Le,useSlerp:b.roll!=C.roll}),O&&t.interpolatePadding(v,a.padding,Le),a.around)u.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(a.around,a.aroundPoint);else{const we=_e>fe?Math.min(2,Ce):Math.max(.5,Ce),Re=Math.pow(we,1-Le),Ye=qu(f,Me,me,Le*Re);t.setCenter(Ye.wrap())}if(U){const we=u.G.number(fe,_e,Le)+Pn(0,t.center.lat);t.setZoom(we)}},isZooming:U,elevationCenter:de}}handleFlyTo(t,a){const c=a.zoom!==void 0,f=t.center,v=t.zoom,b=t.padding,C=!t.isPaddingEqual(a.padding),z=t.applyConstrain(u.V.convert(a.center||a.locationAtOffset),v).center,O=c?+a.zoom:t.zoom+Pn(t.center.lat,z.lat),U=t.clone();U.setCenter(z),U.setZoom(O),U.setBearing(a.bearing);const H=new u.P(u.an(t.centerPoint.x+a.offsetAsPoint.x,0,t.width),u.an(t.centerPoint.y+a.offsetAsPoint.y,0,t.height));U.setLocationAtPoint(z,H);const q=U.center;sa(t,q);const Q=(function(me,Ce,Le){const we=xn(Ce),Re=xn(Le),Ye=u.b5(we,Re),qe=Math.acos(Ye),$e=Zn(me);return qe/(2*Math.PI)*$e})(t,f,q),re=v+Pn(f.lat,0),de=O+Pn(q.lat,0),pe=u.aq(de-re);let fe;if(typeof a.minZoom=="number"){const me=+a.minZoom+Pn(q.lat,0),Ce=Math.min(me,re,de)+Pn(0,q.lat),Le=t.applyConstrain(q,Ce).zoom+Pn(q.lat,0);fe=u.aq(Le-re)}const _e=u.bK(f.lng,q.lng),Me=u.bK(f.lat,q.lat);return{easeFunc:(me,Ce,Le,we)=>{const Re=qu(f,_e,Me,Le);C&&t.interpolatePadding(b,a.padding,me);const Ye=me===1?q:Re;t.setCenter(Ye.wrap());const qe=re+u.at(Ce);t.setZoom(me===1?O:qe+Pn(0,Ye.lat))},scaleOfZoom:pe,targetCenter:q,scaleOfMinZoom:fe,pixelPathLength:Q}}static solveVectorScale(t,a,c,f,v){const b=f==="x"?[c[0],c[4],c[8],c[12]]:[c[1],c[5],c[9],c[13]],C=[c[3],c[7],c[11],c[15]],z=t[0]*b[0]+t[1]*b[1]+t[2]*b[2],O=t[0]*C[0]+t[1]*C[1]+t[2]*C[2],U=a[0]*b[0]+a[1]*b[1]+a[2]*b[2],H=a[0]*C[0]+a[1]*C[1]+a[2]*C[2];return U+v*O===z+v*H||C[3]*(z-U)+b[3]*(H-O)+z*H==U*O?null:(U+b[3]-v*H-v*C[3])/(U-z-v*H+v*O)}static getLesserNonNegativeNonNull(t,a){return a!==null&&a>=0&&a<t?a:t}}class tl{constructor(t){this._globe=t,this._mercatorCameraHelper=new Ci,this._verticalPerspectiveCameraHelper=new Bn}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,a){return this.currentHelper.handlePanInertia(t,a)}handleMapControlsRollPitchBearingZoom(t,a){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,a)}handleMapControlsPan(t,a,c){this.currentHelper.handleMapControlsPan(t,a,c)}cameraForBoxAndBearing(t,a,c,f,v){return this.currentHelper.cameraForBoxAndBearing(t,a,c,f,v)}handleJumpToCenterZoom(t,a){this.currentHelper.handleJumpToCenterZoom(t,a)}handleEaseTo(t,a){return this.currentHelper.handleEaseTo(t,a)}handleFlyTo(t,a){return this.currentHelper.handleFlyTo(t,a)}}const Dl=(g,t)=>u.B(g,t&&t.filter((a=>a.identifier!=="source.canvas"))),So=u.bO();class bs extends u.E{constructor(t,a={}){var c,f;super(),this._rtlPluginLoaded=()=>{for(const b in this.tileManagers){const C=this.tileManagers[b].getSource().type;C!=="vector"&&C!=="geojson"||this.tileManagers[b].reload()}},this.map=t,this.dispatcher=new vr(Wi(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((b,C)=>this.getGlyphs(b,C))),this.dispatcher.registerMessageHandler("GI",((b,C)=>this.getImages(b,C))),this.dispatcher.registerMessageHandler("GDA",((b,C)=>this.getDashes(b,C))),this.imageManager=new Xt,this.imageManager.setEventedParent(this);const v=((c=t._container)===null||c===void 0?void 0:c.lang)||typeof document<"u"&&((f=document.documentElement)===null||f===void 0?void 0:f.lang)||void 0;this.glyphManager=new mt(t._requestManager,a.localIdeographFontFamily,v),this.lineAtlas=new Et(256,512),this.crossTileSymbolIndex=new or,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",u.bP()),ae().on(Be,this._rtlPluginLoaded),this.on("data",(b=>{if(b.dataType!=="source"||b.sourceDataType!=="metadata")return;const C=this.tileManagers[b.sourceId];if(!C)return;const z=C.getSource();if(z&&z.vectorLayerIds)for(const O in this._layers){const U=this._layers[O];U.source===z.id&&this._validateLayer(U)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new u.bQ,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(((t=this.crossTileSymbolIndex)===null||t===void 0?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,a){var c,f,v;this._checkLoaded();const b=a===null?(v=(f=(c=this.stylesheet.state)===null||c===void 0?void 0:c[t])===null||f===void 0?void 0:f.default)!==null&&v!==void 0?v:null:a;if(u.bR(b,this._globalState[t]))return this;this._globalState[t]=b,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();const a=[];for(const c in t)!u.bR(this._globalState[c],t[c].default)&&(a.push(c),this._globalState[c]=t[c].default);this._applyGlobalStateChanges(a)}_applyGlobalStateChanges(t){if(t.length===0)return;const a=new Set,c={};for(const f of t){c[f]=this._globalState[f];for(const v in this._layers){const b=this._layers[v],C=b.getLayoutAffectingGlobalStateRefs(),z=b.getPaintAffectingGlobalStateRefs(),O=b.getVisibilityAffectingGlobalStateRefs();if(C.has(f)&&a.add(b.source),z.has(f))for(const{name:U,value:H}of z.get(f))this._updatePaintProperty(b,U,H);O?.has(f)&&(b.recalculateVisibility(),this._updateLayer(b))}}this.dispatcher.broadcast("UGS",c);for(const f in this.tileManagers)a.has(f)&&(this._reloadSource(f),this._changed=!0)}loadURL(t,a={},c){this.fire(new u.l("dataloading",{dataType:"style"})),a.validate=typeof a.validate!="boolean"||a.validate;const f=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const v=this._loadStyleRequest;u.j(f,this._loadStyleRequest).then((b=>{this._loadStyleRequest=null,this._load(b.data,a,c)})).catch((b=>{this._loadStyleRequest=null,b&&!v.signal.aborted&&this.fire(new u.k(b))}))}loadJSON(t,a={},c){this.fire(new u.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,Se.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(t,a,c)})).catch((()=>{}))}loadEmpty(){this.fire(new u.l("dataloading",{dataType:"style"})),this._load(So,{validate:!1})}_load(t,a,c){var f,v;let b=a.transformStyle?a.transformStyle(c,t):t;if(!a.validate||!Dl(this,u.C(b))){b=Object.assign({},b),this._loaded=!0,this.stylesheet=b;for(const C in b.sources)this.addSource(C,b.sources[C],{validate:!1});b.sprite?this._loadSprite(b.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(b.glyphs),this._createLayers(),this.light=new It(this.stylesheet.light),this._setProjectionInternal(((f=this.stylesheet.projection)===null||f===void 0?void 0:f.type)||"mercator"),this.sky=new rt(this.stylesheet.sky),this.map.setTerrain((v=this.stylesheet.terrain)!==null&&v!==void 0?v:null),this.fire(new u.l("data",{dataType:"style"})),this.fire(new u.l("style.load"))}}_createLayers(){var t,a,c;const f=u.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",f),this._order=f.map((v=>v.id)),this._layers={},this._serializedLayers=null;for(const v of f){const b=u.bT(v,this._globalState);if(b.setEventedParent(this,{layer:{id:v.id}}),this._layers[v.id]=b,u.bU(b)&&this.tileManagers[b.source]){const C=(c=(a=v.paint)===null||a===void 0?void 0:a["raster-fade-duration"])!==null&&c!==void 0?c:b.paint.get("raster-fade-duration");this.tileManagers[b.source].setRasterFadeDuration(C)}}}_loadSprite(t,a=!1,c=void 0){this.imageManager.setLoaded(!1);const f=new AbortController;let v;this._spriteRequest=f,(function(b,C,z,O){return u._(this,void 0,void 0,(function*(){const U=Kt(b),H=z>1?"@2x":"",q={},Q={};for(const{id:re,url:de}of U){const pe=C.transformRequest(qt(de,H,".json"),"SpriteJSON");q[re]=u.j(pe,O);const fe=C.transformRequest(qt(de,H,".png"),"SpriteImage");Q[re]=Ft.getImage(fe,O)}return yield Promise.all([...Object.values(q),...Object.values(Q)]),(function(re,de){return u._(this,void 0,void 0,(function*(){const pe={};for(const fe in re){pe[fe]={};const _e=Se.getImageCanvasContext((yield de[fe]).data),Me=(yield re[fe]).data;for(const me in Me){const{width:Ce,height:Le,x:we,y:Re,sdf:Ye,pixelRatio:qe,stretchX:$e,stretchY:Xe,content:Mt,textFitWidth:At,textFitHeight:pt}=Me[me];pe[fe][me]={data:null,pixelRatio:qe,sdf:Ye,stretchX:$e,stretchY:Xe,content:Mt,textFitWidth:At,textFitHeight:pt,spriteData:{width:Ce,height:Le,x:we,y:Re,context:_e}}}}return pe}))})(q,Q)}))})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((b=>{if(this._spriteRequest=null,b)for(const C in b){this._spritesImagesIds[C]=[];const z=this._spritesImagesIds[C]?this._spritesImagesIds[C].filter((O=>!(O in b))):[];for(const O of z)this.imageManager.removeImage(O),this._changedImages[O]=!0;for(const O in b[C]){const U=C==="default"?O:`${C}:${O}`;this._spritesImagesIds[C].push(U),U in this.imageManager.images?this.imageManager.updateImage(U,b[C][O],!1):this.imageManager.addImage(U,b[C][O]),a&&(this._changedImages[U]=!0)}}})).catch((b=>{this._spriteRequest=null,v=b,f.signal.aborted||this.fire(new u.k(v))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.l("data",{dataType:"style"})),c&&c(v)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.l("data",{dataType:"style"}))}_validateLayer(t){const a=this.tileManagers[t.source];if(!a)return;const c=t.sourceLayer;if(!c)return;const f=a.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(c)===-1)&&this.fire(new u.k(new Error(`Source layer "${c}" does not exist on source "${f.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,a=!1){const c=this._serializedAllLayers();if(!t||t.length===0)return Object.values(a?u.bV(c):c);const f=[];for(const v of t)if(c[v]){const b=a?u.bV(c[v]):c[v];f.push(b)}return f}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const a=Object.keys(this._layers);for(const c of a){const f=this._layers[c];f.type!=="custom"&&(t[c]=f.serialize())}return t}hasTransitions(){var t,a,c;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((a=this.sky)===null||a===void 0)&&a.hasTransition()||!((c=this.projection)===null||c===void 0)&&c.hasTransition())return!0;for(const f in this.tileManagers)if(this.tileManagers[f].hasTransition())return!0;for(const f in this._layers)if(this._layers[f].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const a=this._changed;if(a){const f=Object.keys(this._updatedLayers),v=Object.keys(this._removedLayers);(f.length||v.length)&&this._updateWorkerLayers(f,v);for(const b in this._updatedSources){const C=this._updatedSources[b];if(C==="reload")this._reloadSource(b);else{if(C!=="clear")throw new Error(`Invalid action ${C}`);this._clearSource(b)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const b in this._updatedPaintProps)this._layers[b].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const c={};for(const f in this.tileManagers){const v=this.tileManagers[f];c[f]=v.used,v.used=!1}for(const f of this._order){const v=this._layers[f];v.recalculate(t,this._availableImages),!v.isHidden(t.zoom)&&v.source&&(this.tileManagers[v.source].used=!0)}for(const f in c){const v=this.tileManagers[f];!!c[f]!=!!v.used&&v.fire(new u.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:f}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,a&&this.fire(new u.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const a in this.tileManagers)this.tileManagers[a].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,a={}){var c;this._checkLoaded();const f=this.serialize();if(t=a.transformStyle?a.transformStyle(f,t):t,((c=a.validate)===null||c===void 0||c)&&Dl(this,u.C(t)))return!1;(t=u.bV(t)).layers=u.bS(t.layers);const v=u.bW(f,t),b=this._getOperationsToPerform(v);if(b.unimplemented.length>0)throw new Error(`Unimplemented: ${b.unimplemented.join(", ")}.`);
825if(b.operations.length===0)return!1;for(const C of b.operations)C();return this.stylesheet=t,this._serializedLayers=null,this.fire(new u.l("style.load",{style:this})),!0}_getOperationsToPerform(t){const a=[],c=[];for(const f of t)switch(f.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":a.push((()=>this.addLayer.apply(this,f.args)));break;case"removeLayer":a.push((()=>this.removeLayer.apply(this,f.args)));break;case"setPaintProperty":a.push((()=>this.setPaintProperty.apply(this,f.args)));break;case"setLayoutProperty":a.push((()=>this.setLayoutProperty.apply(this,f.args)));break;case"setFilter":a.push((()=>this.setFilter.apply(this,f.args)));break;case"addSource":a.push((()=>this.addSource.apply(this,f.args)));break;case"removeSource":a.push((()=>this.removeSource.apply(this,f.args)));break;case"setLayerZoomRange":a.push((()=>this.setLayerZoomRange.apply(this,f.args)));break;case"setLight":a.push((()=>this.setLight.apply(this,f.args)));break;case"setGeoJSONSourceData":a.push((()=>this.setGeoJSONSourceData.apply(this,f.args)));break;case"setGlyphs":a.push((()=>this.setGlyphs.apply(this,f.args)));break;case"setSprite":a.push((()=>this.setSprite.apply(this,f.args)));break;case"setTerrain":a.push((()=>this.map.setTerrain.apply(this,f.args)));break;case"setSky":a.push((()=>this.setSky.apply(this,f.args)));break;case"setProjection":this.setProjection.apply(this,f.args);break;case"setGlobalState":a.push((()=>this.setGlobalState.apply(this,f.args)));break;case"setTransition":a.push((()=>{}));break;default:c.push(f.command)}return{operations:a,unimplemented:c}}
vendor: 35,115 bytes, lines 825-827
825addImage(t,a){if(this.getImage(t))return this.fire(new u.k(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,a),this._afterImageUpdated(t)}updateImage(t,a){this.imageManager.updateImage(t,a)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new u.k(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,a,c={}){if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(a.type)>=0&&this._validate(u.C.source,`sources.${t}`,a,null,c))return;this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);const f=this.tileManagers[t]=new Pi(t,a,this.dispatcher);f.style=this,f.setEventedParent(this,(()=>({isSourceLoaded:f.loaded(),source:f.serialize(),sourceId:t}))),f.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error("There is no source with this ID");for(const c in this._layers)if(this._layers[c].source===t)return this.fire(new u.k(new Error(`Source "${t}" cannot be removed while layer "${c}" is using it.`)));const a=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],a.fire(new u.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,a){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const c=this.tileManagers[t].getSource();if(c.type!=="geojson")throw new Error(`geojsonSource.type is ${c.type}, which is !== 'geojson`);c.setData(a),this._changed=!0}getSource(t){return this.tileManagers[t]&&this.tileManagers[t].getSource()}addLayer(t,a,c={}){this._checkLoaded();const f=t.id;if(this.getLayer(f))return void this.fire(new u.k(new Error(`Layer "${f}" already exists on this map.`)));let v;if(t.type==="custom"){if(Dl(this,u.bX(t)))return;v=u.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(f,t.source),t=u.bV(t),t=u.e(t,{source:f})),this._validate(u.C.layer,`layers.${f}`,t,{arrayIndex:-1},c))return;v=u.bT(t,this._globalState),this._validateLayer(v),v.setEventedParent(this,{layer:{id:f}})}const b=a?this._order.indexOf(a):this._order.length;if(a&&b===-1)this.fire(new u.k(new Error(`Cannot add layer "${f}" before non-existing layer "${a}".`)));else{if(this._order.splice(b,0,f),this._layerOrderChanged=!0,this._layers[f]=v,this._removedLayers[f]&&v.source&&v.type!=="custom"){const C=this._removedLayers[f];delete this._removedLayers[f],C.type!==v.type?this._updatedSources[v.source]="clear":(this._updatedSources[v.source]="reload",this.tileManagers[v.source].pause())}this._updateLayer(v),v.onAdd&&v.onAdd(this.map)}}moveLayer(t,a){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new u.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===a)return;const c=this._order.indexOf(t);this._order.splice(c,1);const f=a?this._order.indexOf(a):this._order.length;a&&f===-1?this.fire(new u.k(new Error(`Cannot move layer "${t}" before non-existing layer "${a}".`))):(this._order.splice(f,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const a=this._layers[t];if(!a)return void this.fire(new u.k(new Error(`Cannot remove non-existing layer "${t}".`)));a.setEventedParent(null);const c=this._order.indexOf(t);this._order.splice(c,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=a,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],a.onRemove&&a.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,a,c){this._checkLoaded();const f=this.getLayer(t);f?f.minzoom===a&&f.maxzoom===c||(a!=null&&(f.minzoom=a),c!=null&&(f.maxzoom=c),this._updateLayer(f)):this.fire(new u.k(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,a,c={}){this._checkLoaded();const f=this.getLayer(t);if(f){if(!u.bR(f.filter,a))return a==null?(f.setFilter(void 0),void this._updateLayer(f)):void(this._validate(u.C.filter,`layers.${f.id}.filter`,a,null,c)||(f.setFilter(u.bV(a)),this._updateLayer(f)))}else this.fire(new u.k(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return u.bV(this.getLayer(t).filter)}setLayoutProperty(t,a,c,f={}){this._checkLoaded();const v=this.getLayer(t);v?u.bR(v.getLayoutProperty(a),c)||(v.setLayoutProperty(a,c,f),this._updateLayer(v)):this.fire(new u.k(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,a){const c=this.getLayer(t);if(c)return c.getLayoutProperty(a);this.fire(new u.k(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,a,c,f={}){this._checkLoaded();const v=this.getLayer(t);v?u.bR(v.getPaintProperty(a),c)||this._updatePaintProperty(v,a,c,f):this.fire(new u.k(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,a,c,f={}){t.setPaintProperty(a,c,f)&&this._updateLayer(t),u.bU(t)&&a==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(c),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,a){return this.getLayer(t).getPaintProperty(a)}setFeatureState(t,a){this._checkLoaded();const c=t.source,f=t.sourceLayer,v=this.tileManagers[c];if(v===void 0)return void this.fire(new u.k(new Error(`The source '${c}' does not exist in the map's style.`)));const b=v.getSource().type;b==="geojson"&&f?this.fire(new u.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):b!=="vector"||f?(t.id===void 0&&this.fire(new u.k(new Error("The feature id parameter must be provided."))),v.setFeatureState(f,t.id,a)):this.fire(new u.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,a){this._checkLoaded();const c=t.source,f=this.tileManagers[c];if(f===void 0)return void this.fire(new u.k(new Error(`The source '${c}' does not exist in the map's style.`)));const v=f.getSource().type,b=v==="vector"?t.sourceLayer:void 0;v!=="vector"||b?a&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new u.k(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(b,t.id,a):this.fire(new u.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const a=t.source,c=t.sourceLayer,f=this.tileManagers[a];if(f!==void 0)return f.getSource().type!=="vector"||c?(t.id===void 0&&this.fire(new u.k(new Error("The feature id parameter must be provided."))),f.getFeatureState(c,t.id)):void this.fire(new u.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new u.k(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){return u.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=u.bY(this.tileManagers,(v=>v.serialize())),a=this._serializeByIds(this._order,!0),c=this.map.getTerrain()||void 0,f=this.stylesheet;return u.bZ({version:f.version,name:f.name,metadata:f.metadata,light:f.light,sky:f.sky,center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,sprite:f.sprite,glyphs:f.glyphs,transition:f.transition,projection:f.projection,sources:t,layers:a,terrain:c},(v=>v!==void 0))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.tileManagers[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const a=b=>this._layers[b].type==="fill-extrusion",c={},f=[];for(let b=this._order.length-1;b>=0;b--){const C=this._order[b];if(a(C)){c[C]=b;for(const z of t){const O=z[C];if(O)for(const U of O)f.push(U)}}}f.sort(((b,C)=>C.intersectionZ-b.intersectionZ));const v=[];for(let b=this._order.length-1;b>=0;b--){const C=this._order[b];if(a(C))for(let z=f.length-1;z>=0;z--){const O=f[z].feature;if(c[O.layer.id]<b)break;v.push(O),f.pop()}else for(const z of t){const O=z[C];if(O)for(const U of O)v.push(U.feature)}}return v}queryRenderedFeatures(t,a,c){a&&a.filter&&this._validate(u.C.filter,"queryRenderedFeatures.filter",a.filter,null,a);const f={};if(a&&a.layers){if(!(Array.isArray(a.layers)||a.layers instanceof Set))return this.fire(new u.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const O of a.layers){const U=this._layers[O];if(!U)return this.fire(new u.k(new Error(`The layer '${O}' does not exist in the map's style and cannot be queried for features.`))),[];f[U.source]=!0}}const v=[];a.availableImages=this._availableImages;const b=this._serializedAllLayers(),C=a.layers instanceof Set?a.layers:Array.isArray(a.layers)?new Set(a.layers):null,z=Object.assign(Object.assign({},a),{layers:C,globalState:this._globalState});for(const O in this.tileManagers)a.layers&&!f[O]||v.push(Ho(this.tileManagers[O],this._layers,b,t,z,c,this.map.terrain?(U,H,q)=>this.map.terrain.getElevation(U,H,q):void 0));return this.placement&&v.push((function(O,U,H,q,Q,re,de){const pe={},fe=re.queryRenderedSymbols(q),_e=[];for(const Me of Object.keys(fe).map(Number))_e.push(de[Me]);_e.sort(En);for(const Me of _e){const me=Me.featureIndex.lookupSymbolFeatures(fe[Me.bucketInstanceId],U,Me.bucketIndex,Me.sourceLayerIndex,{filterSpec:Q.filter,globalState:Q.globalState},Q.layers,Q.availableImages,O);for(const Ce in me){const Le=pe[Ce]=pe[Ce]||[],we=me[Ce];we.sort(((Re,Ye)=>{const qe=Me.featureSortOrder;if(qe){const $e=qe.indexOf(Re.featureIndex);return qe.indexOf(Ye.featureIndex)-$e}return Ye.featureIndex-Re.featureIndex}));for(const Re of we)Le.push(Re)}}return(function(Me,me,Ce){for(const Le in Me)for(const we of Me[Le])Vr(we,Ce[me[Le].source]);return Me})(pe,O,H)})(this._layers,b,this.tileManagers,t,z,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(v)}querySourceFeatures(t,a){a?.filter&&this._validate(u.C.filter,"querySourceFeatures.filter",a.filter,null,a);const c=this.tileManagers[t];return c?(function(f,v){const b=f.getRenderableIds().map((O=>f.getTileByID(O))),C=[],z={};for(let O=0;O<b.length;O++){const U=b[O],H=U.tileID.canonical.key;z[H]||(z[H]=!0,U.querySourceFeatures(C,v))}return C})(c,a?Object.assign(Object.assign({},a),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,a={}){this._checkLoaded();const c=this.light.getLight();let f=!1;for(const b in t)if(!u.bR(t[b],c[b])){f=!0;break}if(!f)return;const v={now:Te(),transition:u.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,a),this.light.updateTransitions(v)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){if(this._checkLoaded(),this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=t,this._setProjectionInternal(t.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,a={}){this._checkLoaded();const c=this.getSky();let f=!1;if(!t&&!c)return;if(t&&!c)f=!0;else if(!t&&c)f=!0;else for(const b in t)if(!u.bR(t[b],c[b])){f=!0;break}if(!f)return;const v={now:Te(),transition:u.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,a),this.sky.updateTransitions(v)}_setProjectionInternal(t){const a=(function(c,f){const v={constrainOverride:f};if(Array.isArray(c)){const b=new Zu({type:c});return{projection:b,transform:new Tr(v),cameraHelper:new tl(b)}}switch(c){case"mercator":return{projection:new Tn,transform:new $n(v),cameraHelper:new Ci};case"globe":{const b=new Zu({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:b,transform:new Tr(v),cameraHelper:new tl(b)}}case"vertical-perspective":return{projection:new Da,transform:new xs(v),cameraHelper:new Bn};default:return u.w(`Unknown projection name: ${c}. Falling back to mercator projection.`),{projection:new Tn,transform:new $n(v),cameraHelper:new Ci}}})(t,this.map.transformConstrain);this.projection=a.projection,this.map.migrateProjection(a.transform,a.cameraHelper);for(const c in this.tileManagers)this.tileManagers[c].reload()}_validate(t,a,c,f,v={}){return(!v||v.validate!==!1)&&Dl(this,t.call(u.C,u.e({key:a,style:this.serialize(),value:c,styleSpec:u.u},f)))}_remove(t=!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),ae().off(Be,this._rtlPluginLoaded);for(const a in this._layers)this._layers[a].setEventedParent(null);for(const a in this.tileManagers){const c=this.tileManagers[a];c.setEventedParent(null),c.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(const a in this.tileManagers)this.tileManagers[a].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,a,c,f,v=!1){let b=!1,C=!1;const z={};for(const O of this._order){const U=this._layers[O];if(U.type!=="symbol")continue;if(!z[U.source]){const q=this.tileManagers[U.source];z[U.source]=q.getRenderableIds(!0).map((Q=>q.getTileByID(Q))).sort(((Q,re)=>re.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(re.tileID)?-1:1)))}const H=this.crossTileSymbolIndex.addLayer(U,z[U.source],t.center.lng);b=b||H}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((v=v||this._layerOrderChanged||c===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(Te(),t.zoom))&&(this.pauseablePlacement=new vo(t,this.map.terrain,this._order,v,a,c,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,z),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Te()),C=!0),b&&this.pauseablePlacement.placement.setStale()),C||b)for(const O of this._order){const U=this._layers[O];U.type==="symbol"&&this.placement.updateLayerOpacities(U,z[U.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Te())}_releaseSymbolFadeTiles(){for(const t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,a){return u._(this,void 0,void 0,(function*(){const c=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();const f=this.tileManagers[a.source];return f&&f.setDependencies(a.tileID.key,a.type,a.icons),c}))}getGlyphs(t,a){return u._(this,void 0,void 0,(function*(){const c=yield this.glyphManager.getGlyphs(a.stacks),f=this.tileManagers[a.source];return f&&f.setDependencies(a.tileID.key,a.type,[""]),c}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,a={}){this._checkLoaded(),t&&this._validate(u.C.glyphs,"glyphs",t,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,a){return u._(this,void 0,void 0,(function*(){const c={};for(const[f,v]of Object.entries(a.dashes))c[f]=this.lineAtlas.getDash(v.dasharray,v.round);return c}))}addSprite(t,a,c={},f){this._checkLoaded();const v=[{id:t,url:a}],b=[...Kt(this.stylesheet.sprite),...v];this._validate(u.C.sprite,"sprite",b,null,c)||(this.stylesheet.sprite=b,this._loadSprite(v,!0,f))}removeSprite(t){this._checkLoaded();const a=Kt(this.stylesheet.sprite);if(a.find((c=>c.id===t))){if(this._spritesImagesIds[t])for(const c of this._spritesImagesIds[t])this.imageManager.removeImage(c),this._changedImages[c]=!0;a.splice(a.findIndex((c=>c.id===t)),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new u.l("data",{dataType:"style"}))}else this.fire(new u.k(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Kt(this.stylesheet.sprite)}setSprite(t,a={},c){this._checkLoaded(),t&&this._validate(u.C.sprite,"sprite",t,null,a)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,c):(this._unloadSprite(),c&&c(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(const t in this.tileManagers){const a=this.tileManagers[t];a.setEventedParent(null),a.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(const t in this._layers){const a=this._layers[t];a.setEventedParent(null),a.onRemove&&a.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var rh=u.aU([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class su{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,a,c,f,v,b,C,z,O){this.context=t;let U=this.boundPaintVertexBuffers.length!==f.length;for(let H=0;!U&&H<f.length;H++)this.boundPaintVertexBuffers[H]!==f[H]&&(U=!0);!this.vao||this.boundProgram!==a||this.boundLayoutVertexBuffer!==c||U||this.boundIndexBuffer!==v||this.boundVertexOffset!==b||this.boundDynamicVertexBuffer!==C||this.boundDynamicVertexBuffer2!==z||this.boundDynamicVertexBuffer3!==O?this.freshBind(a,c,f,v,b,C,z,O):(t.bindVertexArray.set(this.vao),C&&C.bind(),v&&v.dynamicDraw&&v.bind(),z&&z.bind(),O&&O.bind())}freshBind(t,a,c,f,v,b,C,z){const O=t.numAttributes,U=this.context,H=U.gl;this.vao&&this.destroy(),this.vao=U.createVertexArray(),U.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=a,this.boundPaintVertexBuffers=c,this.boundIndexBuffer=f,this.boundVertexOffset=v,this.boundDynamicVertexBuffer=b,this.boundDynamicVertexBuffer2=C,this.boundDynamicVertexBuffer3=z,a.enableAttributes(H,t);for(const q of c)q.enableAttributes(H,t);b&&b.enableAttributes(H,t),C&&C.enableAttributes(H,t),z&&z.enableAttributes(H,t),a.bind(),a.setVertexAttribPointers(H,t,v);for(const q of c)q.bind(),q.setVertexAttribPointers(H,t,v);b&&(b.bind(),b.setVertexAttribPointers(H,t,v)),f&&f.bind(),C&&(C.bind(),C.setVertexAttribPointers(H,t,v)),z&&(z.bind(),z.setVertexAttribPointers(H,t,v)),U.currentNumAttributes=O}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Tc=(g,t,a,c,f)=>({u_texture:0,u_ele_delta:g,u_fog_matrix:t,u_fog_color:a?a.properties.get("fog-color"):u.bp.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:f?0:a?a.calculateFogBlendOpacity(c):0,u_horizon_color:a?a.properties.get("horizon-color"):u.bp.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1,u_is_globe_mode:f?1:0}),Ja={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 ua(g){const t=[];for(let a=0;a<g.length;a++){if(g[a]===null)continue;const c=g[a].split(" ");t.push(c.pop())}return t}class il{constructor(t,a,c,f,v,b,C,z,O=[]){const U=t.gl;this.program=U.createProgram();const H=ua(a.staticAttributes),q=c?c.getBinderAttributes():[],Q=H.concat(q),re=Ni.prelude.staticUniforms?ua(Ni.prelude.staticUniforms):[],de=C.staticUniforms?ua(C.staticUniforms):[],pe=a.staticUniforms?ua(a.staticUniforms):[],fe=c?c.getBinderUniforms():[],_e=re.concat(de).concat(pe).concat(fe),Me=[];for(const qe of _e)Me.indexOf(qe)<0&&Me.push(qe);const me=c?c.defines():[];Ea(U)&&me.unshift("#version 300 es"),v&&me.push("#define OVERDRAW_INSPECTOR;"),b&&me.push("#define TERRAIN3D;"),z&&me.push(z),O&&me.push(...O);let Ce=me.concat(Ni.prelude.fragmentSource,C.fragmentSource,a.fragmentSource).join(`
826`),Le=me.concat(Ni.prelude.vertexSource,C.vertexSource,a.vertexSource).join(`
827`);Ea(U)||(Ce=(function(qe){return qe.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(Ce),Le=(function(qe){return qe.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(Le));const we=U.createShader(U.FRAGMENT_SHADER);if(U.isContextLost())return void(this.failedToCreate=!0);if(U.shaderSource(we,Ce),U.compileShader(we),!U.getShaderParameter(we,U.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${U.getShaderInfoLog(we)}`);U.attachShader(this.program,we);const Re=U.createShader(U.VERTEX_SHADER);if(U.isContextLost())return void(this.failedToCreate=!0);if(U.shaderSource(Re,Le),U.compileShader(Re),!U.getShaderParameter(Re,U.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${U.getShaderInfoLog(Re)}`);U.attachShader(this.program,Re),this.attributes={};const Ye={};this.numAttributes=Q.length;for(let qe=0;qe<this.numAttributes;qe++)Q[qe]&&(U.bindAttribLocation(this.program,qe,Q[qe]),this.attributes[Q[qe]]=qe);if(U.linkProgram(this.program),!U.getProgramParameter(this.program,U.LINK_STATUS))throw new Error(`Program failed to link: ${U.getProgramInfoLog(this.program)}`);U.deleteShader(Re),U.deleteShader(we);for(let qe=0;qe<Me.length;qe++){const $e=Me[qe];if($e&&!Ye[$e]){const Xe=U.getUniformLocation(this.program,$e);Xe&&(Ye[$e]=Xe)}}this.fixedUniforms=f(t,Ye),this.terrainUniforms=((qe,$e)=>({u_depth:new u.b_(qe,$e.u_depth),u_terrain:new u.b_(qe,$e.u_terrain),u_terrain_dim:new u.bq(qe,$e.u_terrain_dim),u_terrain_matrix:new u.c0(qe,$e.u_terrain_matrix),u_terrain_unpack:new u.c1(qe,$e.u_terrain_unpack),u_terrain_exaggeration:new u.bq(qe,$e.u_terrain_exaggeration)}))(t,Ye),this.projectionUniforms=((qe,$e)=>({u_projection_matrix:new u.c0(qe,$e.u_projection_matrix),u_projection_tile_mercator_coords:new u.c1(qe,$e.u_projection_tile_mercator_coords),u_projection_clipping_plane:new u.c1(qe,$e.u_projection_clipping_plane),u_projection_transition:new u.bq(qe,$e.u_projection_transition),u_projection_fallback_matrix:new u.c0(qe,$e.u_projection_fallback_matrix)}))(t,Ye),this.binderUniforms=c?c.getUniforms(t,Ye):[]}draw(t,a,c,f,v,b,C,z,O,U,H,q,Q,re,de,pe,fe,_e,Me){const me=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(c),t.setStencilMode(f),t.setColorMode(v),t.setCullFace(b),z){t.activeTexture.set(me.TEXTURE2),me.bindTexture(me.TEXTURE_2D,z.depthTexture),t.activeTexture.set(me.TEXTURE3),me.bindTexture(me.TEXTURE_2D,z.texture);for(const Le in this.terrainUniforms)this.terrainUniforms[Le].set(z[Le])}if(O)for(const Le in O)this.projectionUniforms[Ja[Le]].set(O[Le]);if(C)for(const Le in this.fixedUniforms)this.fixedUniforms[Le].set(C[Le]);pe&&pe.setUniforms(t,this.binderUniforms,re,{zoom:de});let Ce=0;switch(a){case me.LINES:Ce=2;break;case me.TRIANGLES:Ce=3;break;case me.LINE_STRIP:Ce=1}for(const Le of Q.get()){const we=Le.vaos||(Le.vaos={});(we[U]||(we[U]=new su)).bind(t,this,H,pe?pe.getPaintVertexBuffers():[],q,Le.vertexOffset,fe,_e,Me),me.drawElements(a,Le.primitiveLength*Ce,me.UNSIGNED_SHORT,Le.primitiveOffset*Ce*2)}}}function ah(g,t,a){const c=1/u.aN(a,1,t.transform.tileZoom),f=Math.pow(2,a.tileID.overscaledZ),v=a.tileSize*Math.pow(2,t.transform.tileZoom)/f,b=v*(a.tileID.canonical.x+a.tileID.wrap*f),C=v*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[c,g.fromScale,g.toScale],u_fade:g.t,u_pixel_coord_upper:[b>>16,C>>16],u_pixel_coord_lower:[65535&b,65535&C]}}const Ia=(g,t,a,c)=>{const f=g.style.light,v=f.properties.get("position"),b=[v.x,v.y,v.z],C=u.c4();f.properties.get("anchor")==="viewport"&&u.c5(C,g.transform.bearingInRadians),u.c6(b,b,C);const z=g.transform.transformLightDirection(b),O=f.properties.get("color");return{u_lightpos:b,u_lightpos_globe:z,u_lightintensity:f.properties.get("intensity"),u_lightcolor:[O.r,O.g,O.b],u_vertical_gradient:+t,u_opacity:a,u_fill_translate:c}},Hu=(g,t,a,c,f,v,b)=>u.e(Ia(g,t,a,c),ah(v,g,b),{u_height_factor:-Math.pow(2,f.overscaledZ)/b.tileSize/8}),ka=(g,t,a,c)=>u.e(ah(t,g,a),{u_fill_translate:c}),Il=(g,t)=>({u_world:g,u_fill_translate:t}),kl=(g,t,a,c,f)=>u.e(ka(g,t,a,f),{u_world:c}),Rl=(g,t,a,c,f)=>{const v=g.transform;let b,C,z=0;if(a.paint.get("circle-pitch-alignment")==="map"){const O=u.aN(t,1,v.zoom);b=!0,C=[O,O],z=O/(u.a5*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*f}else b=!1,C=v.pixelsToGLUnits;return{u_camera_to_center_distance:v.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+b,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:C,u_globe_extrude_scale:z,u_translate:c}},es=g=>({u_pixel_extrude_scale:[1/g.width,1/g.height]}),Sc=g=>({u_viewport_size:[g.width,g.height]}),Ra=(g,t=1)=>({u_color:g,u_overlay:0,u_overlay_scale:t}),ts=(g,t,a,c)=>{const f=u.aN(g,1,t)/(u.a5*Math.pow(2,g.tileID.overscaledZ))*2*Math.PI*c;return{u_extrude_scale:u.aN(g,1,t),u_intensity:a,u_globe_extrude_scale:f}},Cc=(g,t,a,c)=>{const f=u.N();u.c7(f,0,g.width,g.height,0,0,1);const v=g.context.gl;return{u_matrix:f,u_world:[v.drawingBufferWidth,v.drawingBufferHeight],u_image:a,u_color_ramp:c,u_opacity:t.paint.get("heatmap-opacity")}},nl=(g,t,a)=>{const c=a.paint.get("hillshade-accent-color");let f;switch(a.paint.get("hillshade-method")){case"basic":f=4;break;case"combined":f=1;break;case"igor":f=2;break;case"multidirectional":f=3;break;default:f=0}const v=a.getIlluminationProperties();for(let b=0;b<v.directionRadians.length;b++)a.paint.get("hillshade-illumination-anchor")==="viewport"&&(v.directionRadians[b]+=g.transform.bearingInRadians);return{u_image:0,u_latrange:$s(0,t.tileID),u_exaggeration:a.paint.get("hillshade-exaggeration"),u_altitudes:v.altitudeRadians,u_azimuths:v.directionRadians,u_accent:c,u_method:f,u_highlights:v.highlightColor,u_shadows:v.shadowColor}},sh=(g,t)=>{const a=t.stride,c=u.N();return u.c7(c,0,u.a5,-u.a5,0,0,1),u.O(c,c,[0,-u.a5,0]),{u_matrix:c,u_image:1,u_dimension:[a,a],u_zoom:g.overscaledZ,u_unpack:t.getUnpackVector()}};function $s(g,t){const a=Math.pow(2,t.canonical.z),c=t.canonical.y;return[new u.a9(0,c/a).toLngLat().lat,new u.a9(0,(c+1)/a).toLngLat().lat]}const oh=(g,t,a=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:a,u_opacity:g.paint.get("color-relief-opacity")}),ws=(g,t,a,c)=>{const f=g.transform;return{u_translation:Co(g,t,a),u_ratio:c/u.aN(t,1,f.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/f.pixelsToGLUnits[0],1/f.pixelsToGLUnits[1]]}},lh=(g,t,a,c,f)=>u.e(ws(g,t,a,c),{u_image:0,u_image_height:f}),is=(g,t,a,c,f)=>{const v=g.transform,b=ca(t,v);return{u_translation:Co(g,t,a),u_texsize:t.imageAtlasTexture.size,u_ratio:c/u.aN(t,1,v.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[b,f.fromScale,f.toScale],u_fade:f.t,u_units_to_pixels:[1/v.pixelsToGLUnits[0],1/v.pixelsToGLUnits[1]]}},Sr=(g,t,a,c,f)=>{const v=ca(t,g.transform);return u.e(ws(g,t,a,c),{u_tileratio:v,u_crossfade_from:f.fromScale,u_crossfade_to:f.toScale,u_image:0,u_mix:f.t,u_lineatlas_width:g.lineAtlas.width,u_lineatlas_height:g.lineAtlas.height})},Xs=(g,t,a,c,f,v)=>{const b=ca(t,g.transform);return u.e(ws(g,t,a,c),{u_image:0,u_image_height:v,u_tileratio:b,u_crossfade_from:f.fromScale,u_crossfade_to:f.toScale,u_image_dash:1,u_mix:f.t,u_lineatlas_width:g.lineAtlas.width,u_lineatlas_height:g.lineAtlas.height})};function ca(g,t){return 1/u.aN(g,1,t.tileZoom)}function Co(g,t,a){return u.aO(g.transform,t,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}const Ol=(g,t,a,c,f)=>{return{u_tl_parent:g,u_scale_parent:t,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(b=c.paint.get("raster-saturation"),b>0?1-1/(1.001-b):-b),u_contrast_factor:(v=c.paint.get("raster-contrast"),v>0?1/(1-v):1+v),u_spin_weights:rl(c.paint.get("raster-hue-rotate")),u_coords_top:[f[0].x,f[0].y,f[1].x,f[1].y],u_coords_bottom:[f[3].x,f[3].y,f[2].x,f[2].y]};var v,b};function rl(g){g*=Math.PI/180;const t=Math.sin(g),a=Math.cos(g);return[(2*a+1)/3,(-Math.sqrt(3)*t-a+1)/3,(Math.sqrt(3)*t-a+1)/3]}const Ts=(g,t,a,c,f,v,b,C,z,O,U,H,q)=>{const Q=b.transform;return{u_is_size_zoom_constant:+(g==="constant"||g==="source"),u_is_size_feature_constant:+(g==="constant"||g==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:Q.cameraToCenterDistance,u_pitch:Q.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:Q.width/Q.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_label_plane_matrix:C,u_coord_matrix:z,u_is_text:+U,u_pitch_with_map:+c,u_is_along_line:f,u_is_variable_anchor:v,u_texsize:H,u_texture:0,u_translation:O,u_pitched_scale:q}},al=(g,t,a,c,f,v,b,C,z,O,U,H,q,Q)=>{const re=b.transform;return u.e(Ts(g,t,a,c,f,v,b,C,z,O,U,H,Q),{u_gamma_scale:c?Math.cos(re.pitch*Math.PI/180)*re.cameraToCenterDistance:1,u_device_pixel_ratio:b.pixelRatio,u_is_halo:1})},ha=(g,t,a,c,f,v,b,C,z,O,U,H,q)=>u.e(al(g,t,a,c,f,v,b,C,z,O,!0,U,0,q),{u_texsize_icon:H,u_texture_icon:1}),Bl=(g,t)=>({u_opacity:g,u_color:t}),ou=(g,t,a,c,f)=>u.e((function(v,b,C,z){const O=C.imageManager.getPattern(v.from.toString()),U=C.imageManager.getPattern(v.to.toString()),{width:H,height:q}=C.imageManager.getPixelSize(),Q=Math.pow(2,z.tileID.overscaledZ),re=z.tileSize*Math.pow(2,C.transform.tileZoom)/Q,de=re*(z.tileID.canonical.x+z.tileID.wrap*Q),pe=re*z.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:O.tl,u_pattern_br_a:O.br,u_pattern_tl_b:U.tl,u_pattern_br_b:U.br,u_texsize:[H,q],u_mix:b.t,u_pattern_size_a:O.displaySize,u_pattern_size_b:U.displaySize,u_scale_a:b.fromScale,u_scale_b:b.toScale,u_tile_units_to_pixels:1/u.aN(z,1,C.transform.tileZoom),u_pixel_coord_upper:[de>>16,pe>>16],u_pixel_coord_lower:[65535&de,65535&pe]}})(a,f,t,c),{u_opacity:g}),sl=(g,t)=>{},uh={fillExtrusion:(g,t)=>({u_lightpos:new u.c2(g,t.u_lightpos),u_lightpos_globe:new u.c2(g,t.u_lightpos_globe),u_lightintensity:new u.bq(g,t.u_lightintensity),u_lightcolor:new u.c2(g,t.u_lightcolor),u_vertical_gradient:new u.bq(g,t.u_vertical_gradient),u_opacity:new u.bq(g,t.u_opacity),u_fill_translate:new u.c3(g,t.u_fill_translate)}),fillExtrusionPattern:(g,t)=>({u_lightpos:new u.c2(g,t.u_lightpos),u_lightpos_globe:new u.c2(g,t.u_lightpos_globe),u_lightintensity:new u.bq(g,t.u_lightintensity),u_lightcolor:new u.c2(g,t.u_lightcolor),u_vertical_gradient:new u.bq(g,t.u_vertical_gradient),u_height_factor:new u.bq(g,t.u_height_factor),u_opacity:new u.bq(g,t.u_opacity),u_fill_translate:new u.c3(g,t.u_fill_translate),u_image:new u.b_(g,t.u_image),u_texsize:new u.c3(g,t.u_texsize),u_pixel_coord_upper:new u.c3(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(g,t.u_pixel_coord_lower),u_scale:new u.c2(g,t.u_scale),u_fade:new u.bq(g,t.u_fade)}),fill:(g,t)=>({u_fill_translate:new u.c3(g,t.u_fill_translate)}),fillPattern:(g,t)=>({u_image:new u.b_(g,t.u_image),u_texsize:new u.c3(g,t.u_texsize),u_pixel_coord_upper:new u.c3(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(g,t.u_pixel_coord_lower),u_scale:new u.c2(g,t.u_scale),u_fade:new u.bq(g,t.u_fade),u_fill_translate:new u.c3(g,t.u_fill_translate)}),fillOutline:(g,t)=>({u_world:new u.c3(g,t.u_world),u_fill_translate:new u.c3(g,t.u_fill_translate)}),fillOutlinePattern:(g,t)=>({u_world:new u.c3(g,t.u_world),u_image:new u.b_(g,t.u_image),u_texsize:new u.c3(g,t.u_texsize),u_pixel_coord_upper:new u.c3(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(g,t.u_pixel_coord_lower),u_scale:new u.c2(g,t.u_scale),u_fade:new u.bq(g,t.u_fade),u_fill_translate:new u.c3(g,t.u_fill_translate)}),circle:(g,t)=>({u_camera_to_center_distance:new u.bq(g,t.u_camera_to_center_distance),u_scale_with_map:new u.b_(g,t.u_scale_with_map),u_pitch_with_map:new u.b_(g,t.u_pitch_with_map),u_extrude_scale:new u.c3(g,t.u_extrude_scale),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_globe_extrude_scale:new u.bq(g,t.u_globe_extrude_scale),u_translate:new u.c3(g,t.u_translate)}),collisionBox:(g,t)=>({u_pixel_extrude_scale:new u.c3(g,t.u_pixel_extrude_scale)}),collisionCircle:(g,t)=>({u_viewport_size:new u.c3(g,t.u_viewport_size)}),debug:(g,t)=>({u_color:new u.b$(g,t.u_color),u_overlay:new u.b_(g,t.u_overlay),u_overlay_scale:new u.bq(g,t.u_overlay_scale)}),depth:sl,clippingMask:sl,heatmap:(g,t)=>({u_extrude_scale:new u.bq(g,t.u_extrude_scale),u_intensity:new u.bq(g,t.u_intensity),u_globe_extrude_scale:new u.bq(g,t.u_globe_extrude_scale)}),heatmapTexture:(g,t)=>({u_matrix:new u.c0(g,t.u_matrix),u_world:new u.c3(g,t.u_world),u_image:new u.b_(g,t.u_image),u_color_ramp:new u.b_(g,t.u_color_ramp),u_opacity:new u.bq(g,t.u_opacity)}),hillshade:(g,t)=>({u_image:new u.b_(g,t.u_image),u_latrange:new u.c3(g,t.u_latrange),u_exaggeration:new u.bq(g,t.u_exaggeration),u_altitudes:new u.c9(g,t.u_altitudes),u_azimuths:new u.c9(g,t.u_azimuths),u_accent:new u.b$(g,t.u_accent),u_method:new u.b_(g,t.u_method),u_shadows:new u.c8(g,t.u_shadows),u_highlights:new u.c8(g,t.u_highlights)}),hillshadePrepare:(g,t)=>({u_matrix:new u.c0(g,t.u_matrix),u_image:new u.b_(g,t.u_image),u_dimension:new u.c3(g,t.u_dimension),u_zoom:new u.bq(g,t.u_zoom),u_unpack:new u.c1(g,t.u_unpack)}),colorRelief:(g,t)=>({u_image:new u.b_(g,t.u_image),u_unpack:new u.c1(g,t.u_unpack),u_dimension:new u.c3(g,t.u_dimension),u_elevation_stops:new u.b_(g,t.u_elevation_stops),u_color_stops:new u.b_(g,t.u_color_stops),u_color_ramp_size:new u.b_(g,t.u_c
827olor_ramp_size),u_opacity:new u.bq(g,t.u_opacity)}),line:(g,t)=>({u_translation:new u.c3(g,t.u_translation),u_ratio:new u.bq(g,t.u_ratio),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(g,t.u_units_to_pixels)}),lineGradient:(g,t)=>({u_translation:new u.c3(g,t.u_translation),u_ratio:new u.bq(g,t.u_ratio),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(g,t.u_units_to_pixels),u_image:new u.b_(g,t.u_image),u_image_height:new u.bq(g,t.u_image_height)}),linePattern:(g,t)=>({u_translation:new u.c3(g,t.u_translation),u_texsize:new u.c3(g,t.u_texsize),u_ratio:new u.bq(g,t.u_ratio),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_image:new u.b_(g,t.u_image),u_units_to_pixels:new u.c3(g,t.u_units_to_pixels),u_scale:new u.c2(g,t.u_scale),u_fade:new u.bq(g,t.u_fade)}),lineSDF:(g,t)=>({u_translation:new u.c3(g,t.u_translation),u_ratio:new u.bq(g,t.u_ratio),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(g,t.u_units_to_pixels),u_image:new u.b_(g,t.u_image),u_mix:new u.bq(g,t.u_mix),u_tileratio:new u.bq(g,t.u_tileratio),u_crossfade_from:new u.bq(g,t.u_crossfade_from),u_crossfade_to:new u.bq(g,t.u_crossfade_to),u_lineatlas_width:new u.bq(g,t.u_lineatlas_width),u_lineatlas_height:new u.bq(g,t.u_lineatlas_height)}),lineGradientSDF:(g,t)=>({u_translation:new u.c3(g,t.u_translation),u_ratio:new u.bq(g,t.u_ratio),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_units_to_pixels:new u.c3(g,t.u_units_to_pixels),u_image:new u.b_(g,t.u_image),u_image_height:new u.bq(g,t.u_image_height),u_tileratio:new u.bq(g,t.u_tileratio),u_crossfade_from:new u.bq(g,t.u_crossfade_from),u_crossfade_to:new u.bq(g,t.u_crossfade_to),u_image_dash:new u.b_(g,t.u_image_dash),u_mix:new u.bq(g,t.u_mix),u_lineatlas_width:new u.bq(g,t.u_lineatlas_width),u_lineatlas_height:new u.bq(g,t.u_lineatlas_height)}),raster:(g,t)=>({u_tl_parent:new u.c3(g,t.u_tl_parent),u_scale_parent:new u.bq(g,t.u_scale_parent),u_buffer_scale:new u.bq(g,t.u_buffer_scale),u_fade_t:new u.bq(g,t.u_fade_t),u_opacity:new u.bq(g,t.u_opacity),u_image0:new u.b_(g,t.u_image0),u_image1:new u.b_(g,t.u_image1),u_brightness_low:new u.bq(g,t.u_brightness_low),u_brightness_high:new u.bq(g,t.u_brightness_high),u_saturation_factor:new u.bq(g,t.u_saturation_factor),u_contrast_factor:new u.bq(g,t.u_contrast_factor),u_spin_weights:new u.c2(g,t.u_spin_weights),u_coords_top:new u.c1(g,t.u_coords_top),u_coords_bottom:new u.c1(g,t.u_coords_bottom)}),symbolIcon:(g,t)=>({u_is_size_zoom_constant:new u.b_(g,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.b_(g,t.u_is_size_feature_constant),u_size_t:new u.bq(g,t.u_size_t),u_size:new u.bq(g,t.u_size),u_camera_to_center_distance:new u.bq(g,t.u_camera_to_center_distance),u_pitch:new u.bq(g,t.u_pitch),u_rotate_symbol:new u.b_(g,t.u_rotate_symbol),u_aspect_ratio:new u.bq(g,t.u_aspect_ratio),u_fade_change:new u.bq(g,t.u_fade_change),u_label_plane_matrix:new u.c0(g,t.u_label_plane_matrix),u_coord_matrix:new u.c0(g,t.u_coord_matrix),u_is_text:new u.b_(g,t.u_is_text),u_pitch_with_map:new u.b_(g,t.u_pitch_with_map),u_is_along_line:new u.b_(g,t.u_is_along_line),u_is_variable_anchor:new u.b_(g,t.u_is_variable_anchor),u_texsize:new u.c3(g,t.u_texsize),u_texture:new u.b_(g,t.u_texture),u_translation:new u.c3(g,t.u_translation),u_pitched_scale:new u.bq(g,t.u_pitched_scale)}),symbolSDF:(g,t)=>({u_is_size_zoom_constant:new u.b_(g,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.b_(g,t.u_is_size_feature_constant),u_size_t:new u.bq(g,t.u_size_t),u_size:new u.bq(g,t.u_size),u_camera_to_center_distance:new u.bq(g,t.u_camera_to_center_distance),u_pitch:new u.bq(g,t.u_pitch),u_rotate_symbol:new u.b_(g,t.u_rotate_symbol),u_aspect_ratio:new u.bq(g,t.u_aspect_ratio),u_fade_change:new u.bq(g,t.u_fade_change),u_label_plane_matrix:new u.c0(g,t.u_label_plane_matrix),u_coord_matrix:new u.c0(g,t.u_coord_matrix),u_is_text:new u.b_(g,t.u_is_text),u_pitch_with_map:new u.b_(g,t.u_pitch_with_map),u_is_along_line:new u.b_(g,t.u_is_along_line),u_is_variable_anchor:new u.b_(g,t.u_is_variable_anchor),u_texsize:new u.c3(g,t.u_texsize),u_texture:new u.b_(g,t.u_texture),u_gamma_scale:new u.bq(g,t.u_gamma_scale),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_is_halo:new u.b_(g,t.u_is_halo),u_translation:new u.c3(g,t.u_translation),u_pitched_scale:new u.bq(g,t.u_pitched_scale)}),symbolTextAndIcon:(g,t)=>({u_is_size_zoom_constant:new u.b_(g,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.b_(g,t.u_is_size_feature_constant),u_size_t:new u.bq(g,t.u_size_t),u_size:new u.bq(g,t.u_size),u_camera_to_center_distance:new u.bq(g,t.u_camera_to_center_distance),u_pitch:new u.bq(g,t.u_pitch),u_rotate_symbol:new u.b_(g,t.u_rotate_symbol),u_aspect_ratio:new u.bq(g,t.u_aspect_ratio),u_fade_change:new u.bq(g,t.u_fade_change),u_label_plane_matrix:new u.c0(g,t.u_label_plane_matrix
vendor: 122,841 bytes, lines 827-829
827),u_coord_matrix:new u.c0(g,t.u_coord_matrix),u_is_text:new u.b_(g,t.u_is_text),u_pitch_with_map:new u.b_(g,t.u_pitch_with_map),u_is_along_line:new u.b_(g,t.u_is_along_line),u_is_variable_anchor:new u.b_(g,t.u_is_variable_anchor),u_texsize:new u.c3(g,t.u_texsize),u_texsize_icon:new u.c3(g,t.u_texsize_icon),u_texture:new u.b_(g,t.u_texture),u_texture_icon:new u.b_(g,t.u_texture_icon),u_gamma_scale:new u.bq(g,t.u_gamma_scale),u_device_pixel_ratio:new u.bq(g,t.u_device_pixel_ratio),u_is_halo:new u.b_(g,t.u_is_halo),u_translation:new u.c3(g,t.u_translation),u_pitched_scale:new u.bq(g,t.u_pitched_scale)}),background:(g,t)=>({u_opacity:new u.bq(g,t.u_opacity),u_color:new u.b$(g,t.u_color)}),backgroundPattern:(g,t)=>({u_opacity:new u.bq(g,t.u_opacity),u_image:new u.b_(g,t.u_image),u_pattern_tl_a:new u.c3(g,t.u_pattern_tl_a),u_pattern_br_a:new u.c3(g,t.u_pattern_br_a),u_pattern_tl_b:new u.c3(g,t.u_pattern_tl_b),u_pattern_br_b:new u.c3(g,t.u_pattern_br_b),u_texsize:new u.c3(g,t.u_texsize),u_mix:new u.bq(g,t.u_mix),u_pattern_size_a:new u.c3(g,t.u_pattern_size_a),u_pattern_size_b:new u.c3(g,t.u_pattern_size_b),u_scale_a:new u.bq(g,t.u_scale_a),u_scale_b:new u.bq(g,t.u_scale_b),u_pixel_coord_upper:new u.c3(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.c3(g,t.u_pixel_coord_lower),u_tile_units_to_pixels:new u.bq(g,t.u_tile_units_to_pixels)}),terrain:(g,t)=>({u_texture:new u.b_(g,t.u_texture),u_ele_delta:new u.bq(g,t.u_ele_delta),u_fog_matrix:new u.c0(g,t.u_fog_matrix),u_fog_color:new u.b$(g,t.u_fog_color),u_fog_ground_blend:new u.bq(g,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new u.bq(g,t.u_fog_ground_blend_opacity),u_horizon_color:new u.b$(g,t.u_horizon_color),u_horizon_fog_blend:new u.bq(g,t.u_horizon_fog_blend),u_is_globe_mode:new u.bq(g,t.u_is_globe_mode)}),terrainDepth:(g,t)=>({u_ele_delta:new u.bq(g,t.u_ele_delta)}),terrainCoords:(g,t)=>({u_texture:new u.b_(g,t.u_texture),u_terrain_coords_id:new u.bq(g,t.u_terrain_coords_id),u_ele_delta:new u.bq(g,t.u_ele_delta)}),projectionErrorMeasurement:(g,t)=>({u_input:new u.bq(g,t.u_input),u_output_expected:new u.bq(g,t.u_output_expected)}),atmosphere:(g,t)=>({u_sun_pos:new u.c2(g,t.u_sun_pos),u_atmosphere_blend:new u.bq(g,t.u_atmosphere_blend),u_globe_position:new u.c2(g,t.u_globe_position),u_globe_radius:new u.bq(g,t.u_globe_radius),u_inv_proj_matrix:new u.c0(g,t.u_inv_proj_matrix)}),sky:(g,t)=>({u_sky_color:new u.b$(g,t.u_sky_color),u_horizon_color:new u.b$(g,t.u_horizon_color),u_horizon:new u.c3(g,t.u_horizon),u_horizon_normal:new u.c3(g,t.u_horizon_normal),u_sky_horizon_blend:new u.bq(g,t.u_sky_horizon_blend),u_sky_blend:new u.bq(g,t.u_sky_blend)})};class Mo{constructor(t,a,c){this.context=t;const f=t.gl;this.buffer=f.createBuffer(),this.dynamicDraw=!!c,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?f.DYNAMIC_DRAW:f.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ol={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class $u{constructor(t,a,c,f){this.length=a.length,this.attributes=c,this.itemSize=a.bytesPerElement,this.dynamicDraw=f,this.context=t;const v=t.gl;this.buffer=v.createBuffer(),t.bindVertexBuffer.set(this.buffer),v.bufferData(v.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?v.DYNAMIC_DRAW:v.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,a){for(let c=0;c<this.attributes.length;c++){const f=a.attributes[this.attributes[c].name];f!==void 0&&t.enableVertexAttribArray(f)}}setVertexAttribPointers(t,a,c){for(let f=0;f<this.attributes.length;f++){const v=this.attributes[f],b=a.attributes[v.name];b!==void 0&&t.vertexAttribPointer(b,v.components,t[ol[v.type]],!1,this.itemSize,v.offset+this.itemSize*(c||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Fi{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class lr extends Fi{getDefault(){return u.bp.transparent}set(t){const a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Eo extends Fi{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class lu extends Fi{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class ll extends Fi{getDefault(){return[!0,!0,!0,!0]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ul extends Fi{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Nl extends Fi{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Fl extends Fi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const a=this.current;(t.func!==a.func||t.ref!==a.ref||t.mask!==a.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Cr extends Fi{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Mc extends Fi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST),this.current=t,this.dirty=!1}}class Ys extends Fi{getDefault(){return[0,1]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class da extends Fi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),this.current=t,this.dirty=!1}}class ns extends Fi{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Xr extends Fi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.BLEND):a.disable(a.BLEND),this.current=t,this.dirty=!1}}class Mr extends Fi{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ao extends Fi{getDefault(){return u.bp.transparent}set(t){const a=this.current;(t.r!==a.r||t.g!==a.g||t.b!==a.b||t.a!==a.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Po extends Fi{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Ws extends Fi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;t?a.enable(a.CULL_FACE):a.disable(a.CULL_FACE),this.current=t,this.dirty=!1}}class zo extends Fi{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Yr extends Fi{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class cl extends Fi{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class hl extends Fi{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class gi extends Fi{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const a=this.current;(t[0]!==a[0]||t[1]!==a[1]||t[2]!==a[2]||t[3]!==a[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Xu extends Fi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class fa extends Fi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindRenderbuffer(a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class uu extends Fi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindTexture(a.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class pa extends Fi{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.bindBuffer(a.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ec extends Fi{getDefault(){return null}set(t){const a=this.gl;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class cu extends Fi{getDefault(){return null}set(t){var a;if(t===this.current&&!this.dirty)return;const c=this.gl;Ea(c)?c.bindVertexArray(t):(a=c.getExtension("OES_vertex_array_object"))===null||a===void 0||a.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Lo extends Fi{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Yu extends Fi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class hu extends Fi{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Do extends Fi{constructor(t,a){super(t),this.context=t,this.parent=a}getDefault(){return null}}class l extends Do{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class _ extends Do{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class S extends Do{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,t),this.current=t,this.dirty=!1}}const B="Framebuffer is not complete";class ${constructor(t,a,c,f,v){this.context=t,this.width=a,this.height=c;const b=t.gl,C=this.framebuffer=b.createFramebuffer();if(this.colorAttachment=new l(t,C),f)this.depthAttachment=v?new S(t,C):new _(t,C);else if(v)throw new Error("Stencil cannot be set without depth");if(b.checkFramebufferStatus(b.FRAMEBUFFER)!==b.FRAMEBUFFER_COMPLETE)throw new Error(B)}destroy(){const t=this.context.gl,a=this.colorAttachment.get();if(a&&t.deleteTexture(a),this.depthAttachment){const c=this.depthAttachment.get();c&&t.deleteRenderbuffer(c)}t.deleteFramebuffer(this.framebuffer)}}class oe{constructor(t){var a,c;if(this.gl=t,this.clearColor=new lr(this),this.clearDepth=new Eo(this),this.clearStencil=new lu(this),this.colorMask=new ll(this),this.depthMask=new ul(this),this.stencilMask=new Nl(this),this.stencilFunc=new Fl(this),this.stencilOp=new Cr(this),this.stencilTest=new Mc(this),this.depthRange=new Ys(this),this.depthTest=new da(this),this.depthFunc=new ns(this),this.blend=new Xr(this),this.blendFunc=new Mr(this),this.blendColor=new Ao(this),this.blendEquation=new Po(this),this.cullFace=new Ws(this),this.cullFaceSide=new zo(this),this.frontFace=new Yr(this),this.program=new cl(this),this.activeTexture=new hl(this),this.viewport=new gi(this),this.bindFramebuffer=new Xu(this),this.bindRenderbuffer=new fa(this),this.bindTexture=new uu(this),this.bindVertexBuffer=new pa(this),this.bindElementBuffer=new Ec(this),this.bindVertexArray=new cu(this),this.pixelStoreUnpack=new Lo(this),this.pixelStoreUnpackPremultiplyAlpha=new Yu(this),this.pixelStoreUnpackFlipY=new hu(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Ea(t)){this.HALF_FLOAT=t.HALF_FLOAT;const f=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(a=t.RGBA16F)!==null&&a!==void 0?a:f?.RGBA16F_EXT,this.RGB16F=(c=t.RGB16F)!==null&&c!==void 0?c:f?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const f=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=f?.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(t,a){return new Mo(this,t,a)}createVertexBuffer(t,a,c){return new $u(this,t,a,c)}createRenderbuffer(t,a,c){const f=this.gl,v=f.createRenderbuffer();return this.bindRenderbuffer.set(v),f.renderbufferStorage(f.RENDERBUFFER,t,a,c),this.bindRenderbuffer.set(null),v}createFramebuffer(t,a,c,f){return new $(this,t,a,c,f)}clear({color:t,depth:a,stencil:c}){const f=this.gl;let v=0;t&&(v|=f.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),a!==void 0&&(v|=f.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(a),this.depthMask.set(!0)),c!==void 0&&(v|=f.STENCIL_BUFFER_BIT,this.clearStencil.set(c),this.stencilMask.set(255)),f.clear(v)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){u.bR(t.blendFunction,en.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Ea(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var a;return Ea(this.gl)?this.gl.deleteVertexArray(t):(a=this.gl.getExtension("OES_vertex_array_object"))===null||a===void 0?void 0:a.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let Ee;function je(g,t,a,c,f){const v=g.context,b=g.transform,C=v.gl,z=g.useProgram("collisionBox"),O=[];let U=0,H=0;for(let fe=0;fe<c.length;fe++){const _e=c[fe],Me=t.getTile(_e).getBucket(a);if(!Me)continue;const me=f?Me.textCollisionBox:Me.iconCollisionBox,Ce=Me.collisionCircleArray;Ce.length>0&&(O.push({circleArray:Ce,circleOffset:H,coord:_e}),U+=Ce.length/4,H=U),me&&z.draw(v,C.LINES,pi.disabled,Di.disabled,g.colorModeForRenderPass(),bi.disabled,es(g.transform),g.style.map.terrain&&g.style.map.terrain.getTerrainData(_e),b.getProjectionData({overscaledTileID:_e,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),a.id,me.layoutVertexBuffer,me.indexBuffer,me.segments,null,g.transform.zoom,null,null,me.collisionVertexBuffer)}if(!f||!O.length)return;const q=g.useProgram("collisionCircle"),Q=new u.ca;Q.resize(4*U),Q._trim();let re=0;for(const fe of O)for(let _e=0;_e<fe.circleArray.length/4;_e++){const Me=4*_e,me=fe.circleArray[Me+0],Ce=fe.circleArray[Me+1],Le=fe.circleArray[Me+2],we=fe.circleArray[Me+3];Q.emplace(re++,me,Ce,Le,we,0),Q.emplace(re++,me,Ce,Le,we,1),Q.emplace(re++,me,Ce,Le,we,2),Q.emplace(re++,me,Ce,Le,we,3)}(!Ee||Ee.length<2*U)&&(Ee=(function(fe){const _e=2*fe,Me=new u.cc;Me.resize(_e),Me._trim();for(let me=0;me<_e;me++){const Ce=6*me;Me.uint16[Ce+0]=4*me+0,Me.uint16[Ce+1]=4*me+1,Me.uint16[Ce+2]=4*me+2,Me.uint16[Ce+3]=4*me+2,Me.uint16[Ce+4]=4*me+3,Me.uint16[Ce+5]=4*me+0}return Me})(U));const de=v.createIndexBuffer(Ee,!0),pe=v.createVertexBuffer(Q,u.cb.members,!0);for(const fe of O){const _e=Sc(g.transform);q.draw(v,C.TRIANGLES,pi.disabled,Di.disabled,g.colorModeForRenderPass(),bi.disabled,_e,g.style.map.terrain&&g.style.map.terrain.getTerrainData(fe.coord),null,a.id,pe,de,u.aX.simpleSegment(0,2*fe.circleOffset,fe.circleArray.length,fe.circleArray.length/2),null,g.transform.zoom,null,null,null)}pe.destroy(),de.destroy()}const tt=u.ar(new Float32Array(16));function vt(g,t,a,c,f,v){const{horizontalAlign:b,verticalAlign:C}=u.aS(g);return new u.P((-(b-.5)*t/f+c[0])*v,(-(C-.5)*a/f+c[1])*v)}function Rt(g,t,a,c,f,v){const b=t.tileAnchorPoint.add(new u.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let C=c.mult(v);a||(C=C.rotate(-f));const z=b.add(C);return fi(z.x,z.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(a){const C=Oi(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(g),z=Math.atan(C.y/C.x)+(C.x<0?Math.PI:0);return g.add(c.rotate(z))}return g.add(c)}function ni(g,t,a,c,f,v,b,C,z,O,U,H){const q=g.text.placedSymbolArray,Q=g.text.dynamicLayoutVertexArray,re=g.icon.dynamicLayoutVertexArray,de={};Q.clear();for(let pe=0;pe<q.length;pe++){const fe=q.get(pe),_e=fe.hidden||!fe.crossTileID||g.allowVerticalPlacement&&!fe.placedOrientation?null:c[fe.crossTileID];if(_e){const Me=new u.P(fe.anchorX,fe.anchorY),me={getElevation:H,width:f.width,height:f.height,pitchedLabelPlaneMatrix:v,pitchWithMap:a,transform:f,tileAnchorPoint:Me,translation:O,unwrappedTileID:U},Ce=a?ys(Me.x,Me.y,me):Oi(Me.x,Me.y,me),Le=Xo(f.cameraToCenterDistance,Ce.signedDistanceFromCamera);let we=u.aA(g.textSizeData,C,fe)*Le/u.aM;a&&(we*=g.tilePixelRatio/b);const{width:Re,height:Ye,anchor:qe,textOffset:$e,textBoxScale:Xe}=_e,Mt=vt(qe,Re,Ye,$e,Xe,we),At=f.getPitchedTextCorrection(Me.x+O[0],Me.y+O[1],U),pt=Rt(Ce.point,me,t,Mt,-f.bearingInRadians,At),Lt=g.allowVerticalPlacement&&fe.placedOrientation===u.az.vertical?Math.PI/2:0;for(let _i=0;_i<fe.numGlyphs;_i++)u.aG(Q,pt,Lt);z&&fe.associatedIconIndex>=0&&(de[fe.associatedIconIndex]={shiftedAnchor:pt,angle:Lt})}else $i(fe.numGlyphs,Q)}if(z){re.clear();const pe=g.icon.placedSymbolArray;for(let fe=0;fe<pe.length;fe++){const _e=pe.get(fe);if(_e.hidden)$i(_e.numGlyphs,re);else{const Me=de[fe];if(Me)for(let me=0;me<_e.numGlyphs;me++)u.aG(re,Me.shiftedAnchor,Me.angle);else $i(_e.numGlyphs,re)}}g.icon.dynamicLayoutVertexBuffer.updateData(re)}g.text.dynamicLayoutVertexBuffer.updateData(Q)}function Mi(g,t,a){return a.iconsInText&&t?"symbolTextAndIcon":g?"symbolSDF":"symbolIcon"}function Xn(g,t,a,c,f,v,b,C,z,O,U,H,q){const Q=g.context,re=Q.gl,de=g.transform,pe=C==="map",fe=z==="map",_e=C!=="viewport"&&a.layout.get("symbol-placement")!=="point",Me=pe&&!fe&&!_e,me=!a.layout.get("symbol-sort-key").isConstant();let Ce=!1;const Le=g.getDepthModeForSublayer(0,pi.ReadOnly),we=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Re=[],Ye=de.getCircleRadiusCorrection();for(const qe of c){const $e=t.getTile(qe),Xe=$e.getBucket(a);if(!Xe)continue;const Mt=f?Xe.text:Xe.icon;if(!Mt||!Mt.segments.get().length||!Mt.hasVisibleVertices)continue;const At=Mt.programConfigurations.get(a.id),pt=f||Xe.sdfIcons,Lt=f?Xe.textSizeData:Xe.iconSizeData,_i=fe||de.pitch!==0,nn=g.useProgram(Mi(pt,f,Xe),At),bn=u.ay(Lt,de.zoom),pn=g.style.map.terrain&&g.style.map.terrain.getTerrainData(qe);let Dn,ln,qn,In,Lr=[0,0],Wn=null;if(f)ln=$e.glyphAtlasTexture,qn=re.LINEAR,Dn=$e.glyphAtlasTexture.size,Xe.iconsInText&&(Lr=$e.imageAtlasTexture.size,Wn=$e.imageAtlasTexture,In=_i||g.options.rotating||g.options.zooming||Lt.kind==="composite"||Lt.kind==="camera"?re.LINEAR:re.NEAREST);else{const sn=a.layout.get("icon-size").constantOr(0)!==1||Xe.iconsNeedLinear;ln=$e.imageAtlasTexture,qn=pt||g.options.rotating||g.options.zooming||sn||_i?re.LINEAR:re.NEAREST,Dn=$e.imageAtlasTexture.size}const Kn=u.aN($e,1,g.transform.zoom),Dr=na(pe,g.transform,Kn),Uo=u.N();u.aB(Uo,Dr);const Vo=Nu(fe,pe,g.transform,Kn),ao=u.aO(de,$e,v,b),Ba=de.getProjectionData({overscaledTileID:qe,applyGlobeMatrix:!q,applyTerrainMatrix:!0}),xu=we&&Xe.hasTextData(),rc=a.layout.get("icon-text-fit")!=="none"&&xu&&Xe.hasIconData();if(_e){const sn=g.style.map.terrain?(cr,gr)=>g.style.map.terrain.getElevation(qe,cr,gr):null,mn=a.layout.get("text-rotation-alignment")==="map";Us(Xe,g,f,Dr,Uo,fe,O,mn,qe.toUnwrapped(),de.width,de.height,ao,sn)}const so=f&&we||rc,Na=_e||so?tt:fe?Dr:g.transform.clipSpaceToPixelsMatrix,ls=pt&&a.paint.get(f?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ls;Ls=pt?Xe.iconsInText?ha(Lt.kind,bn,Me,fe,_e,so,g,Na,Vo,ao,Dn,Lr,Ye):al(Lt.kind,bn,Me,fe,_e,so,g,Na,Vo,ao,f,Dn,0,Ye):Ts(Lt.kind,bn,Me,fe,_e,so,g,Na,Vo,ao,f,Dn,Ye);const Ds={program:nn,buffers:Mt,uniformValues:Ls,projectionData:Ba,atlasTexture:ln,atlasTextureIcon:Wn,atlasInterpolation:qn,atlasInterpolationIcon:In,isSDF:pt,hasHalo:ls};if(me&&Xe.canOverlap){Ce=!0;const sn=Mt.segments.get();for(const mn of sn)Re.push({segments:new u.aX([mn]),sortKey:mn.sortKey,state:Ds,terrainData:pn})}else Re.push({segments:Mt.segments,sortKey:0,state:Ds,terrainData:pn})}Ce&&Re.sort(((qe,$e)=>qe.sortKey-$e.sortKey));for(const qe of Re){const $e=qe.state;if(Q.activeTexture.set(re.TEXTURE0),$e.atlasTexture.bind($e.atlasInterpolation,re.CLAMP_TO_EDGE),$e.atlasTextureIcon&&(Q.activeTexture.set(re.TEXTURE1),$e.atlasTextureIcon&&$e.atlasTextureIcon.bind($e.atlasInterpolationIcon,re.CLAMP_TO_EDGE)),$e.isSDF){const Xe=$e.uniformValues;$e.hasHalo&&(Xe.u_is_halo=1,Nn($e.buffers,qe.segments,a,g,$e.program,Le,U,H,Xe,$e.projectionData,qe.terrainData)),Xe.u_is_halo=0}Nn($e.buffers,qe.segments,a,g,$e.program,Le,U,H,$e.uniformValues,$e.projectionData,qe.terrainData)}}function Nn(g,t,a,c,f,v,b,C,z,O,U){const H=c.context;f.draw(H,H.gl.TRIANGLES,v,b,C,bi.backCCW,z,U,O,a.id,g.layoutVertexBuffer,g.indexBuffer,t,a.paint,c.transform.zoom,g.programConfigurations.get(a.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function ma(g,t,a,c,f){const v=g.context,b=v.gl,C=Di.disabled,z=new en([b.ONE,b.ONE],u.bp.transparent,[!0,!0,!0,!0]),O=t.getBucket(a);if(!O)return;const U=c.key;let H=a.heatmapFbos.get(U);H||(H=ji(v,t.tileSize,t.tileSize),a.heatmapFbos.set(U,H)),v.bindFramebuffer.set(H.framebuffer),v.viewport.set([0,0,t.tileSize,t.tileSize]),v.clear({color:u.bp.transparent});const q=O.programConfigurations.get(a.id),Q=g.useProgram("heatmap",q,!f),re=g.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),de=g.style.map.terrain.getTerrainData(c);Q.draw(v,b.TRIANGLES,pi.disabled,C,z,bi.disabled,ts(t,g.transform.zoom,a.paint.get("heatmap-intensity"),1),de,re,a.id,O.layoutVertexBuffer,O.indexBuffer,O.segments,a.paint,g.transform.zoom,q)}function Ki(g,t,a,c,f){const v=g.context,b=v.gl,C=g.transform;v.setColorMode(g.colorModeForRenderPass());const z=Ii(v,t),O=a.key,U=t.heatmapFbos.get(O);if(!U)return;v.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,U.colorAttachment.get()),v.activeTexture.set(b.TEXTURE1),z.bind(b.LINEAR,b.CLAMP_TO_EDGE);const H=C.getProjectionData({overscaledTileID:a,applyTerrainMatrix:f,applyGlobeMatrix:!c});g.useProgram("heatmapTexture").draw(v,b.TRIANGLES,pi.disabled,Di.disabled,g.colorModeForRenderPass(),bi.disabled,Cc(g,t,0,1),null,H,t.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments,t.paint,C.zoom),U.destroy(),t.heatmapFbos.delete(O)}function ji(g,t,a){var c,f;const v=g.gl,b=v.createTexture();v.bindTexture(v.TEXTURE_2D,b),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR);const C=(c=g.HALF_FLOAT)!==null&&c!==void 0?c:v.UNSIGNED_BYTE,z=(f=g.RGBA16F)!==null&&f!==void 0?f:v.RGBA;v.texImage2D(v.TEXTURE_2D,0,z,t,a,0,v.RGBA,C,null);const O=g.createFramebuffer(t,a,!1,!1);return O.colorAttachment.set(b),O}function Ii(g,t){return t.colorRampTexture||(t.colorRampTexture=new u.T(g,t.colorRamp,g.gl.RGBA)),t.colorRampTexture}function Ks(g,t,a,c,f,v,b,C){let z=256;if(f.stepInterpolant){const O=t.getSource().maxzoom,U=b.canonical.z===O?Math.ceil(1<<g.transform.maxZoom-b.canonical.z):1;z=u.an(u.ce(v.maxLineLength/u.a5*1024*U),256,a.maxTextureSize)}return C.gradient=u.cf({expression:f.gradientExpression(),evaluationKey:"lineProgress",resolution:z,image:C.gradient||void 0,clips:v.lineClipsArray}),C.texture?C.texture.update(C.gradient):C.texture=new u.T(a,C.gradient,c.RGBA),C.version=f.gradientVersion,C.texture}function Aa(g,t,a,c,f){g.activeTexture.set(t.TEXTURE0),a.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),c.updatePaintBuffers(f)}function Sn(g,t,a,c,f,v){(f||g.lineAtlas.dirty)&&(t.activeTexture.set(a.TEXTURE0),g.lineAtlas.bind(t)),c.updatePaintBuffers(v)}function ga(g,t,a,c,f,v,b){const C=v.gradients[f.id];let z=C.texture;f.gradientVersion!==C.version&&(z=Ks(g,t,a,c,f,v,b,C)),a.activeTexture.set(c.TEXTURE0),z.bind(f.stepInterpolant?c.NEAREST:c.LINEAR,c.CLAMP_TO_EDGE)}function Wr(g,t,a,c,f,v,b,C,z){const O=v.gradients[f.id];let U=O.texture;f.gradientVersion!==O.version&&(U=Ks(g,t,a,c,f,v,b,O)),a.activeTexture.set(c.TEXTURE0),U.bind(f.stepInterpolant?c.NEAREST:c.LINEAR,c.CLAMP_TO_EDGE),a.activeTexture.set(c.TEXTURE1),g.lineAtlas.bind(a),C.updatePaintBuffers(z)}function zn(g,t,a,c,f){if(!a||!c||!c.imageAtlas)return;const v=c.imageAtlas.patternPositions;let b=v[a.to.toString()],C=v[a.from.toString()];if(!b&&C&&(b=C),!C&&b&&(C=b),!b||!C){const z=f.getPaintProperty(t);b=v[z],C=v[z]}b&&C&&g.setConstantPatternPositions(b,C)}function Pa(g,t,a,c,f,v,b,C){const z=g.context.gl,O="fill-pattern",U=a.paint.get(O),H=U&&U.constantOr(1),q=a.getCrossfadeParameters();let Q,re,de,pe,fe;const _e=g.transform,Me=a.paint.get("fill-translate"),me=a.paint.get("fill-translate-anchor");b?(re=H&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Q=z.LINES):(re=H?"fillPattern":"fill",Q=z.TRIANGLES);const Ce=U.constantOr(null);for(const Le of c){const we=t.getTile(Le);if(H&&!we.patternsLoaded())continue;const Re=we.getBucket(a);if(!Re)continue;const Ye=Re.programConfigurations.get(a.id),qe=g.useProgram(re,Ye),$e=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Le);H&&(g.context.activeTexture.set(z.TEXTURE0),we.imageAtlasTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE),Ye.updatePaintBuffers(q)),zn(Ye,O,Ce,we,a);const Xe=_e.getProjectionData({overscaledTileID:Le,applyGlobeMatrix:!C,applyTerrainMatrix:!0}),Mt=u.aO(_e,we,Me,me);if(b){pe=Re.indexBuffer2,fe=Re.segments2;const pt=[z.drawingBufferWidth,z.drawingBufferHeight];de=re==="fillOutlinePattern"&&H?kl(g,q,we,pt,Mt):Il(pt,Mt)}else pe=Re.indexBuffer,fe=Re.segments,de=H?ka(g,q,we,Mt):{u_fill_translate:Mt};const At=g.stencilModeForClipping(Le);qe.draw(g.context,Q,f,At,v,bi.backCCW,de,$e,Xe,a.id,Re.layoutVertexBuffer,pe,fe,a.paint,g.transform.zoom,Ye)}}function Ss(g,t,a,c,f,v,b,C){const z=g.context,O=z.gl,U="fill-extrusion-pattern",H=a.paint.get(U),q=H.constantOr(1),Q=a.getCrossfadeParameters(),re=a.paint.get("fill-extrusion-opacity"),de=H.constantOr(null),pe=g.transform;for(const fe of c){const _e=t.getTile(fe),Me=_e.getBucket(a);if(!Me)continue;const me=g.style.map.terrain&&g.style.map.terrain.getTerrainData(fe),Ce=Me.programConfigurations.get(a.id),Le=g.useProgram(q?"fillExtrusionPattern":"fillExtrusion",Ce);q&&(g.context.activeTexture.set(O.TEXTURE0),_e.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),Ce.updatePaintBuffers(Q));const we=pe.getProjectionData({overscaledTileID:fe,applyGlobeMatrix:!C,applyTerrainMatrix:!0});zn(Ce,U,de,_e,a);const Re=u.aO(pe,_e,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),Ye=a.paint.get("fill-extrusion-vertical-gradient"),qe=q?Hu(g,Ye,re,Re,fe,Q,_e):Ia(g,Ye,re,Re);Le.draw(z,z.gl.TRIANGLES,f,v,b,bi.backCCW,qe,me,we,a.id,Me.layoutVertexBuffer,Me.indexBuffer,Me.segments,a.paint,g.transform.zoom,Ce,g.style.map.terrain&&Me.centroidVertexBuffer)}}function Cs(g,t,a,c,f,v,b,C,z){var O;const U=g.style.projection,H=g.context,q=g.transform,Q=H.gl,re=[`#define NUM_ILLUMINATION_SOURCES ${a.paint.get("hillshade-highlight-color").values.length}`],de=g.useProgram("hillshade",null,!1,re),pe=!g.options.moving;for(const fe of c){const _e=t.getTile(fe),Me=_e.fbo;if(!Me)continue;const me=U.getMeshFromTileID(H,fe.canonical,C,!0,"raster"),Ce=(O=g.style.map.terrain)===null||O===void 0?void 0:O.getTerrainData(fe);H.activeTexture.set(Q.TEXTURE0),Q.bindTexture(Q.TEXTURE_2D,Me.colorAttachment.get());const Le=q.getProjectionData({overscaledTileID:fe,aligned:pe,applyGlobeMatrix:!z,applyTerrainMatrix:!0});de.draw(H,Q.TRIANGLES,v,f[fe.overscaledZ],b,bi.backCCW,nl(g,_e,a),Ce,Le,a.id,me.vertexBuffer,me.indexBuffer,me.segments)}}function Qs(g,t,a,c,f,v,b,C,z){var O;const U=g.style.projection,H=g.context,q=g.transform,Q=H.gl,re=g.useProgram("colorRelief"),de=!g.options.moving;let pe=!0,fe=0;for(const _e of c){const Me=t.getTile(_e),me=Me.dem;if(pe){const qe=Q.getParameter(Q.MAX_TEXTURE_SIZE),{elevationTexture:$e,colorTexture:Xe}=a.getColorRampTextures(H,qe,me.getUnpackVector());H.activeTexture.set(Q.TEXTURE1),$e.bind(Q.NEAREST,Q.CLAMP_TO_EDGE),H.activeTexture.set(Q.TEXTURE4),Xe.bind(Q.LINEAR,Q.CLAMP_TO_EDGE),pe=!1,fe=$e.size[0]}if(!me||!me.data)continue;const Ce=me.stride,Le=me.getPixels();if(H.activeTexture.set(Q.TEXTURE0),H.pixelStoreUnpackPremultiplyAlpha.set(!1),Me.demTexture=Me.demTexture||g.getTileTexture(Ce),Me.demTexture){const qe=Me.demTexture;qe.update(Le,{premultiply:!1}),qe.bind(Q.LINEAR,Q.CLAMP_TO_EDGE)}else Me.demTexture=new u.T(H,Le,Q.RGBA,{premultiply:!1}),Me.demTexture.bind(Q.LINEAR,Q.CLAMP_TO_EDGE);const we=U.getMeshFromTileID(H,_e.canonical,C,!0,"raster"),Re=(O=g.style.map.terrain)===null||O===void 0?void 0:O.getTerrainData(_e),Ye=q.getProjectionData({overscaledTileID:_e,aligned:de,applyGlobeMatrix:!z,applyTerrainMatrix:!0});re.draw(H,Q.TRIANGLES,v,f[_e.overscaledZ],b,bi.backCCW,oh(a,Me.dem,fe),Re,Ye,a.id,we.vertexBuffer,we.indexBuffer,we.segments)}}const rs=[new u.P(0,0),new u.P(u.a5,0),new u.P(u.a5,u.a5),new u.P(0,u.a5)];function za(g,t,a,c,f,v,b,C,z=!1,O=!1){const U=c[c.length-1].overscaledZ,H=g.context,q=H.gl,Q=g.useProgram("raster"),re=g.transform,de=g.style.projection,pe=g.colorModeForRenderPass(),fe=!g.options.moving,_e=a.paint.get("raster-opacity"),Me=a.paint.get("raster-resampling"),me=a.paint.get("raster-fade-duration"),Ce=!!g.style.map.terrain;for(const Le of c){const we=g.getDepthModeForSublayer(Le.overscaledZ-U,_e===1?pi.ReadWrite:pi.ReadOnly,q.LESS),Re=t.getTile(Le),Ye=Me==="nearest"?q.NEAREST:q.LINEAR;H.activeTexture.set(q.TEXTURE0),Re.texture.bind(Ye,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST),H.activeTexture.set(q.TEXTURE1);const{parentTile:qe,parentScaleBy:$e,parentTopLeft:Xe,fadeValues:Mt}=Ms(Re,t,me,Ce);Re.fadeOpacity=Mt.tileOpacity,qe?(qe.fadeOpacity=Mt.parentTileOpacity,qe.texture.bind(Ye,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST)):Re.texture.bind(Ye,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST),Re.texture.useMipmap&&H.extTextureFilterAnisotropic&&g.transform.pitch>20&&q.texParameterf(q.TEXTURE_2D,H.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,H.extTextureFilterAnisotropicMax);const At=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Le),pt=re.getProjectionData({overscaledTileID:Le,aligned:fe,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),Lt=Ol(Xe,$e,Mt.fadeMix,a,C),_i=de.getMeshFromTileID(H,Le.canonical,v,b,"raster");Q.draw(H,q.TRIANGLES,we,f?f[Le.overscaledZ]:Di.disabled,pe,z?bi.frontCCW:bi.backCCW,Lt,At,pt,a.id,_i.vertexBuffer,_i.indexBuffer,_i.segments)}}function Ms(g,t,a,c){const f={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(a===0||c)return f;if(g.fadingParentID){const v=t.getLoadedTile(g.fadingParentID);if(!v)return f;const b=Math.pow(2,v.tileID.overscaledZ-g.tileID.overscaledZ),C=[g.tileID.canonical.x*b%1,g.tileID.canonical.y*b%1],z=(function(O,U,H){const q=Te(),Q=(q-U.timeAdded)/H,re=O.fadingDirection===Pe.Incoming,de=u.an((q-O.timeAdded)/H,0,1),pe=u.an(1-Q,0,1),fe=re?de:pe;return{tileOpacity:fe,parentTileOpacity:re?pe:de,fadeMix:{opacity:1,mix:1-fe}}})(g,v,a);return{parentTile:v,parentScaleBy:b,parentTopLeft:C,fadeValues:z}}if(g.selfFading){const v=(function(b,C){const z=(Te()-b.timeAdded)/C,O=u.an(z,0,1);return{tileOpacity:O,fadeMix:{opacity:O,mix:0}}})(g,a);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:v}}return f}const dl=new u.bp(1,0,0,1),Io=new u.bp(0,1,0,1),ch=new u.bp(0,0,1,1),hh=new u.bp(1,0,1,1),as=new u.bp(0,1,1,1);function Wu(g,t,a,c){ur(g,0,t+a/2,g.transform.width,a,c)}function fl(g,t,a,c){ur(g,t-a/2,0,a,g.transform.height,c)}function ur(g,t,a,c,f,v){const b=g.context,C=b.gl;C.enable(C.SCISSOR_TEST),C.scissor(t*g.pixelRatio,a*g.pixelRatio,c*g.pixelRatio,f*g.pixelRatio),b.clear({color:v}),C.disable(C.SCISSOR_TEST)}function Ac(g,t,a){const c=g.context,f=c.gl,v=g.useProgram("debug"),b=pi.disabled,C=Di.disabled,z=g.colorModeForRenderPass(),O="$debug",U=g.style.map.terrain&&g.style.map.terrain.getTerrainData(a);c.activeTexture.set(f.TEXTURE0);const H=t.getTileByID(a.key).latestRawTileData,q=Math.floor((H&&H.byteLength||0)/1024),Q=t.getTile(a).tileSize,re=512/Math.min(Q,512)*(a.overscaledZ/g.transform.zoom)*.5;let de=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(de+=` => ${a.overscaledZ}`),(function(fe,_e){fe.initDebugOverlayCanvas();const Me=fe.debugOverlayCanvas,me=fe.context.gl,Ce=fe.debugOverlayCanvas.getContext("2d");Ce.clearRect(0,0,Me.width,Me.height),Ce.shadowColor="white",Ce.shadowBlur=2,Ce.lineWidth=1.5,Ce.strokeStyle="white",Ce.textBaseline="top",Ce.font="bold 36px Open Sans, sans-serif",Ce.fillText(_e,5,5),Ce.strokeText(_e,5,5),fe.debugOverlayTexture.update(Me),fe.debugOverlayTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE)})(g,`${de} ${q}kB`);const pe=g.transform.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!0,applyTerrainMatrix:!0});v.draw(c,f.TRIANGLES,b,C,en.alphaBlended,bi.disabled,Ra(u.bp.transparent,re),null,pe,O,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),v.draw(c,f.LINE_STRIP,b,C,z,bi.disabled,Ra(u.bp.red),U,pe,O,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function dh(g,t,a,c){const{isRenderingGlobe:f}=c,v=g.context,b=v.gl,C=g.transform,z=g.colorModeForRenderPass(),O=g.getDepthModeFor3D(),U=g.useProgram("terrain");v.bindFramebuffer.set(null),v.viewport.set([0,0,g.width,g.height]);for(const H of a){const q=t.getTerrainMesh(H.tileID),Q=g.renderToTexture.getTexture(H),re=t.getTerrainData(H.tileID);v.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,Q.texture);const de=t.getMeshFrameDelta(C.zoom),pe=C.calculateFogMatrix(H.tileID.toUnwrapped()),fe=Tc(de,pe,g.style.sky,C.pitch,f),_e=C.getProjectionData({overscaledTileID:H.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});U.draw(v,b.TRIANGLES,O,Di.disabled,z,bi.backCCW,fe,re,_e,"terrain",q.vertexBuffer,q.indexBuffer,q.segments)}}function Xh(g,t){if(!t.mesh){const a=new u.aW;a.emplaceBack(-1,-1),a.emplaceBack(1,-1),a.emplaceBack(1,1),a.emplaceBack(-1,1);const c=new u.aY;c.emplaceBack(0,1,2),c.emplaceBack(0,2,3),t.mesh=new Ji(g.createVertexBuffer(a,aa.members),g.createIndexBuffer(c),u.aX.simpleSegment(0,0,a.length,c.length))}return t.mesh}class Gd{constructor(t,a){this.context=new oe(t),this.transform=a,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:u.ar(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Pi.maxOverzooming+Pi.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new or}resize(t,a,c){if(this.width=Math.floor(t*c),this.height=Math.floor(a*c),this.pixelRatio=c,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const f of this.style._order)this.style._layers[f].resize()}setup(){const t=this.context,a=new u.aW;a.emplaceBack(0,0),a.emplaceBack(u.a5,0),a.emplaceBack(0,u.a5),a.emplaceBack(u.a5,u.a5),this.tileExtentBuffer=t.createVertexBuffer(a,aa.members),this.tileExtentSegments=u.aX.simpleSegment(0,0,4,2);const c=new u.aW;c.emplaceBack(0,0),c.emplaceBack(u.a5,0),c.emplaceBack(0,u.a5),c.emplaceBack(u.a5,u.a5),this.debugBuffer=t.createVertexBuffer(c,aa.members),this.debugSegments=u.aX.simpleSegment(0,0,4,5);const f=new u.ch;f.emplaceBack(0,0,0,0),f.emplaceBack(u.a5,0,u.a5,0),f.emplaceBack(0,u.a5,0,u.a5),f.emplaceBack(u.a5,u.a5,u.a5,u.a5),this.rasterBoundsBuffer=t.createVertexBuffer(f,rh.members),this.rasterBoundsSegments=u.aX.simpleSegment(0,0,4,2);const v=new u.aW;v.emplaceBack(0,0),v.emplaceBack(u.a5,0),v.emplaceBack(0,u.a5),v.emplaceBack(u.a5,u.a5),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(v,aa.members),this.rasterBoundsSegmentsPosOnly=u.aX.simpleSegment(0,0,4,5);const b=new u.aW;b.emplaceBack(0,0),b.emplaceBack(1,0),b.emplaceBack(0,1),b.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(b,aa.members),this.viewportSegments=u.aX.simpleSegment(0,0,4,2);const C=new u.ci;C.emplaceBack(0),C.emplaceBack(1),C.emplaceBack(3),C.emplaceBack(2),C.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(C);const z=new u.aY;z.emplaceBack(1,0,2),z.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(z);const O=this.context.gl;this.stencilClearMode=new Di({func:O.ALWAYS,mask:0},0,255,O.ZERO,O.ZERO,O.ZERO),this.tileExtentMesh=new Ji(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const t=this.context,a=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const c=u.N();u.c7(c,0,this.width,this.height,0,0,1),u.Q(c,c,[a.drawingBufferWidth,a.drawingBufferHeight,0]);const f={mainMatrix:c,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:c};this.useProgram("clippingMask",null,!0).draw(t,a.TRIANGLES,pi.disabled,this.stencilClearMode,en.disabled,bi.disabled,null,null,f,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,a,c){if(this.currentStencilSource===t.source||!t.isTileClipped()||!a||!a.length)return;this.currentStencilSource=t.source,this.nextStencilID+a.length>256&&this.clearStencil();const f=this.context;f.setColorMode(en.disabled),f.setDepthMode(pi.disabled);const v={};for(const b of a)v[b.key]=this.nextStencilID++;this._renderTileMasks(v,a,c,!0),this._renderTileMasks(v,a,c,!1),this._tileClippingMaskIDs=v}_renderTileMasks(t,a,c,f){const v=this.context,b=v.gl,C=this.style.projection,z=this.transform,O=this.useProgram("clippingMask");for(const U of a){const H=t[U.key],q=this.style.map.terrain&&this.style.map.terrain.getTerrainData(U),Q=C.getMeshFromTileID(this.context,U.canonical,f,!0,"stencil"),re=z.getProjectionData({overscaledTileID:U,applyGlobeMatrix:!c,applyTerrainMatrix:!0});O.draw(v,b.TRIANGLES,pi.disabled,new Di({func:b.ALWAYS,mask:0},H,255,b.KEEP,b.KEEP,b.REPLACE),en.disabled,c?bi.disabled:bi.backCCW,null,q,re,"$clipping",Q.vertexBuffer,Q.indexBuffer,Q.segments)}}_renderTilesDepthBuffer(){const t=this.context,a=t.gl,c=this.style.projection,f=this.transform,v=this.useProgram("depth"),b=this.getDepthModeFor3D(),C=dn(f,{tileSize:f.tileSize});for(const z of C){const O=this.style.map.terrain&&this.style.map.terrain.getTerrainData(z),U=c.getMeshFromTileID(this.context,z.canonical,!0,!0,"raster"),H=f.getProjectionData({overscaledTileID:z,applyGlobeMatrix:!0,applyTerrainMatrix:!0});v.draw(t,a.TRIANGLES,b,Di.disabled,en.disabled,bi.backCCW,null,O,H,"$clipping",U.vertexBuffer,U.indexBuffer,U.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,a=this.context.gl;return new Di({func:a.NOTEQUAL,mask:255},t,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(t){const a=this.context.gl;return new Di({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,a.KEEP,a.KEEP,a.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){const a=this.context.gl,c=t.sort(((b,C)=>C.overscaledZ-b.overscaledZ)),f=c[c.length-1].overscaledZ,v=c[0].overscaledZ-f+1;if(v>1){this.currentStencilSource=void 0,this.nextStencilID+v>256&&this.clearStencil();const b={};for(let C=0;C<v;C++)b[C+f]=new Di({func:a.GEQUAL,mask:255},C+this.nextStencilID,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID+=v,[b,c]}return[{[f]:Di.disabled},c]}stencilConfigForOverlapTwoPass(t){const a=this.context.gl,c=t.sort(((b,C)=>C.overscaledZ-b.overscaledZ)),f=c[c.length-1].overscaledZ,v=c[0].overscaledZ-f+1;if(this.clearStencil(),v>1){const b={},C={};for(let z=0;z<v;z++)b[z+f]=new Di({func:a.GREATER,mask:255},v+1+z,255,a.KEEP,a.KEEP,a.REPLACE),C[z+f]=new Di({func:a.GREATER,mask:255},1+z,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID=2*v+1,[b,C,c]}return this.nextStencilID=3,[{[f]:new Di({func:a.GREATER,mask:255},2,255,a.KEEP,a.KEEP,a.REPLACE)},{[f]:new Di({func:a.GREATER,mask:255},1,255,a.KEEP,a.KEEP,a.REPLACE)},c]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new en([t.CONSTANT_COLOR,t.ONE],new u.bp(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?en.unblended:en.alphaBlended}getDepthModeForSublayer(t,a,c){if(!this.opaquePassEnabledForLayer())return pi.disabled;const f=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new pi(c||this.context.gl.LEQUAL,a,[f,f])}getDepthModeFor3D(){return new pi(this.context.gl.LEQUAL,pi.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,a){var c,f;this.style=t,this.options=a,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(Te()),this.imageManager.beginFrame();const v=this.style._order,b=this.style.tileManagers,C={},z={},O={},U={isRenderingToTexture:!1,isRenderingGlobe:((c=t.projection)===null||c===void 0?void 0:c.transitionState)>0};for(const q in b){const Q=b[q];Q.used&&Q.prepare(this.context),C[q]=Q.getVisibleCoordinates(!1),z[q]=C[q].slice().reverse(),O[q]=Q.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let q=0;q<v.length;q++)if(this.style._layers[v[q]].is3D()){this.opaquePassCutoff=q;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const q of v){const Q=this.style._layers[q];if(!Q.hasOffscreenPass()||Q.isHidden(this.transform.zoom))continue;const re=z[Q.source];(Q.type==="custom"||re.length)&&this.renderLayer(this,b[Q.source],Q,re,U)}if((f=this.style.projection)===null||f===void 0||f.updateGPUdependent({context:this.context,useProgram:q=>this.useProgram(q)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?u.bp.black:u.bp.transparent,depth:1}),this.clearStencil(),this.style.sky&&(function(q,Q){const re=q.context,de=re.gl,pe=((Le,we,Re)=>{const Ye=Math.cos(we.rollInRadians),qe=Math.sin(we.rollInRadians),$e=it(we),Xe=we.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:Le.properties.get("sky-color"),u_horizon_color:Le.properties.get("horizon-color"),u_horizon:[(we.width/2-$e*qe)*Re,(we.height/2+$e*Ye)*Re],u_horizon_normal:[-qe,Ye],u_sky_horizon_blend:Le.properties.get("sky-horizon-blend")*we.height/2*Re,u_sky_blend:Xe}})(Q,q.style.map.transform,q.pixelRatio),fe=new pi(de.LEQUAL,pi.ReadWrite,[0,1]),_e=Di.disabled,Me=q.colorModeForRenderPass(),me=q.useProgram("sky"),Ce=Xh(re,Q);me.draw(re,de.TRIANGLES,fe,_e,Me,bi.disabled,pe,null,void 0,"sky",Ce.vertexBuffer,Ce.indexBuffer,Ce.segments)})(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=v.length-1;this.currentLayer>=0;this.currentLayer--){const q=this.style._layers[v[this.currentLayer]],Q=b[q.source],re=C[q.source];this._renderTileClippingMasks(q,re,!1),this.renderLayer(this,Q,q,re,U)}this.renderPass="translucent";let H=!1;for(this.currentLayer=0;this.currentLayer<v.length;this.currentLayer++){const q=this.style._layers[v[this.currentLayer]],Q=b[q.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(q,U))continue;this.opaquePassEnabledForLayer()||H||(H=!0,U.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const re=(q.type==="symbol"?O:z)[q.source];this._renderTileClippingMasks(q,C[q.source],!!this.renderToTexture),this.renderLayer(this,Q,q,re,U)}if(U.isRenderingGlobe&&(function(q,Q,re){const de=q.context,pe=de.gl,fe=q.useProgram("atmosphere"),_e=new pi(pe.LEQUAL,pi.ReadOnly,[0,1]),Me=q.transform,me=(function(Xe,Mt){const At=Xe.properties.get("position"),pt=[-At.x,-At.y,-At.z],Lt=u.ar(new Float64Array(16));return Xe.properties.get("anchor")==="map"&&(u.bg(Lt,Lt,Mt.rollInRadians),u.bh(Lt,Lt,-Mt.pitchInRadians),u.bg(Lt,Lt,Mt.bearingInRadians),u.bh(Lt,Lt,Mt.center.lat*Math.PI/180),u.bJ(Lt,Lt,-Mt.center.lng*Math.PI/180)),u.cg(pt,pt,Lt),pt})(re,q.transform),Ce=Me.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),Le=Q.properties.get("atmosphere-blend")*Ce.projectionTransition;if(Le===0)return;const we=Gs(Me.worldSize,Me.center.lat),Re=Me.inverseProjectionMatrix,Ye=new Float64Array(4);Ye[3]=1,u.aH(Ye,Ye,Me.modelViewProjectionMatrix),Ye[0]/=Ye[3],Ye[1]/=Ye[3],Ye[2]/=Ye[3],Ye[3]=1,u.aH(Ye,Ye,Re),Ye[0]/=Ye[3],Ye[1]/=Ye[3],Ye[2]/=Ye[3],Ye[3]=1;const qe=((Xe,Mt,At,pt,Lt)=>({u_sun_pos:Xe,u_atmosphere_blend:Mt,u_globe_position:At,u_globe_radius:pt,u_inv_proj_matrix:Lt}))(me,Le,[Ye[0],Ye[1],Ye[2]],we,Re),$e=Xh(de,Q);fe.draw(de,pe.TRIANGLES,_e,Di.disabled,en.alphaBlended,bi.disabled,qe,null,null,"atmosphere",$e.vertexBuffer,$e.indexBuffer,$e.segments)})(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const q=(function(Q,re){let de=null;const pe=Object.values(Q._layers).flatMap((me=>me.source&&!me.isHidden(re)?[Q.tileManagers[me.source]]:[])),fe=pe.filter((me=>me.getSource().type==="vector")),_e=pe.filter((me=>me.getSource().type!=="vector")),Me=me=>{(!de||de.getSource().maxzoom<me.getSource().maxzoom)&&(de=me)};return fe.forEach((me=>Me(me))),de||_e.forEach((me=>Me(me))),de})(this.style,this.transform.zoom);q&&(function(Q,re,de){for(let pe=0;pe<de.length;pe++)Ac(Q,re,de[pe])})(this,q,q.getVisibleCoordinates())}this.options.showPadding&&(function(q){const Q=q.transform.padding;Wu(q,q.transform.height-(Q.top||0),3,dl),Wu(q,Q.bottom||0,3,Io),fl(q,Q.left||0,3,ch),fl(q,q.transform.width-(Q.right||0),3,hh);const re=q.transform.centerPoint;(function(de,pe,fe,_e){ur(de,pe-1,fe-10,2,20,_e),ur(de,pe-10,fe-1,20,2,_e)})(q,re.x,q.transform.height-re.y,as)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const a=this.terrainFacilitator.matrix,c=this.transform.modelViewProjectionMatrix;let f=this.terrainFacilitator.dirty;f||(f=t?!u.cj(a,c):!u.ck(a,c)),f||(f=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),f&&(u.cl(a,c),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(v,b){const C=v.context,z=C.gl,O=v.transform,U=en.unblended,H=new pi(z.LEQUAL,pi.ReadWrite,[0,1]),q=b.tileManager.getRenderableTiles(),Q=v.useProgram("terrainDepth");C.bindFramebuffer.set(b.getFramebuffer("depth").framebuffer),C.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),C.clear({color:u.bp.transparent,depth:1});for(const re of q){const de=b.getTerrainMesh(re.tileID),pe=b.getTerrainData(re.tileID),fe=O.getProjectionData({overscaledTileID:re.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),_e={u_ele_delta:b.getMeshFrameDelta(O.zoom)};Q.draw(C,z.TRIANGLES,H,Di.disabled,U,bi.backCCW,_e,pe,fe,"terrain",de.vertexBuffer,de.indexBuffer,de.segments)}C.bindFramebuffer.set(null),C.viewport.set([0,0,v.width,v.height])})(this,this.style.map.terrain),(function(v,b){const C=v.context,z=C.gl,O=v.transform,U=en.unblended,H=new pi(z.LEQUAL,pi.ReadWrite,[0,1]),q=b.getCoordsTexture(),Q=b.tileManager.getRenderableTiles(),re=v.useProgram("terrainCoords");C.bindFramebuffer.set(b.getFramebuffer("coords").framebuffer),C.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),C.clear({color:u.bp.transparent,depth:1}),b.coordsIndex=[];for(const de of Q){const pe=b.getTerrainMesh(de.tileID),fe=b.getTerrainData(de.tileID);C.activeTexture.set(z.TEXTURE0),z.bindTexture(z.TEXTURE_2D,q.texture);const _e={u_terrain_coords_id:(255-b.coordsIndex.length)/255,u_texture:0,u_ele_delta:b.getMeshFrameDelta(O.zoom)},Me=O.getProjectionData({overscaledTileID:de.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});re.draw(C,z.TRIANGLES,H,Di.disabled,U,bi.backCCW,_e,fe,Me,"terrain",pe.vertexBuffer,pe.indexBuffer,pe.segments),b.coordsIndex.push(de.tileID.key)}C.bindFramebuffer.set(null),C.viewport.set([0,0,v.width,v.height])})(this,this.style.map.terrain))}renderLayer(t,a,c,f,v){c.isHidden(this.transform.zoom)||(c.type==="background"||c.type==="custom"||(f||[]).length)&&(this.id=c.id,u.cm(c)?(function(b,C,z,O,U,H){if(b.renderPass!=="translucent")return;const{isRenderingToTexture:q}=H,Q=Di.disabled,re=b.colorModeForRenderPass();(z._unevaluatedLayout.hasValue("text-variable-anchor")||z._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(de,pe,fe,_e,Me,me,Ce,Le,we){const Re=pe.transform,Ye=pe.style.map.terrain,qe=Me==="map",$e=me==="map";for(const Xe of de){const Mt=_e.getTile(Xe),At=Mt.getBucket(fe);if(!At||!At.text||!At.text.segments.get().length)continue;const pt=u.ay(At.textSizeData,Re.zoom),Lt=u.aN(Mt,1,pe.transform.zoom),_i=na(qe,pe.transform,Lt),nn=fe.layout.get("icon-text-fit")!=="none"&&At.hasIconData();if(pt){const bn=Math.pow(2,Re.zoom-Mt.tileID.overscaledZ),pn=Ye?(Dn,ln)=>Ye.getElevation(Xe,Dn,ln):null;ni(At,qe,$e,we,Re,_i,bn,pt,nn,u.aO(Re,Mt,Ce,Le),Xe.toUnwrapped(),pn)}}})(O,b,z,C,z.layout.get("text-rotation-alignment"),z.layout.get("text-pitch-alignment"),z.paint.get("text-translate"),z.paint.get("text-translate-anchor"),U),z.paint.get("icon-opacity").constantOr(1)!==0&&Xn(b,C,z,O,!1,z.paint.get("icon-translate"),z.paint.get("icon-translate-anchor"),z.layout.get("icon-rotation-alignment"),z.layout.get("icon-pitch-alignment"),z.layout.get("icon-keep-upright"),Q,re,q),z.paint.get("text-opacity").constantOr(1)!==0&&Xn(b,C,z,O,!0,z.paint.get("text-translate"),z.paint.get("text-translate-anchor"),z.layout.get("text-rotation-alignment"),z.layout.get("text-pitch-alignment"),z.layout.get("text-keep-upright"),Q,re,q),C.map.showCollisionBoxes&&(je(b,C,z,O,!0),je(b,C,z,O,!1))})(t,a,c,f,this.style.placement.variableOffsets,v):u.cn(c)?(function(b,C,z,O,U){if(b.renderPass!=="translucent")return;const{isRenderingToTexture:H}=U,q=z.paint.get("circle-opacity"),Q=z.paint.get("circle-stroke-width"),re=z.paint.get("circle-stroke-opacity"),de=!z.layout.get("circle-sort-key").isConstant();if(q.constantOr(1)===0&&(Q.constantOr(1)===0||re.constantOr(1)===0))return;const pe=b.context,fe=pe.gl,_e=b.transform,Me=b.getDepthModeForSublayer(0,pi.ReadOnly),me=Di.disabled,Ce=b.colorModeForRenderPass(),Le=[],we=_e.getCircleRadiusCorrection();for(let Re=0;Re<O.length;Re++){const Ye=O[Re],qe=C.getTile(Ye),$e=qe.getBucket(z);if(!$e)continue;const Xe=z.paint.get("circle-translate"),Mt=z.paint.get("circle-translate-anchor"),At=u.aO(_e,qe,Xe,Mt),pt=$e.programConfigurations.get(z.id),Lt=b.useProgram("circle",pt),_i=$e.layoutVertexBuffer,nn=$e.indexBuffer,bn=b.style.map.terrain&&b.style.map.terrain.getTerrainData(Ye),pn={programConfiguration:pt,program:Lt,layoutVertexBuffer:_i,indexBuffer:nn,uniformValues:Rl(b,qe,z,At,we),terrainData:bn,projectionData:_e.getProjectionData({overscaledTileID:Ye,applyGlobeMatrix:!H,applyTerrainMatrix:!0})};if(de){const Dn=$e.segments.get();for(const ln of Dn)Le.push({segments:new u.aX([ln]),sortKey:ln.sortKey,state:pn})}else Le.push({segments:$e.segments,sortKey:0,state:pn})}de&&Le.sort(((Re,Ye)=>Re.sortKey-Ye.sortKey));for(const Re of Le){const{programConfiguration:Ye,program:qe,layoutVertexBuffer:$e,indexBuffer:Xe,uniformValues:Mt,terrainData:At,projectionData:pt}=Re.state;qe.draw(pe,fe.TRIANGLES,Me,me,Ce,bi.backCCW,Mt,At,pt,z.id,$e,Xe,Re.segments,z.paint,b.transform.zoom,Ye)}})(t,a,c,f,v):u.co(c)?(function(b,C,z,O,U){if(z.paint.get("heatmap-opacity")===0)return;const H=b.context,{isRenderingToTexture:q,isRenderingGlobe:Q}=U;if(b.style.map.terrain){for(const re of O){const de=C.getTile(re);C.hasRenderableParent(re)||(b.renderPass==="offscreen"?ma(b,de,z,re,Q):b.renderPass==="translucent"&&Ki(b,z,re,q,Q))}H.viewport.set([0,0,b.width,b.height])}else b.renderPass==="offscreen"?(function(re,de,pe,fe){const _e=re.context,Me=_e.gl,me=re.transform,Ce=Di.disabled,Le=new en([Me.ONE,Me.ONE],u.bp.transparent,[!0,!0,!0,!0]);(function(we,Re,Ye){const qe=we.gl;we.activeTexture.set(qe.TEXTURE1),we.viewport.set([0,0,Re.width/4,Re.height/4]);let $e=Ye.heatmapFbos.get(u.cd);$e?(qe.bindTexture(qe.TEXTURE_2D,$e.colorAttachment.get()),we.bindFramebuffer.set($e.framebuffer)):($e=ji(we,Re.width/4,Re.height/4),Ye.heatmapFbos.set(u.cd,$e))})(_e,re,pe),_e.clear({color:u.bp.transparent});for(let we=0;we<fe.length;we++){const Re=fe[we];if(de.hasRenderableParent(Re))continue;const Ye=de.getTile(Re),qe=Ye.getBucket(pe);if(!qe)continue;const $e=qe.programConfigurations.get(pe.id),Xe=re.useProgram("heatmap",$e),Mt=me.getProjectionData({overscaledTileID:Re,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),At=me.getCircleRadiusCorrection();Xe.draw(_e,Me.TRIANGLES,pi.disabled,Ce,Le,bi.backCCW,ts(Ye,me.zoom,pe.paint.get("heatmap-intensity"),At),null,Mt,pe.id,qe.layoutVertexBuffer,qe.indexBuffer,qe.segments,pe.paint,me.zoom,$e)}_e.viewport.set([0,0,re.width,re.height])})(b,C,z,O):b.renderPass==="translucent"&&(function(re,de){const pe=re.context,fe=pe.gl;pe.setColorMode(re.colorModeForRenderPass());const _e=de.heatmapFbos.get(u.cd);_e&&(pe.activeTexture.set(fe.TEXTURE0),fe.bindTexture(fe.TEXTURE_2D,_e.colorAttachment.get()),pe.activeTexture.set(fe.TEXTURE1),Ii(pe,de).bind(fe.LINEAR,fe.CLAMP_TO_EDGE),re.useProgram("heatmapTexture").draw(pe,fe.TRIANGLES,pi.disabled,Di.disabled,re.colorModeForRenderPass(),bi.disabled,Cc(re,de,0,1),null,null,de.id,re.viewportBuffer,re.quadTriangleIndexBuffer,re.viewportSegments,de.paint,re.transform.zoom))})(b,z)})(t,a,c,f,v):u.cp(c)?(function(b,C,z,O,U){if(b.renderPass!=="translucent")return;const{isRenderingToTexture:H}=U,q=z.paint.get("line-opacity"),Q=z.paint.get("line-width");if(q.constantOr(1)===0||Q.constantOr(1)===0)return;const re=b.getDepthModeForSublayer(0,pi.ReadOnly),de=b.colorModeForRenderPass(),pe=z.paint.get("line-dasharray"),fe=pe.constantOr(1),_e=z.paint.get("line-pattern"),Me=_e.constantOr(1),me=z.paint.get("line-gradient"),Ce=z.getCrossfadeParameters();let Le;Le=Me?"linePattern":fe&&me?"lineGradientSDF":fe?"lineSDF":me?"lineGradient":"line";const we=b.context,Re=we.gl,Ye=b.transform;let qe=!0;for(const $e of O){const Xe=C.getTile($e);if(Me&&!Xe.patternsLoaded())continue;const Mt=Xe.getBucket(z);if(!Mt)continue;const At=Mt.programConfigurations.get(z.id),pt=b.context.program.get(),Lt=b.useProgram(Le,At),_i=qe||Lt.program!==pt,nn=b.style.map.terrain&&b.style.map.terrain.getTerrainData($e),bn=_e.constantOr(null),pn=pe&&pe.constantOr(null);if(bn&&Xe.imageAtlas){const Lr=Xe.imageAtlas,Wn=Lr.patternPositions[bn.to.toString()],Kn=Lr.patternPositions[bn.from.toString()];Wn&&Kn&&At.setConstantPatternPositions(Wn,Kn)}else if(pn){const Lr=z.layout.get("line-cap")==="round",Wn=b.lineAtlas.getDash(pn.to,Lr),Kn=b.lineAtlas.getDash(pn.from,Lr);At.setConstantDashPositions(Wn,Kn)}const Dn=Ye.getProjectionData({overscaledTileID:$e,applyGlobeMatrix:!H,applyTerrainMatrix:!0}),ln=Ye.getPixelScale();let qn;Me?(qn=is(b,Xe,z,ln,Ce),Aa(we,Re,Xe,At,Ce)):fe&&me?(qn=Xs(b,Xe,z,ln,Ce,Mt.lineClipsArray.length),Wr(b,C,we,Re,z,Mt,$e,At,Ce)):fe?(qn=Sr(b,Xe,z,ln,Ce),Sn(b,we,Re,At,_i,Ce)):me?(qn=lh(b,Xe,z,ln,Mt.lineClipsArray.length),ga(b,C,we,Re,z,Mt,$e)):qn=ws(b,Xe,z,ln);const In=b.stencilModeForClipping($e);Lt.draw(we,Re.TRIANGLES,re,In,de,bi.disabled,qn,nn,Dn,z.id,Mt.layoutVertexBuffer,Mt.indexBuffer,Mt.segments,z.paint,b.transform.zoom,At,Mt.layoutVertexBuffer2),qe=!1}})(t,a,c,f,v):u.cq(c)?(function(b,C,z,O,U){const H=z.paint.get("fill-color"),q=z.paint.get("fill-opacity");if(q.constantOr(1)===0)return;const{isRenderingToTexture:Q}=U,re=b.colorModeForRenderPass(),de=z.paint.get("fill-pattern"),pe=b.opaquePassEnabledForLayer()&&!de.constantOr(1)&&H.constantOr(u.bp.transparent).a===1&&q.constantOr(0)===1?"opaque":"translucent";if(b.renderPass===pe){const fe=b.getDepthModeForSublayer(1,b.renderPass==="opaque"?pi.ReadWrite:pi.ReadOnly);Pa(b,C,z,O,fe,re,!1,Q)}if(b.renderPass==="translucent"&&z.paint.get("fill-antialias")){const fe=b.getDepthModeForSublayer(z.getPaintProperty("fill-outline-color")?2:0,pi.ReadOnly);Pa(b,C,z,O,fe,re,!0,Q)}})(t,a,c,f,v):u.cr(c)?(function(b,C,z,O,U){const H=z.paint.get("fill-extrusion-opacity");if(H===0)return;const{isRenderingToTexture:q}=U;if(b.renderPass==="translucent"){const Q=new pi(b.context.gl.LEQUAL,pi.ReadWrite,b.depthRangeFor3D);if(H!==1||z.paint.get("fill-extrusion-pattern").constantOr(1))Ss(b,C,z,O,Q,Di.disabled,en.disabled,q),Ss(b,C,z,O,Q,b.stencilModeFor3D(),b.colorModeForRenderPass(),q);else{const re=b.colorModeForRenderPass();Ss(b,C,z,O,Q,Di.disabled,re,q)}}})(t,a,c,f,v):u.cs(c)?(function(b,C,z,O,U){if(b.renderPass!=="offscreen"&&b.renderPass!=="translucent")return;const{isRenderingToTexture:H}=U,q=b.context,Q=b.style.projection.useSubdivision,re=b.getDepthModeForSublayer(0,pi.ReadOnly),de=b.colorModeForRenderPass();if(b.renderPass==="offscreen")(function(pe,fe,_e,Me,me,Ce,Le){const we=pe.context,Re=we.gl;for(const Ye of _e){const qe=fe.getTile(Ye),$e=qe.dem;if(!$e||!$e.data||!qe.needsHillshadePrepare)continue;const Xe=$e.dim,Mt=$e.stride,At=$e.getPixels();if(we.activeTexture.set(Re.TEXTURE1),we.pixelStoreUnpackPremultiplyAlpha.set(!1),qe.demTexture=qe.demTexture||pe.getTileTexture(Mt),qe.demTexture){const Lt=qe.demTexture;Lt.update(At,{premultiply:!1}),Lt.bind(Re.NEAREST,Re.CLAMP_TO_EDGE)}else qe.demTexture=new u.T(we,At,Re.RGBA,{premultiply:!1}),qe.demTexture.bind(Re.NEAREST,Re.CLAMP_TO_EDGE);we.activeTexture.set(Re.TEXTURE0);let pt=qe.fbo;if(!pt){const Lt=new u.T(we,{width:Xe,height:Xe,data:null},Re.RGBA);Lt.bind(Re.LINEAR,Re.CLAMP_TO_EDGE),pt=qe.fbo=we.createFramebuffer(Xe,Xe,!0,!1),pt.colorAttachment.set(Lt.texture)}we.bindFramebuffer.set(pt.framebuffer),we.viewport.set([0,0,Xe,Xe]),pe.useProgram("hillshadePrepare").draw(we,Re.TRIANGLES,me,Ce,Le,bi.disabled,sh(qe.tileID,$e),null,null,Me.id,pe.rasterBoundsBuffer,pe.quadTriangleIndexBuffer,pe.rasterBoundsSegments),qe.needsHillshadePrepare=!1}})(b,C,O,z,re,Di.disabled,de),q.viewport.set([0,0,b.width,b.height]);else if(b.renderPass==="translucent")if(Q){const[pe,fe,_e]=b.stencilConfigForOverlapTwoPass(O);Cs(b,C,z,_e,pe,re,de,!1,H),Cs(b,C,z,_e,fe,re,de,!0,H)}else{const[pe,fe]=b.getStencilConfigForOverlapAndUpdateStencilID(O);Cs(b,C,z,fe,pe,re,de,!1,H)}})(t,a,c,f,v):u.ct(c)?(function(b,C,z,O,U){if(b.renderPass!=="translucent"||!O.length)return;const{isRenderingToTexture:H}=U,q=b.style.projection.useSubdivision,Q=b.getDepthModeForSublayer(0,pi.ReadOnly),re=b.colorModeForRenderPass();if(q){const[de,pe,fe]=b.stencilConfigForOverlapTwoPass(O);Qs(b,C,z,fe,de,Q,re,!1,H),Qs(b,C,z,fe,pe,Q,re,!0,H)}else{const[de,pe]=b.getStencilConfigForOverlapAndUpdateStencilID(O);Qs(b,C,z,pe,de,Q,re,!1,H)}})(t,a,c,f,v):u.bU(c)?(function(b,C,z,O,U){if(b.renderPass!=="translucent"||z.paint.get("raster-opacity")===0||!O.length)return;const{isRenderingToTexture:H}=U,q=C.getSource(),Q=b.style.projection.useSubdivision;if(q instanceof Sa)za(b,C,z,O,null,!1,!1,q.tileCoords,q.flippedWindingOrder,H);else if(Q){const[re,de,pe]=b.stencilConfigForOverlapTwoPass(O);za(b,C,z,pe,re,!1,!0,rs,!1,H),za(b,C,z,pe,de,!0,!0,rs,!1,H)}else{const[re,de]=b.getStencilConfigForOverlapAndUpdateStencilID(O);za(b,C,z,de,re,!1,!0,rs,!1,H)}})(t,a,c,f,v):u.cu(c)?(function(b,C,z,O,U){const H=z.paint.get("background-color"),q=z.paint.get("background-opacity");if(q===0)return;const{isRenderingToTexture:Q}=U,re=b.context,de=re.gl,pe=b.style.projection,fe=b.transform,_e=fe.tileSize,Me=z.paint.get("background-pattern");if(b.isPatternMissing(Me))return;const me=!Me&&H.a===1&&q===1&&b.opaquePassEnabledForLayer()?"opaque":"translucent";if(b.renderPass!==me)return;const Ce=Di.disabled,Le=b.getDepthModeForSublayer(0,me==="opaque"?pi.ReadWrite:pi.ReadOnly),we=b.colorModeForRenderPass(),Re=b.useProgram(Me?"backgroundPattern":"background"),Ye=O||dn(fe,{tileSize:_e,terrain:b.style.map.terrain});Me&&(re.activeTexture.set(de.TEXTURE0),b.imageManager.bind(b.context));const qe=z.getCrossfadeParameters();for(const $e of Ye){const Xe=fe.getProjectionData({overscaledTileID:$e,applyGlobeMatrix:!Q,applyTerrainMatrix:!0}),Mt=Me?ou(q,b,Me,{tileID:$e,tileSize:_e},qe):Bl(q,H),At=b.style.map.terrain&&b.style.map.terrain.getTerrainData($e),pt=pe.getMeshFromTileID(re,$e.canonical,!1,!0,"raster");Re.draw(re,de.TRIANGLES,Le,Ce,we,bi.backCCW,Mt,At,Xe,z.id,pt.vertexBuffer,pt.indexBuffer,pt.segments)}})(t,0,c,f,v):u.cv(c)&&(function(b,C,z,O){const{isRenderingGlobe:U}=O,H=b.context,q=z.implementation,Q=b.style.projection,re=b.transform,de=re.getProjectionDataForCustomLayer(U),pe={farZ:re.farZ,nearZ:re.nearZ,fov:re.fov*Math.PI/180,modelViewProjectionMatrix:re.modelViewProjectionMatrix,projectionMatrix:re.projectionMatrix,shaderData:{variantName:Q.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
828uniform mat4 u_projection_matrix;
829${Q.shaderPreludeCode.vertexSource}`,define:Q.shaderDefine},defaultProjectionData:de},fe=q.renderingMode?q.renderingMode:"2d";if(b.renderPass==="offscreen"){const _e=q.prerender;_e&&(b.setCustomLayerDefaults(),H.setColorMode(b.colorModeForRenderPass()),_e.call(q,H.gl,pe),H.setDirty(),b.setBaseState())}else if(b.renderPass==="translucent"){b.setCustomLayerDefaults(),H.setColorMode(b.colorModeForRenderPass()),H.setStencilMode(Di.disabled);const _e=fe==="3d"?b.getDepthModeFor3D():b.getDepthModeForSublayer(0,pi.ReadOnly);H.setDepthMode(_e),q.render(H.gl,pe),H.setDirty(),b.setBaseState(),H.bindFramebuffer.set(null)}})(t,0,c,v))}saveTileTexture(t){const a=this._tileTextures[t.size[0]];a?a.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const a=this._tileTextures[t];return a&&a.length>0?a.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const a=this.imageManager.getPattern(t.from.toString()),c=this.imageManager.getPattern(t.to.toString());return!a||!c}useProgram(t,a,c=!1,f=[]){this.cache=this.cache||{};const v=!!this.style.map.terrain,b=this.style.projection,C=c?Ni.projectionMercator:b.shaderPreludeCode,z=c?wn:b.shaderDefine,O=t+(a?a.cacheKey:"")+`/${c?br:b.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(v?"/terrain":"")+(f?`/${f.join("/")}`:"");return this.cache[O]||(this.cache[O]=new il(this.context,Ni[t],a,uh[t],this._showOverdrawInspector,v,C,z,f)),this.cache[O]}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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,a;if(this._tileTextures){for(const c in this._tileTextures){const f=this._tileTextures[c];if(f)for(const v of f)v.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((t=this.tileExtentMesh.vertexBuffer)===null||t===void 0||t.destroy()),this.tileExtentMesh&&((a=this.tileExtentMesh.indexBuffer)===null||a===void 0||a.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(const c in this.cache){const f=this.cache[c];f&&f.program&&this.context.gl.deleteProgram(f.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:a}=this.context.gl;return this.width!==t||this.height!==a}}function Yh(g,t){let a,c=!1,f=null,v=null;const b=()=>{f=null,c&&(g.apply(v,a),f=setTimeout(b,t),c=!1)};return(...C)=>(c=!0,v=this,a=C,f||b(),f)}class nr{constructor(t){this._getCurrentHash=()=>{const a=window.location.hash.replace("#","");if(this._hashName){let c;return a.split("&").map((f=>f.split("="))).forEach((f=>{f[0]===this._hashName&&(c=f)})),(c&&c[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{const a=this._getCurrentHash();if(!this._isValidHash(a))return!1;const c=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:c,pitch:+(a[4]||0)}),!0},this._updateHashUnthrottled=()=>{const a=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{const a=this._getCurrentHash();if(a.length===0)return;const c=a.join("/");let f=c;f.split("&").length>0&&(f=f.split("&")[0]),this._hashName&&(f=`${this._hashName}=${c}`);let v=window.location.hash.replace(f,"");v.startsWith("#&")?v=v.slice(0,1)+v.slice(2):v==="#"&&(v="");let b=window.location.href.replace(/(#.+)?$/,v);b=b.replace("&&","&"),window.history.replaceState(window.history.state,null,b)},this._updateHash=Yh(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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(t){const a=this._map.getCenter(),c=Math.round(100*this._map.getZoom())/100,f=Math.ceil((c*Math.LN2+Math.log(512/360/.5))/Math.LN10),v=Math.pow(10,f),b=Math.round(a.lng*v)/v,C=Math.round(a.lat*v)/v,z=this._map.getBearing(),O=this._map.getPitch();let U="";if(U+=t?`/${b}/${C}/${c}`:`${c}/${C}/${b}`,(z||O)&&(U+="/"+Math.round(10*z)/10),O&&(U+=`/${Math.round(O)}`),this._hashName){const H=this._hashName;let q=!1;const Q=window.location.hash.slice(1).split("&").map((re=>{const de=re.split("=")[0];return de===H?(q=!0,`${de}=${U}`):re})).filter((re=>re));return q||Q.push(`${H}=${U}`),`#${Q.join("&")}`}return`#${U}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new u.V(+t[2],+t[1])}catch{return!1}const a=+t[0],c=+(t[3]||0),f=+(t[4]||0);return a>=this._map.getMinZoom()&&a<=this._map.getMaxZoom()&&c>=-180&&c<=180&&f>=this._map.getMinPitch()&&f<=this._map.getMaxPitch()}}const ko={linearity:.3,easing:u.cw(0,0,.3,1)},Ku=u.e({deceleration:2500,maxSpeed:1400},ko),_a=u.e({deceleration:20,maxSpeed:1400},ko),ss=u.e({deceleration:1e3,maxSpeed:360},ko),du=u.e({deceleration:1e3,maxSpeed:90},ko),ya=u.e({deceleration:1e3,maxSpeed:360},ko);class ep{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Te(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,a=Te();for(;t.length>0&&a-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const a={zoom:0,bearing:0,pitch:0,roll:0,pan:new u.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:v}of this._inertiaBuffer)a.zoom+=v.zoomDelta||0,a.bearing+=v.bearingDelta||0,a.pitch+=v.pitchDelta||0,a.roll+=v.rollDelta||0,v.panDelta&&a.pan._add(v.panDelta),v.around&&(a.around=v.around),v.pinchAround&&(a.pinchAround=v.pinchAround);const c=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,f={};if(a.pan.mag()){const v=Pc(a.pan.mag(),c,u.e({},Ku,t||{})),b=a.pan.mult(v.amount/a.pan.mag()),C=this._map.cameraHelper.handlePanInertia(b,this._map.transform);f.center=C.easingCenter,f.offset=C.easingOffset,Qu(f,v)}if(a.zoom){const v=Pc(a.zoom,c,_a),b=u.cx(this._map.transform.zoom+v.amount,this._map.getZoomSnap(),v.amount);f.zoom=b,Qu(f,v)}if(a.bearing){const v=Pc(a.bearing,c,ss);f.bearing=this._map.transform.bearing+u.an(v.amount,-179,179),Qu(f,v)}if(a.pitch){const v=Pc(a.pitch,c,du);f.pitch=this._map.transform.pitch+v.amount,Qu(f,v)}if(a.roll){const v=Pc(a.roll,c,ya);f.roll=this._map.transform.roll+u.an(v.amount,-179,179),Qu(f,v)}if(f.zoom||f.bearing){const v=a.pinchAround===void 0?a.around:a.pinchAround;f.around=v?this._map.unproject(v):this._map.getCenter()}return this.clear(),u.e(f,{noMoveStart:!0})}}function Qu(g,t){(!g.duration||g.duration<t.duration)&&(g.duration=t.duration,g.easing=t.easing)}function Pc(g,t,a){const{maxSpeed:c,linearity:f,deceleration:v}=a,b=u.an(g*f/(t/1e3),-c,c),C=Math.abs(b)/(v*f);return{easing:a.easing,duration:1e3*C,amount:b*(C/2)}}class Er extends u.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,c,f={}){c=c instanceof MouseEvent?c:new MouseEvent(t,c);const v=ve.mousePos(a.getCanvas(),c),b=a.unproject(v);super(t,u.e({point:v,lngLat:b,originalEvent:c},f)),this._defaultPrevented=!1,this.target=a}}class Js extends u.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,c){const f=t==="touchend"?c.changedTouches:c.touches,v=ve.touchPos(a.getCanvasContainer(),f),b=v.map((z=>a.unproject(z))),C=v.reduce(((z,O,U,H)=>z.add(O.div(H.length))),new u.P(0,0));super(t,{points:v,point:C,lngLats:b,lngLat:a.unproject(C),originalEvent:c}),this._defaultPrevented=!1}}class fh extends u.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,a,c){super(t,{originalEvent:c}),this._defaultPrevented=!1}}class ph{constructor(t,a){this._map=t,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new fh(t.type,this._map,t))}mousedown(t,a){return this._mousedownPos=a,this._firePreventable(new Er(t.type,this._map,t))}mouseup(t){this._map.fire(new Er(t.type,this._map,t))}click(t,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new Er(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Er(t.type,this._map,t))}mouseover(t){this._map.fire(new Er(t.type,this._map,t))}mouseout(t){this._map.fire(new Er(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Js(t.type,this._map,t))}touchmove(t){this._map.fire(new Js(t.type,this._map,t))}touchend(t){this._map.fire(new Js(t.type,this._map,t))}touchcancel(t){this._map.fire(new Js(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qd{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Er(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Er("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Er(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class eo{constructor(t){this._map=t}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(t){return this.transform.screenPointToLocation(u.P.convert(t),this._map.terrain)}}class jl{constructor(t,a){this._map=t,this._tr=new eo(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=a.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,a){this.isEnabled()&&t.shiftKey&&t.button===0&&(ve.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(t,a){if(!this._active)return;const c=a;if(this._lastPos.equals(c)||!this._box&&c.dist(this._startPos)<this._clickTolerance)return;const f=this._startPos;this._lastPos=c,this._box||(this._box=ve.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const v=Math.min(f.x,c.x),b=Math.max(f.x,c.x),C=Math.min(f.y,c.y),z=Math.max(f.y,c.y);ve.setTransform(this._box,`translate(${v}px,${C}px)`),this._box.style.width=b-v+"px",this._box.style.height=z-C+"px"}mouseupWindow(t,a){if(!this._active||t.button!==0)return;const c=this._startPos,f=a;if(this.reset(),ve.suppressClick(),c.x!==f.x||c.y!==f.y)return this._map.fire(new u.l("boxzoomend",{originalEvent:t})),{cameraAnimation:v=>v.fitScreenCoordinates(c,f,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(ve.remove(this._box),this._box=null),ve.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,a){return this._map.fire(new u.l(t,{originalEvent:a}))}}function Oa(g,t){if(g.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${t.length}`);const a={};for(let c=0;c<g.length;c++)a[g[c].identifier]=t[c];return a}class Nt{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,a,c){(this.centroid||c.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),c.length===this.numTouches&&(this.centroid=(function(f){const v=new u.P(0,0);for(const b of f)v._add(b);return v.div(f.length)})(a),this.touches=Oa(c,a)))}touchmove(t,a,c){if(this.aborted||!this.centroid)return;const f=Oa(c,a);for(const v in this.touches){const b=f[v];(!b||b.dist(this.touches[v])>30)&&(this.aborted=!0)}}touchend(t,a,c){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),c.length===0){const f=!this.aborted&&this.centroid;if(this.reset(),f)return f}}}class zc{constructor(t){this.singleTap=new Nt(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,a,c){this.singleTap.touchstart(t,a,c)}touchmove(t,a,c){this.singleTap.touchmove(t,a,c)}touchend(t,a,c){const f=this.singleTap.touchend(t,a,c);if(f){const v=t.timeStamp-this.lastTime<500,b=!this.lastTap||this.lastTap.dist(f)<30;if(v&&b||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=f,this.count===this.numTaps)return this.reset(),f}}}class mh{constructor(t){this._tr=new eo(t),this._zoomIn=new zc({numTouches:1,numTaps:2}),this._zoomOut=new zc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,a,c){this._zoomIn.touchstart(t,a,c),this._zoomOut.touchstart(t,a,c)}touchmove(t,a,c){this._zoomIn.touchmove(t,a,c),this._zoomOut.touchmove(t,a,c)}touchend(t,a,c){const f=this._zoomIn.touchend(t,a,c),v=this._zoomOut.touchend(t,a,c),b=this._tr;return f?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:C=>C.easeTo({duration:300,zoom:u.cx(b.zoom+1,C.getZoomSnap()),around:b.unproject(f)},{originalEvent:t})}):v?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:C=>C.easeTo({duration:300,zoom:u.cx(b.zoom-1,C.getZoomSnap()),around:b.unproject(v)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Es{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const a=this._moveFunction(...t);if(a.bearingDelta||a.pitchDelta||a.rollDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(t,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(a)?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,a){if(!this.isEnabled())return;const c=this._lastPoint;if(!c)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const f=Array.isArray(a)?a[0]:a;return!this._moved&&f.dist(c)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=f,this._move(c,f))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&ve.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const to=0,Ju=2,gh={[to]:1,[Ju]:2};class Ro{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const a=ve.mouseButton(t);this._eventButton=a}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!(function(a,c){const f=gh[c];return a.buttons===void 0||(a.buttons&f)!==f})(t,this._eventButton)}isValidEndEvent(t){return ve.mouseButton(t)===this._eventButton}}class fu{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class Lc{constructor(t=new Ro({checkCorrectEvent:()=>!0}),a=new fu){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=a}_executeRelevantHandler(t,a,c){return t instanceof MouseEvent?a(t):typeof TouchEvent<"u"&&t instanceof TouchEvent?c(t):void 0}startMove(t){this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.startMove(a)),(a=>this.oneFingerTouchMoveStateManager.startMove(a)))}endMove(t){this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.endMove(a)),(a=>this.oneFingerTouchMoveStateManager.endMove(a)))}isValidStartEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidStartEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidStartEvent(a)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidMoveEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(a)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(a=>this.mouseMoveStateManager.isValidEndEvent(a)),(a=>this.oneFingerTouchMoveStateManager.isValidEndEvent(a)))}}const Oo=g=>{g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=t=>{t.preventDefault()}};class _h{constructor(t,a){this._clickTolerance=t.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,a,c){return this._calculateTransform(t,a,c)}touchmove(t,a,c){if(this._active){if(!this._shouldBePrevented(c.length))return t.preventDefault(),this._calculateTransform(t,a,c);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,a,c){this._calculateTransform(t,a,c),this._active&&this._shouldBePrevented(c.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,a,c){c.length>0&&(this._active=!0);const f=Oa(c,a),v=new u.P(0,0),b=new u.P(0,0);let C=0;for(const O in f){const U=f[O],H=this._touches[O];H&&(v._add(U),b._add(U.sub(H)),C++,f[O]=U)}if(this._touches=f,this._shouldBePrevented(C)||!b.mag())return;const z=b.div(C);return this._sum._add(z),this._sum.mag()<this._clickTolerance?void 0:{around:v.div(C),panDelta:z}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dc{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,a,c){this._firstTwoTouches||c.length<2||(this._firstTwoTouches=[c[0].identifier,c[1].identifier],this._start([a[0],a[1]]))}touchmove(t,a,c){if(!this._firstTwoTouches)return;t.preventDefault();const[f,v]=this._firstTwoTouches,b=Bo(c,a,f),C=Bo(c,a,v);if(!b||!C)return;const z=this._aroundCenter?null:b.add(C).div(2);return this._move([b,C],z,t)}touchend(t,a,c){if(!this._firstTwoTouches)return;const[f,v]=this._firstTwoTouches,b=Bo(c,a,f),C=Bo(c,a,v);b&&C||(this._active&&ve.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Bo(g,t,a){for(let c=0;c<g.length;c++)if(g[c].identifier===a)return t[c]}function Wh(g,t){return Math.log(g/t)/Math.LN2}class No extends Dc{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,a){const c=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Wh(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Wh(this._distance,c),pinchAround:a}}}function yh(g,t){return 180*g.angleWith(t)/Math.PI}class Ic extends Dc{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,a,c){const f=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:yh(this._vector,f),pinchAround:a}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const a=25/(Math.PI*this._minDiameter)*360,c=yh(t,this._startVector);return Math.abs(c)<a}}function Fo(g){return Math.abs(g.y)>Math.abs(g.x)}class pl extends Dc{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,a,c){super.touchstart(t,a,c),this._currentTouchCount=c.length}_start(t){this._lastPoints=t,Fo(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,a,c){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const f=t[0].sub(this._lastPoints[0]),v=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(f,v,c.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(f.y+v.y)/2*-.5}):void 0}gestureBeginsVertically(t,a,c){if(this._valid!==void 0)return this._valid;const f=t.mag()>=2,v=a.mag()>=2;if(!f&&!v)return;if(!f||!v)return this._firstMove===void 0&&(this._firstMove=c),c-this._firstMove<100&&void 0;const b=t.y>0==a.y>0;return Fo(t)&&Fo(a)&&b}}const As={panStep:100,bearingStep:15,pitchStep:10};class an{constructor(t){this._tr=new eo(t);const a=As;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let a=0,c=0,f=0,v=0,b=0;switch(t.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:t.shiftKey?c=-1:(t.preventDefault(),v=-1);break;case 39:t.shiftKey?c=1:(t.preventDefault(),v=1);break;case 38:t.shiftKey?f=1:(t.preventDefault(),b=-1);break;case 40:t.shiftKey?f=-1:(t.preventDefault(),b=1);break;default:return}return this._rotationDisabled&&(c=0,f=0),{cameraAnimation:C=>{const z=this._tr;C.easeTo({duration:300,easeId:"keyboardHandler",easing:Kh,zoom:a?u.cx(z.zoom+a*(t.shiftKey?2:1),C.getZoomSnap()):z.zoom,bearing:z.bearing+c*this._bearingStep,pitch:z.pitch+f*this._pitchStep,offset:[-v*this._panStep,-b*this._panStep],center:z.center},{originalEvent:t})}}}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 Kh(g){return g*(2-g)}const ml=4.000244140625,Ul=1/450;class kc{constructor(t,a){this._onTimeout=c=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(c)},this._map=t,this._tr=new eo(t),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Ul}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let a=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const c=Te(),f=c-(this._lastWheelEventTime||0);this._lastWheelEventTime=c,a!==0&&a%ml==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":f>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(f*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),t.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=t,this._delta-=a,this._active||this._start(t)),t.preventDefault()}_start(t){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 a=ve.mousePos(this._map.getCanvas(),t),c=this._tr;this._aroundPoint=this._aroundCenter?c.transform.locationToScreenPoint(u.V.convert(c.center)):a,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const C=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=C),typeof this._targetZoom=="number"&&(this._targetZoom+=C)}if(this._delta!==0){const C=this._type==="wheel"&&Math.abs(this._delta)>ml?this._wheelZoomRate:this._defaultZoomRate;let z=2/(1+Math.exp(-Math.abs(this._delta*C)));this._delta<0&&z!==0&&(z=1/z);const O=typeof this._targetZoom!="number"?t.scale:u.aq(this._targetZoom),U=t.applyConstrain(t.getCameraLngLat(),u.at(O*z)).zoom,H=this._map.getZoomSnap();if(this._type==="wheel"&&H>0){const q=u.cx(t.zoom,H);this._targetZoom=u.cx(U,H,U-q)}else this._targetZoom=U;this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const a=typeof this._targetZoom!="number"?t.zoom:this._targetZoom,c=this._startZoom,f=this._easing;let v,b=!1;if(this._type==="wheel"&&c&&f){const C=Te()-this._lastWheelEventTime,z=Math.min((C+5)/200,1),O=f(z);v=u.G.number(c,a,O),z<1?this._frameId||(this._frameId=!0):b=!0}else v=a,b=!0;return this._active=!0,b&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=v,{noInertia:!0,needsRenderFrame:!b,zoomDelta:v-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let a=u.cz;if(this._prevEase){const c=this._prevEase,f=(Te()-c.start)/c.duration,v=c.easing(f+.01)-c.easing(f),b=.27/Math.sqrt(v*v+1e-4)*.01,C=Math.sqrt(.0729-b*b);a=u.cw(b,C,.25,1)}return this._prevEase={start:Te(),duration:t,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class vh{constructor(t,a){this._clickZoom=t,this._tapZoom=a}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 pu{constructor(t){this._tr=new eo(t),this.reset()}reset(){this._active=!1}dblclick(t,a){return t.preventDefault(),{cameraAnimation:c=>{c.easeTo({duration:300,zoom:u.cx(this._tr.zoom+(t.shiftKey?-1:1),c.getZoomSnap()),around:this._tr.unproject(a)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Rc{constructor(){this._tap=new zc({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(t,a,c){if(!this._swipePoint)if(this._tapTime){const f=a[0],v=t.timeStamp-this._tapTime<500,b=this._tapPoint.dist(f)<30;v&&b?c.length>0&&(this._swipePoint=f,this._swipeTouch=c[0].identifier):this.reset()}else this._tap.touchstart(t,a,c)}touchmove(t,a,c){if(this._tapTime){if(this._swipePoint){if(c[0].identifier!==this._swipeTouch)return;const f=a[0],v=f.y-this._swipePoint.y;return this._swipePoint=f,t.preventDefault(),this._active=!0,{zoomDelta:v/128}}}else this._tap.touchmove(t,a,c)}touchend(t,a,c){if(this._tapTime)this._swipePoint&&c.length===0&&this.reset();else{const f=this._tap.touchend(t,a,c);f&&(this._tapTime=t.timeStamp,this._tapPoint=f)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qh{constructor(t,a,c){this._el=t,this._mousePan=a,this._touchPan=c}enable(t){this._inertiaOptions=t||{},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 os{constructor(t,a,c,f){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=a,this._mousePitch=c,this._mouseRoll=f}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 mu{constructor(t,a,c,f){this._el=t,this._touchZoom=a,this._touchRotate=c,this._tapDragZoom=f,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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 Ut{constructor(t,a){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=t,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=ve.create("div","maplibregl-cooperative-gesture-screen",t);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const c=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),f=document.createElement("div");f.className="maplibregl-desktop-message",f.textContent=a,this._container.appendChild(f);const v=document.createElement("div");v.className="maplibregl-mobile-message",v.textContent=c,this._container.appendChild(v),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(ve.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(t){return t[this._bypassKey]}notifyGestureBlocked(t,a){this._enabled&&(this._map.fire(new u.l("cooperativegestureprevented",{gestureType:t,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const $t=g=>g.zoom||g.drag||g.roll||g.pitch||g.rotate;class Ps extends u.l{}function ec(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta||g.rollDelta}class Oc{get _ownerDocument(){var t;return((t=this._el)===null||t===void 0?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,a;return((a=(t=this._el)===null||t===void 0?void 0:t.ownerDocument)===null||a===void 0?void 0:a.defaultView)||window}constructor(t,a){this.handleWindowEvent=f=>{this.handleEvent(f,`${f.type}Window`)},this.handleEvent=(f,v)=>{if(f.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const b=f.type==="renderFrame"?void 0:f,C={needsRenderFrame:!1},z={},O={};for(const{handlerName:q,handler:Q,allowed:re}of this._handlers){if(!Q.isEnabled())continue;let de;if(this._blockedByActive(O,re,q))Q.reset();else if(Q[v||f.type]){if(u.cA(f,v||f.type)){const pe=ve.mousePos(this._map.getCanvas(),f);de=Q[v||f.type](f,pe)}else if(u.cB(f,v||f.type)){const pe=this._getMapTouches(f.touches),fe=ve.touchPos(this._map.getCanvas(),pe);de=Q[v||f.type](f,fe,pe)}else u.cC(v||f.type)||(de=Q[v||f.type](f));this.mergeHandlerResult(C,z,de,q,b),de&&de.needsRenderFrame&&this._triggerRenderFrame()}(de||Q.isActive())&&(O[q]=Q)}const U={};for(const q in this._previousActiveHandlers)O[q]||(U[q]=b);this._previousActiveHandlers=O,(Object.keys(U).length||ec(C))&&(this._changes.push([C,z,U]),this._triggerRenderFrame()),(Object.keys(O).length||ec(C))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:H}=C;H&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],H(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ep(t),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);const c=this._el;this._listeners=[[c,"touchstart",{passive:!0}],[c,"touchmove",{passive:!1}],[c,"touchend",void 0],[c,"touchcancel",void 0],[c,"mousedown",void 0],[c,"mousemove",void 0],[c,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[c,"mouseover",void 0],[c,"mouseout",void 0],[c,"dblclick",void 0],[c,"click",void 0],[c,"keydown",{capture:!1}],[c,"keyup",void 0],[c,"wheel",{passive:!1}],[c,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(const[f,v,b]of this._listeners)ve.addEventListener(f,v,f===this._ownerDocument?this.handleWindowEvent:this.handleEvent,b)}destroy(){for(const[t,a,c]of this._listeners)ve.removeEventListener(t,a,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,c)}_addDefaultHandlers(t){const a=this._map,c=a.getCanvasContainer();this._add("mapEvent",new ph(a,t));const f=a.boxZoom=new jl(a,t);this._add("boxZoom",f),t.interactive&&t.boxZoom&&f.enable();const v=a.cooperativeGestures=new Ut(a,t.cooperativeGestures);this._add("cooperativeGestures",v),t.cooperativeGestures&&v.enable();const b=new mh(a),C=new pu(a);a.doubleClickZoom=new vh(C,b),this._add("tapZoom",b),this._add("clickZoom",C),t.interactive&&t.doubleClickZoom&&a.doubleClickZoom.enable();const z=new Rc;this._add("tapDragZoom",z);const O=a.touchPitch=new pl(a);this._add("touchPitch",O),t.interactive&&t.touchPitch&&a.touchPitch.enable(t.touchPitch);const U=()=>a.project(a.getCenter()),H=(function({enable:me,clickTolerance:Ce,aroundCenter:Le=!0,minPixelCenterThreshold:we=100,rotateDegreesPerPixelMoved:Re=.8},Ye){const qe=new Ro({checkCorrectEvent:$e=>ve.mouseButton($e)===0&&$e.ctrlKey||ve.mouseButton($e)===2&&!$e.ctrlKey});return new Es({clickTolerance:Ce,move:($e,Xe)=>{const Mt=Ye();if(Le&&Math.abs(Mt.y-$e.y)>we)return{bearingDelta:u.cy(new u.P($e.x,Xe.y),Xe,Mt)};let At=(Xe.x-$e.x)*Re;return Le&&Xe.y<Mt.y&&(At=-At),{bearingDelta:At}},moveStateManager:qe,enable:me,assignEvents:Oo})})(t,U),q=(function({enable:me,clickTolerance:Ce,pitchDegreesPerPixelMoved:Le=-.5}){const we=new Ro({checkCorrectEvent:Re=>ve.mouseButton(Re)===0&&Re.ctrlKey||ve.mouseButton(Re)===2});return new Es({clickTolerance:Ce,move:(Re,Ye)=>({pitchDelta:(Ye.y-Re.y)*Le}),moveStateManager:we,enable:me,assignEvents:Oo})})(t),Q=(function({enable:me,clickTolerance:Ce,rollDegreesPerPixelMoved:Le=.3},we){const Re=new Ro({checkCorrectEvent:Ye=>ve.mouseButton(Ye)===2&&Ye.ctrlKey});return new Es({clickTolerance:Ce,move:(Ye,qe)=>{const $e=we();let Xe=(qe.x-Ye.x)*Le;return qe.y<$e.y&&(Xe=-Xe),{rollDelta:Xe}},moveStateManager:Re,enable:me,assignEvents:Oo})})(t,U);a.dragRotate=new os(t,H,q,Q),this._add("mouseRotate",H,["mousePitch"]),this._add("mousePitch",q,["mouseRotate","mouseRoll"]),this._add("mouseRoll",Q,["mousePitch"]),t.interactive&&t.dragRotate&&a.dragRotate.enable();const re=(function({enable:me,clickTolerance:Ce}){const Le=new Ro({checkCorrectEvent:we=>ve.mouseButton(we)===0&&!we.ctrlKey});return new Es({clickTolerance:Ce,move:(we,Re)=>({around:Re,panDelta:Re.sub(we)}),activateOnStart:!0,moveStateManager:Le,enable:me,assignEvents:Oo})})(t),de=new _h(t,a);a.dragPan=new Qh(c,re,de),this._add("mousePan",re),this._add("touchPan",de,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&a.dragPan.enable(t.dragPan);const pe=new Ic,fe=new No;a.touchZoomRotate=new mu(c,fe,pe,z),this._add("touchRotate",pe,["touchPan","touchZoom"]),this._add("touchZoom",fe,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&a.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new qd(a));const _e=a.scrollZoom=new kc(a,(()=>this._triggerRenderFrame()));this._add("scrollZoom",_e,["mousePan"]),t.interactive&&t.scrollZoom&&a.scrollZoom.enable(t.scrollZoom);const Me=a.keyboard=new an(a);this._add("keyboard",Me),t.interactive&&t.keyboard&&a.keyboard.enable()}_add(t,a,c){this._handlers.push({handlerName:t,handler:a,allowed:c}),this._handlersById[t]=a}stop(t){if(!this._updatingCamera){for(const{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$t(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,a,c){for(const f in t)if(f!==c&&(!a||a.indexOf(f)<0))return!0;return!1}_getMapTouches(t){const a=[];for(const c of t)this._el.contains(c.target)&&a.push(c);return a}mergeHandlerResult(t,a,c,f,v){if(!c)return;u.e(t,c);const b={handlerName:f,originalEvent:c.originalEvent||v};c.zoomDelta!==void 0&&(a.zoom=b),c.panDelta!==void 0&&(a.drag=b),c.rollDelta!==void 0&&(a.roll=b),c.pitchDelta!==void 0&&(a.pitch=b),c.bearingDelta!==void 0&&(a.rotate=b)}_applyChanges(){const t={},a={},c={};for(const[f,v,b]of this._changes)f.panDelta&&(t.panDelta=(t.panDelta||new u.P(0,0))._add(f.panDelta)),f.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+f.zoomDelta),f.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+f.bearingDelta),f.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+f.pitchDelta),f.rollDelta&&(t.rollDelta=(t.rollDelta||0)+f.rollDelta),f.around!==void 0&&(t.around=f.around),f.pinchAround!==void 0&&(t.pinchAround=f.pinchAround),f.noInertia&&(t.noInertia=f.noInertia),u.e(a,v),u.e(c,b);this._updateMapTransform(t,a,c),this._changes=[]}_updateMapTransform(t,a,c){const f=this._map,v=f._getTransformForUpdate(),b=f.terrain;if(!(ec(t)||b&&this._terrainMovement))return this._fireEvents(a,c,!0);f._stop(!0);let{panDelta:C,zoomDelta:z,bearingDelta:O,pitchDelta:U,rollDelta:H,around:q,pinchAround:Q}=t;Q!==void 0&&(q=Q),q=q||f.transform.centerPoint,b&&!v.isPointOnMapSurface(q)&&(q=v.centerPoint);const re={panDelta:C,zoomDelta:z,rollDelta:H,pitchDelta:U,bearingDelta:O,around:q};this._map.cameraHelper.useGlobeControls&&!v.isPointOnMapSurface(q)&&(q=v.centerPoint);const de=q.distSqr(v.centerPoint)<.01?v.center:v.screenPointToLocation(C?q.sub(C):q);this._handleMapControls({terrain:b,tr:v,deltasForHelper:re,preZoomAroundLoc:de,combinedEventsInProgress:a,panDelta:C}),f._applyUpdatedTransform(v),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(a,c,!0)}_handleMapControls({terrain:t,tr:a,deltasForHelper:c,preZoomAroundLoc:f,combinedEventsInProgress:v,panDelta:b}){const C=this._map.cameraHelper;if(C.handleMapControlsRollPitchBearingZoom(c,a),t)return C.useGlobeControls?(this._terrainMovement||!v.drag&&!v.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void C.handleMapControlsPan(c,a,f)):this._terrainMovement||!v.drag&&!v.zoom?void(v.drag&&this._terrainMovement&&b?a.setCenter(a.screenPointToLocation(a.centerPoint.sub(b))):C.handleMapControlsPan(c,a,f)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void C.handleMapControlsPan(c,a,f));C.handleMapControlsPan(c,a,f)}_fireEvents(t,a,c){const f=$t(this._eventsInProgress),v=$t(t),b={};for(const H in t){const{originalEvent:q}=t[H];this._eventsInProgress[H]||(b[`${H}start`]=q),this._eventsInProgress[H]=t[H]}!f&&v&&this._fireEvent("movestart",v.originalEvent);for(const H in b)this._fireEvent(H,b[H]);v&&this._fireEvent("move",v.originalEvent);for(const H in t){const{originalEvent:q}=t[H];this._fireEvent(H,q)}const C={};let z;for(const H in this._eventsInProgress){const{handlerName:q,originalEvent:Q}=this._eventsInProgress[H];this._handlersById[q].isActive()||(delete this._eventsInProgress[H],z=a[q]||Q,C[`${H}end`]=z)}for(const H in C)this._fireEvent(H,C[H]);const O=$t(this._eventsInProgress),U=(f||v)&&!O;if(U&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const H=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&H.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(H)}if(c&&U){this._updatingCamera=!0;const H=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),q=Q=>Q!==0&&-this._bearingSnap<Q&&Q<this._bearingSnap;!H||!H.essential&&Se.prefersReducedMotion?(this._map.fire(new u.l("moveend",{originalEvent:z})),q(this._map.getBearing())&&this._map.resetNorth()):(q(H.bearing||this._map.getBearing())&&(H.bearing=0),H.freezeElevation=!0,this._map.easeTo(H,{originalEvent:z})),this._updatingCamera=!1}}_fireEvent(t,a){this._map.fire(new u.l(t,a?{originalEvent:a}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new Ps("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class rr extends u.E{constructor(t,a,c){super(),this._renderFrameCallback=()=>{const f=Math.min((Te()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(f)),f<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=c.bearingSnap,this._zoomSnap=c.zoomSnap,this.cameraHelper=a,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,a){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=a}getCenter(){return new u.V(this.transform.center.lng,this.transform.center.lat)}setCenter(t,a){return this.jumpTo({center:t},a)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,a){return this.jumpTo({elevation:t},a),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,a,c){return t=u.P.convert(t).mult(-1),this.panTo(this.transform.center,u.e({offset:t},a),c)}panTo(t,a,c){return this.easeTo(u.e({center:t},a),c)}getZoom(){return this.transform.zoom}setZoom(t,a){return this.jumpTo({zoom:t},a),this}zoomTo(t,a,c){return this.easeTo(u.e({zoom:t},a),c)}zoomIn(t,a){return this.zoomTo(u.cx(this.getZoom()+1,this._zoomSnap),t,a),this}zoomOut(t,a){return this.zoomTo(u.cx(this.getZoom()-1,this._zoomSnap),t,a),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,a){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new u.l("movestart",a)).fire(new u.l("move",a)).fire(new u.l("moveend",a))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,a){return this.jumpTo({bearing:t},a),this}getPadding(){return this.transform.padding}setPadding(t,a){return this.jumpTo({padding:t},a),this}rotateTo(t,a,c){return this.easeTo(u.e({bearing:t},a),c)}resetNorth(t,a){return this.rotateTo(0,u.e({duration:1e3},t),a),this}resetNorthPitch(t,a){return this.easeTo(u.e({bearing:0,pitch:0,roll:0,duration:1e3},t),a),this}snapToNorth(t,a){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,a):this}getPitch(){return this.transform.pitch}setPitch(t,a){return this.jumpTo({pitch:t},a),this}getRoll(){return this.transform.roll}setRoll(t,a){return this.jumpTo({roll:t},a),this}cameraForBounds(t,a){t=yn.convert(t).adjustAntiMeridian();const c=a&&a.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),c,a)}_cameraForBoxAndBearing(t,a,c,f){const v={top:0,bottom:0,right:0,left:0};if(typeof(f=u.e({padding:v,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){const O=f.padding;f.padding={top:O,bottom:O,right:O,left:O}}const b=u.e(v,f.padding);f.padding=b;const C=this.transform,z=new yn(t,a);return this.cameraHelper.cameraForBoxAndBearing(f,b,z,c,C)}fitBounds(t,a,c){return this._fitInternal(this.cameraForBounds(t,a),a,c)}fitScreenCoordinates(t,a,c,f,v){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(u.P.convert(t)),this.transform.screenPointToLocation(u.P.convert(a)),c,f),f,v)}_fitInternal(t,a,c){return t?(delete(a=u.e(t,a)).padding,a.linear?this.easeTo(a,c):this.flyTo(a,c)):this}jumpTo(t,a){this.stop();const c=this._getTransformForUpdate();let f=!1,v=!1,b=!1;const C=c.zoom;this.cameraHelper.handleJumpToCenterZoom(c,t);const z=c.zoom!==C;return"elevation"in t&&c.elevation!==+t.elevation&&c.setElevation(+t.elevation),"bearing"in t&&c.bearing!==+t.bearing&&(f=!0,c.setBearing(+t.bearing)),"pitch"in t&&c.pitch!==+t.pitch&&(v=!0,c.setPitch(+t.pitch)),"roll"in t&&c.roll!==+t.roll&&(b=!0,c.setRoll(+t.roll)),t.padding==null||c.isPaddingEqual(t.padding)||c.setPadding(t.padding),this._applyUpdatedTransform(c),this.fire(new u.l("movestart",a)).fire(new u.l("move",a)),z&&this.fire(new u.l("zoomstart",a)).fire(new u.l("zoom",a)).fire(new u.l("zoomend",a)),f&&this.fire(new u.l("rotatestart",a)).fire(new u.l("rotate",a)).fire(new u.l("rotateend",a)),v&&this.fire(new u.l("pitchstart",a)).fire(new u.l("pitch",a)).fire(new u.l("pitchend",a)),b&&this.fire(new u.l("rollstart",a)).fire(new u.l("roll",a)).fire(new u.l("rollend",a)),this.fire(new u.l("moveend",a))}calculateCameraOptionsFromTo(t,a,c,f=0){const v=u.a9.fromLngLat(t,a),b=u.a9.fromLngLat(c,f),C=b.x-v.x,z=b.y-v.y,O=b.z-v.z,U=Math.hypot(C,z,O);if(U===0)throw new Error("Can't calculate camera options with same From and To");const H=Math.hypot(C,z),q=u.at(this.transform.cameraToCenterDistance/U/this.transform.tileSize),Q=180*Math.atan2(C,-z)/Math.PI;let re=180*Math.acos(H/U)/Math.PI;return re=O<0?90-re:90+re,{center:b.toLngLat(),elevation:f,zoom:q,pitch:re,bearing:Q}}calculateCameraOptionsFromCameraLngLatAltRotation(t,a,c,f,v){const b=this.transform.calculateCenterFromCameraLngLatAlt(t,a,c,f);return{center:b.center,elevation:b.elevation,zoom:b.zoom,bearing:c,pitch:f,roll:v}}easeTo(t,a){this._stop(!1,t.easeId),((t=u.e({offset:[0,0],duration:500,easing:u.cz},t)).animate===!1||!t.essential&&Se.prefersReducedMotion)&&(t.duration=0);const c=this._getTransformForUpdate(),f=this.getBearing(),v=c.pitch,b=c.roll,C="bearing"in t?this._normalizeBearing(t.bearing,f):f,z="pitch"in t?+t.pitch:v,O="roll"in t?this._normalizeBearing(t.roll,b):b,U="padding"in t?t.padding:c.padding,H=u.P.convert(t.offset);let q,Q;t.around&&(q=u.V.convert(t.around),Q=c.locationToScreenPoint(q));const re={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},de=this.cameraHelper.handleEaseTo(c,{bearing:C,pitch:z,roll:O,padding:U,around:q,aroundPoint:Q,offsetAsPoint:H,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||f!==C,this._pitching=this._pitching||z!==v,this._rolling=this._rolling||O!==b,this._padding=!c.isPaddingEqual(U),this._zooming=this._zooming||de.isZooming,this._easeId=t.easeId,this._prepareEase(a,t.noMoveStart,re),this.terrain&&this._prepareElevation(de.elevationCenter),this._ease((pe=>{de.easeFunc(pe),this.terrain&&!t.freezeElevation&&this._updateElevation(pe),this._applyUpdatedTransform(c),this._fireMoveEvents(a)}),(pe=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a,pe)}),t),this}_prepareEase(t,a,c={}){this._moving=!0,a||c.moving||this.fire(new u.l("movestart",t)),this._zooming&&!c.zooming&&this.fire(new u.l("zoomstart",t)),this._rotating&&!c.rotating&&this.fire(new u.l("rotatestart",t)),this._pitching&&!c.pitching&&this.fire(new u.l("pitchstart",t)),this._rolling&&!c.rolling&&this.fire(new u.l("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&a!==this._elevationTarget){const c=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(c-(a-(c*t+this._elevationStart))/(1-t)),this._elevationTarget=a}this.transform.setElevation(u.G.number(this._elevationStart,this._elevationTarget,t))}_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(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};const a=t.getCameraLngLat(),c=t.getCameraAltitude(),f=this.terrain?this.terrain.getElevationForLngLatZoom(a,t.zoom):0;if(c<f){const v=this.calculateCameraOptionsFromTo(a,f,t.center,t.elevation);return{pitch:v.pitch,zoom:v.zoom}}return{}}_applyUpdatedTransform(t){const a=[];if(a.push((f=>this._elevateCameraIfInsideTerrain(f))),this.transformCameraUpdate&&a.push((f=>this.transformCameraUpdate(f))),!a.length)return;const c=t.clone();for(const f of a){const v=c.clone(),{center:b,zoom:C,roll:z,pitch:O,bearing:U,elevation:H}=f(v);b&&v.setCenter(b),H!==void 0&&v.setElevation(H),C!==void 0&&v.setZoom(C),z!==void 0&&v.setRoll(z),O!==void 0&&v.setPitch(O),U!==void 0&&v.setBearing(U),c.apply(v,!1)}this.transform.apply(c,!1)}_fireMoveEvents(t){this.fire(new u.l("move",t)),this._zooming&&this.fire(new u.l("zoom",t)),this._rotating&&this.fire(new u.l("rotate",t)),this._pitching&&this.fire(new u.l("pitch",t)),this._rolling&&this.fire(new u.l("roll",t))}_afterEase(t,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;const c=this._zooming,f=this._rotating,v=this._pitching,b=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,c&&this.fire(new u.l("zoomend",t)),f&&this.fire(new u.l("rotateend",t)),v&&this.fire(new u.l("pitchend",t)),b&&this.fire(new u.l("rollend",t)),this.fire(new u.l("moveend",t))}flyTo(t,a){if(!t.essential&&Se.prefersReducedMotion){const Xe=u.U(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(Xe,a)}this.stop(),t=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.cz},t);const c=this._getTransformForUpdate(),f=c.bearing,v=c.pitch,b=c.roll,C=c.padding,z="bearing"in t?this._normalizeBearing(t.bearing,f):f,O="pitch"in t?+t.pitch:v,U="roll"in t?this._normalizeBearing(t.roll,b):b,H="padding"in t?t.padding:c.padding,q=u.P.convert(t.offset);let Q=c.centerPoint.add(q);const re=c.screenPointToLocation(Q),de=this.cameraHelper.handleFlyTo(c,{bearing:z,pitch:O,roll:U,padding:H,locationAtOffset:re,offsetAsPoint:q,center:t.center,minZoom:t.minZoom,zoom:t.zoom});let pe=t.curve;const fe=Math.max(c.width,c.height),_e=fe/de.scaleOfZoom,Me=de.pixelPathLength;typeof de.scaleOfMinZoom=="number"&&(pe=Math.sqrt(fe/de.scaleOfMinZoom/Me*2));const me=pe*pe;function Ce(Xe){const Mt=(_e*_e-fe*fe+(Xe?-1:1)*me*me*Me*Me)/(2*(Xe?_e:fe)*me*Me);return Math.log(Math.sqrt(Mt*Mt+1)-Mt)}function Le(Xe){return(Math.exp(Xe)-Math.exp(-Xe))/2}function we(Xe){return(Math.exp(Xe)+Math.exp(-Xe))/2}const Re=Ce(!1);let Ye=function(Xe){return we(Re)/we(Re+pe*Xe)},qe=function(Xe){return fe*((we(Re)*(Le(Mt=Re+pe*Xe)/we(Mt))-Le(Re))/me)/Me;var Mt},$e=(Ce(!0)-Re)/pe;if(Math.abs(Me)<2e-6||!isFinite($e)){if(Math.abs(fe-_e)<1e-6)return this.easeTo(t,a);const Xe=_e<fe?-1:1;$e=Math.abs(Math.log(_e/fe))/pe,qe=()=>0,Ye=Mt=>Math.exp(Xe*pe*Mt)}return t.duration="duration"in t?+t.duration:1e3*$e/("screenSpeed"in t?+t.screenSpeed/pe:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=f!==z,this._pitching=O!==v,this._rolling=U!==b,this._padding=!c.isPaddingEqual(H),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(de.targetCenter),this._ease((Xe=>{const Mt=Xe*$e,At=1/Ye(Mt),pt=qe(Mt);this._rotating&&c.setBearing(u.G.number(f,z,Xe)),this._pitching&&c.setPitch(u.G.number(v,O,Xe)),this._rolling&&c.setRoll(u.G.number(b,U,Xe)),this._padding&&(c.interpolatePadding(C,H,Xe),Q=c.centerPoint.add(q)),de.easeFunc(Xe,At,pt,Q),this.terrain&&!t.freezeElevation&&this._updateElevation(Xe),this._applyUpdatedTransform(c),this._fireMoveEvents(a)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(a)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,a){var c;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const f=this._onEaseEnd;delete this._onEaseEnd,f.call(this,a)}return t||(c=this.handlers)===null||c===void 0||c.stop(!1),this}_ease(t,a,c){c.animate===!1||c.duration===0?(t(1),a()):(this._easeStart=Te(),this._easeOptions=c,this._onEaseFrame=t,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,a){t=u.W(t,-180,180);const c=Math.abs(t-a);return Math.abs(t-360-a)<c&&(t-=360),Math.abs(t+360-a)<c&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(u.V.convert(t),this.transform):null}}const Gn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Yn{constructor(t=Gn){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=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=ve.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ve.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ve.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(){ve.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,a){const c=this._map._getUIString(`AttributionControl.${a}`);t.title=c,t.setAttribute("aria-label",c)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((f=>typeof f!="string"?"":f))):typeof this.options.customAttribution=="str
829ing"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const f=this._map.style.stylesheet;this.styleOwner=f.owner,this.styleId=f.id}const a=this._map.style.tileManagers;for(const f in a){const v=a[f];if(v.used||v.usedForTerrain){const b=v.getSource();b.attribution&&t.indexOf(b.attribution)<0&&t.push(b.attribution)}}t=t.filter((f=>String(f).trim())),t.sort(((f,v)=>f.length-v.length)),t=t.filter(((f,v)=>{for(let b=v+1;b<t.length;b++)if(t[b].indexOf(f)>=0)return!1;return!0}));const c=t.join(" | ");c!==this._attribHTML&&(this._attribHTML=c,t.length?(this._innerContainer.innerHTML=ve.sanitize(c),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Bc{constructor(t={}){this._updateCompact=()=>{const a=this._container.children;if(a.length){const c=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&c.classList.add("maplibregl-compact"):c.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=ve.create("div","maplibregl-ctrl");const a=ve.create("a","maplibregl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://maplibre.org/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ve.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class gl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const a=++this._id;return this._queue.push({callback:t,id:a,cancelled:!1}),a}remove(t){const a=this._currentlyRunning,c=a?this._queue.concat(a):this._queue;for(const f of c)if(f.id===t)return void(f.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const a=this._currentlyRunning=this._queue;this._queue=[];for(const c of a)if(!c.cancelled&&(c.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ei=u.aU([{name:"a_pos3d",type:"Int16",components:3}]);class tn extends u.E{constructor(t){super(),this._lastTilesetChange=Te(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,a){this.tileManager.update(t,a),this._renderableTilesKeys=[];const c={};for(const f of dn(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a,calculateTileZoom:this.tileManager._source.calculateTileZoom}))c[f.key]=!0,this._renderableTilesKeys.push(f.key),this._tiles[f.key]||(f.terrainRttPosMatrix32f=new Float64Array(16),u.c7(f.terrainRttPosMatrix32f,0,u.a5,u.a5,0,0,1),this._tiles[f.key]=new Fe(f,this.tileSize),this._lastTilesetChange=Te());for(const f in this._tiles)c[f]||delete this._tiles[f]}freeRtt(t){for(const a in this._tiles){const c=this._tiles[a];(!t||c.tileID.equals(t)||c.tileID.isChildOf(t)||t.isChildOf(c.tileID))&&(c.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,a){return a?this._getTerrainCoordsForTileRanges(t,a):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){const a={};for(const c of this._renderableTilesKeys){const f=this._tiles[c].tileID,v=t.clone(),b=u.bk();if(f.canonical.equals(t.canonical))u.c7(b,0,u.a5,u.a5,0,0,1);else if(f.canonical.isChildOf(t.canonical)){const C=f.canonical.z-t.canonical.z,z=f.canonical.x-(f.canonical.x>>C<<C),O=f.canonical.y-(f.canonical.y>>C<<C),U=u.a5>>C;u.c7(b,0,U,U,0,0,1),u.O(b,b,[-z*U,-O*U,0])}else{if(!t.canonical.isChildOf(f.canonical))continue;
829{const C=t.canonical.z-f.canonical.z,z=t.canonical.x-(t.canonical.x>>C<<C),O=t.canonical.y-(t.canonical.y>>C<<C),U=u.a5>>C;u.c7(b,0,u.a5,u.a5,0,0,1),u.O(b,b,[z*U,O*U,0]),u.Q(b,b,[1/2**C,1/2**C,0])}}v.terrainRttPosMatrix32f=new Float32Array(b),a[c]=v}return a}_getTerrainCoordsForTileRanges(t,a){const c={};for(const f of this._renderableTilesKeys){const v=this._tiles[f].tileID;if(!this._isWithinTileRanges(v,a))continue;const b=t.clone(),C=u.bk();if(v.canonical.z===t.canonical.z){const z=t.canonical.x-v.canonical.x+t.wrap*(1<<t.canonical.z),O=t.canonical.y-v.canonical.y;u.c7(C,0,u.a5,u.a5,0,0,1),u.O(C,C,[z*u.a5,O*u.a5,0])}else if(v.canonical.z>t.canonical.z){const z=v.canonical.z-t.canonical.z,O=v.canonical.x-(v.canonical.x>>z<<z)+t.wrap*(1<<v.canonical.z),U=v.canonical.y-(v.canonical.y>>z<<z),H=t.canonical.x-(v.canonical.x>>z),q=t.canonical.y-(v.canonical.y>>z),Q=u.a5>>z;u.c7(C,0,Q,Q,0,0,1),u.O(C,C,[-O*Q+H*u.a5,-U*Q+q*u.a5,0])}else{const z=t.canonical.z-v.canonical.z,O=t.canonical.x-(t.canonical.x>>z<<z)+t.wrap*(1<<t.canonical.z),U=t.canonical.y-(t.canonical.y>>z<<z),H=(t.canonical.x>>z)-v.canonical.x,q=(t.canonical.y>>z)-v.canonical.y,Q=u.a5<<z;u.c7(C,0,Q,Q,0,0,1),u.O(C,C,[O*u.a5+H*Q,U*u.a5+q*Q,0])}b.terrainRttPosMatrix32f=new Float32Array(C),c[f]=b}return c}getSourceTile(t,a){const c=this.tileManager._source;let f=t.overscaledZ-this.deltaZoom;if(f>c.maxzoom&&(f=c.maxzoom),f<c.minzoom)return;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(f).key);let v=this.findTileInCaches(this._sourceTileCache[t.key]);if(!v?.dem&&a)for(;f>=c.minzoom&&!v?.dem;)v=this.findTileInCaches(t.scaledTo(f--).key);return v}findTileInCaches(t){let a=this.tileManager.getTileByID(t);return a||(a=this.tileManager._outOfViewCache.getByKey(t),a)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,a){const c=a[t.canonical.z];return!!c&&(t.wrap>c.minWrap||t.wrap<c.maxWrap||t.canonical.x>=c.minTileXWrapped&&t.canonical.x<=c.maxTileXWrapped&&t.canonical.y>=c.minTileY&&t.canonical.y<=c.maxTileY)}}class Si{constructor(t,a,c){this._meshCache={},this.painter=t,this.tileManager=new tn(a),this.options=c,this.exaggeration=typeof c.exaggeration=="number"?c.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,a,c,f=u.a5){var v;if(!(a>=0&&a<f&&c>=0&&c<f))return 0;const b=this.getTerrainData(t),C=(v=b.tile)===null||v===void 0?void 0:v.dem;if(!C)return 0;const z=u.cD([],[a/f*u.a5,c/f*u.a5],b.u_terrain_matrix),O=[z[0]*C.dim,z[1]*C.dim],U=Math.floor(O[0]),H=Math.floor(O[1]),q=O[0]-U,Q=O[1]-H;return C.get(U,H)*(1-q)*(1-Q)+C.get(U+1,H)*q*(1-Q)+C.get(U,H+1)*(1-q)*Q+C.get(U+1,H+1)*q*Q}getElevationForLngLatZoom(t,a){if(!u.cE(a,t.wrap()))return 0;const{tileID:c,mercatorX:f,mercatorY:v}=this._getOverscaledTileIDFromLngLatZoom(t,a);return this.getElevation(c,f%u.a5,v%u.a5,u.a5)}getElevationForLngLat(t,a){const c=dn(a,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this});let f=0;for(const v of c)v.canonical.z>f&&(f=Math.min(v.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,f)}getElevation(t,a,c,f=u.a5){return this.getDEMElevation(t,a,c,f)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const f=this.painter.context,v=new u.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new u.T(f,v,f.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new u.T(f,new u.R({width:1,height:1}),f.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(f.gl.NEAREST,f.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=u.ar([])}const a=this.tileManager.getSourceTile(t,!0);if(a&&a.dem&&(!a.demTexture||a.needsTerrainPrepare)){const f=this.painter.context;a.demTexture=this.painter.getTileTexture(a.dem.stride),a.demTexture?a.demTexture.update(a.dem.getPixels(),{premultiply:!1}):a.demTexture=new u.T(f,a.dem.getPixels(),f.gl.RGBA,{premultiply:!1}),a.demTexture.bind(f.gl.NEAREST,f.gl.CLAMP_TO_EDGE),a.needsTerrainPrepare=!1}const c=a&&a.toString()+a.tileID.key+t.key;if(c&&!this._demMatrixCache[c]){const f=this.tileManager.getSource().maxzoom;let v=t.canonical.z-a.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=f?v=t.canonical.z-f:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const b=t.canonical.x-(t.canonical.x>>v<<v),C=t.canonical.y-(t.canonical.y>>v<<v),z=u.cF(new Float64Array(16),[1/(u.a5<<v),1/(u.a5<<v),0]);u.O(z,z,[b*u.a5,C*u.a5,0]),this._demMatrixCache[t.key]={matrix:z,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:a&&a.dem&&a.dem.dim||1,u_terrain_matrix:c?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:a&&a.dem&&a.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(a&&a.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:a}}getFramebuffer(t){const a=this.painter,c=a.width/devicePixelRatio,f=a.height/devicePixelRatio;return!this._fbo||this._fbo.width===c&&this._fbo.height===f||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new u.T(a.context,{width:c,height:f,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new u.T(a.context,{width:c,height:f,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=a.context.createFramebuffer(c,f,!0,!1),this._fbo.depthAttachment.set(a.context.createRenderbuffer(a.context.gl.DEPTH_COMPONENT16,c,f))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const a=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let v=0,b=0;v<this._coordsTextureSize;v++)for(let C=0;C<this._coordsTextureSize;C++,b+=4)a[b+0]=255&C,a[b+1]=255&v,a[b+2]=C>>8<<4|v>>8,a[b+3]=0;const c=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),f=new u.T(t,c,t.gl.RGBA,{premultiply:!1});return f.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=f,f}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);
vendor: 31,151 bytes, line 829
829const a=new Uint8Array(4),c=this.painter.context,f=c.gl,v=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),b=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),C=Math.round(this.painter.height/devicePixelRatio);c.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),f.readPixels(v,C-b-1,1,1,f.RGBA,f.UNSIGNED_BYTE,a),c.bindFramebuffer.set(null);const z=a[0]+(a[2]>>4<<8),O=a[1]+((15&a[2])<<8),U=this.coordsIndex[255-a[3]],H=U&&this.tileManager.getTileByID(U);if(!H)return null;const q=this._coordsTextureSize,Q=(1<<H.tileID.canonical.z)*q;return new u.a9((H.tileID.canonical.x*q+z)/Q+H.tileID.wrap,(H.tileID.canonical.y*q+O)/Q,this.getElevation(H.tileID,z,O,q))}depthAtPoint(t){const a=new Uint8Array(4),c=this.painter.context,f=c.gl;return c.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),f.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,f.RGBA,f.UNSIGNED_BYTE,a),c.bindFramebuffer.set(null),(a[0]/16777216+a[1]/65536+a[2]/256+a[3])/256}getTerrainMesh(t){var a;const c=((a=this.painter.style.projection)===null||a===void 0?void 0:a.transitionState)>0,f=c&&t.canonical.y===0,v=c&&t.canonical.y===(1<<t.canonical.z)-1,b=`m_${f?"n":""}_${v?"s":""}`;if(this._meshCache[b])return this._meshCache[b];const C=this.painter.context,z=new u.cG,O=new u.aY,U=this.meshSize,H=u.a5/U,q=U*U;for(let we=0;we<=U;we++)for(let Re=0;Re<=U;Re++)z.emplaceBack(Re*H,we*H,0);for(let we=0;we<q;we+=U+1)for(let Re=0;Re<U;Re++)O.emplaceBack(Re+we,U+Re+we+1,U+Re+we+2),O.emplaceBack(Re+we,U+Re+we+2,Re+we+1);const Q=z.length,re=Q+(U+1),de=(U+1)*U,pe=f?u.br:0,fe=f?0:1,_e=v?u.bs:u.a5,Me=v?0:1;for(let we=0;we<=U;we++)z.emplaceBack(we*H,pe,fe);for(let we=0;we<=U;we++)z.emplaceBack(we*H,_e,Me);for(let we=0;we<U;we++)O.emplaceBack(de+we,re+we,re+we+1),O.emplaceBack(de+we,re+we+1,de+we+1),O.emplaceBack(0+we,Q+we+1,Q+we),O.emplaceBack(0+we,0+we+1,Q+we+1);const me=z.length,Ce=me+2*(U+1);for(const we of[0,1])for(let Re=0;Re<=U;Re++)for(const Ye of[0,1])z.emplaceBack(we*u.a5,Re*H,Ye);for(let we=0;we<2*U;we+=2)O.emplaceBack(me+we,me+we+1,me+we+3),O.emplaceBack(me+we,me+we+3,me+we+2),O.emplaceBack(Ce+we,Ce+we+3,Ce+we+1),O.emplaceBack(Ce+we,Ce+we+2,Ce+we+3);const Le=new Ji(C.createVertexBuffer(z,Ei.members),C.createIndexBuffer(O),u.aX.simpleSegment(0,0,z.length,O.length));return this._meshCache[b]=Le,Le}getMeshFrameDelta(t){return 2*Math.PI*u.bE/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,a){var c;if(!u.cE(a,t.wrap()))return 0;const{tileID:f}=this._getOverscaledTileIDFromLngLatZoom(t,a);return(c=this.getMinMaxElevation(f).minElevation)!==null&&c!==void 0?c:0}getMinMaxElevation(t){const a=this.getTerrainData(t).tile,c={minElevation:null,maxElevation:null};return a&&a.dem&&(c.minElevation=a.dem.min*this.exaggeration,c.maxElevation=a.dem.max*this.exaggeration),c}_getOverscaledTileIDFromLngLatZoom(t,a){const c=u.a9.fromLngLat(t.wrap()),f=(1<<a)*u.a5,v=c.x*f,b=c.y*f,C=Math.floor(v/u.a5),z=Math.floor(b/u.a5);return{tileID:new u.a2(a,0,a,C,z),mercatorX:v,mercatorY:b}}}class Fn{constructor(t,a,c){this._context=t,this._size=a,this._tileSize=c,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const a=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),c=new u.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return c.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),a.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),a.colorAttachment.set(c.texture),{id:t,fbo:a,texture:c,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((a=>t.id!==a)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((t=>!t.inUse))===!1}}const zs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class io{constructor(t,a){this.painter=t,this.terrain=a,this.pool=new Fn(t.context,30,a.tileManager.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,a){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((c=>!t._layers[c].isHidden(a))),this._coordsAscending={};for(const c in t.tileManagers){this._coordsAscending[c]={};const f=t.tileManagers[c].getVisibleCoordinates(),v=t.tileManagers[c].getSource(),b=v instanceof Sa?v.terrainTileRanges:null;for(const C of f){const z=this.terrain.tileManager.getTerrainCoords(C,b);for(const O in z)this._coordsAscending[c][O]||(this._coordsAscending[c][O]=[]),this._coordsAscending[c][O].push(z[O])}}this._coordsAscendingStr={};for(const c of t._order){const f=t._layers[c],v=f.source;if(zs[f.type]&&!this._coordsAscendingStr[v]){this._coordsAscendingStr[v]={};for(const b in this._coordsAscending[v])this._coordsAscendingStr[v][b]=this._coordsAscending[v][b].map((C=>C.key)).sort().join()}}for(const c of this._renderableTiles)for(const f in this._coordsAscendingStr){const v=this._coordsAscendingStr[f][c.tileID.key];v&&v!==c.rttCoords[f]&&(c.rtt=[])}}renderLayer(t,a){if(t.isHidden(this.painter.transform.zoom))return!1;const c=Object.assign(Object.assign({},a),{isRenderingToTexture:!0}),f=t.type,v=this.painter,b=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(zs[f]&&(this._prevType&&zs[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(t.id),!b))return!0;if(zs[this._prevType]||zs[f]&&b){this._prevType=f;const C=this._stacks.length-1,z=this._stacks[C]||[];for(const O of this._renderableTiles){if(this.pool.isFull()&&(dh(this.painter,this.terrain,this._rttTiles,c),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(O),O.rtt[C]){const H=this.pool.getObjectForId(O.rtt[C].id);if(H.stamp===O.rtt[C].stamp){this.pool.useObject(H);continue}}const U=this.pool.getOrCreateFreeObject();this.pool.useObject(U),this.pool.stampObject(U),O.rtt[C]={id:U.id,stamp:U.stamp},v.context.bindFramebuffer.set(U.fbo.framebuffer),v.context.clear({color:u.bp.transparent,stencil:0}),v.currentStencilSource=void 0;for(let H=0;H<z.length;H++){const q=v.style._layers[z[H]],Q=q.source?this._coordsAscending[q.source][O.tileID.key]:[O.tileID];v.context.viewport.set([0,0,U.fbo.width,U.fbo.height]),v._renderTileClippingMasks(q,Q,!0),v.renderLayer(v,v.style.tileManagers[q.source],q,Q,c),q.source&&(O.rttCoords[q.source]=this._coordsAscendingStr[q.source][O.tileID.key])}}return dh(this.painter,this.terrain,this._rttTiles,c),this._rttTiles=[],this.pool.freeAllObjects(),zs[f]}return!1}}const gu={"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"},_u=V,_l={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:Gn,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:u.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0},Jh={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Ln{constructor(t,a,c=!1){this.mousedown=v=>{this.startMove(v,ve.mousePos(this.element,v)),ve.addEventListener(window,"mousemove",this.mousemove),ve.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=v=>{this.move(v,ve.mousePos(this.element,v))},this.mouseup=v=>{this._rotatePitchHandler.dragEnd(v),this.offTemp()},this.touchstart=v=>{v.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ve.touchPos(this.element,v.targetTouches)[0],this.startMove(v,this._startPos),ve.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ve.addEventListener(window,"touchend",this.touchend))},this.touchmove=v=>{v.targetTouches.length!==1?this.reset():(this._lastPos=ve.touchPos(this.element,v.targetTouches)[0],this.move(v,this._lastPos))},this.touchend=v=>{v.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._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=a;const f=new Lc;this._rotatePitchHandler=new Es({clickTolerance:3,move:(v,b)=>{const C=a.getBoundingClientRect(),z=new u.P((C.bottom-C.top)/2,(C.right-C.left)/2);return{bearingDelta:u.cy(new u.P(v.x,b.y),b,z),pitchDelta:c?-.5*(b.y-v.y):void 0}},moveStateManager:f,enable:!0,assignEvents:()=>{}}),this.map=t,ve.addEventListener(a,"mousedown",this.mousedown),ve.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),ve.addEventListener(a,"touchcancel",this.reset)}startMove(t,a){this._rotatePitchHandler.dragStart(t,a),ve.disableDrag()}move(t,a){const c=this.map,{bearingDelta:f,pitchDelta:v}=this._rotatePitchHandler.dragMove(t,a)||{};f&&c.setBearing(c.getBearing()+f),v&&c.setPitch(c.getPitch()+v)}off(){const t=this.element;ve.removeEventListener(t,"mousedown",this.mousedown),ve.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),ve.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ve.removeEventListener(window,"touchend",this.touchend),ve.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){ve.enableDrag(),ve.removeEventListener(window,"mousemove",this.mousemove),ve.removeEventListener(window,"mouseup",this.mouseup),ve.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ve.removeEventListener(window,"touchend",this.touchend)}}let no;function tc(g,t,a,c=!1){if(c||!a.getCoveringTilesDetailsProvider().allowWorldCopies())return g?.wrap();const f=new u.V(g.lng,g.lat);if(g=new u.V(g.lng,g.lat),t){const v=new u.V(g.lng-360,g.lat),b=new u.V(g.lng+360,g.lat),C=a.locationToScreenPoint(g).distSqr(t);a.locationToScreenPoint(v).distSqr(t)<C?g=v:a.locationToScreenPoint(b).distSqr(t)<C&&(g=b)}for(;Math.abs(g.lng-a.center.lng)>180;){const v=a.locationToScreenPoint(g);if(v.x>=0&&v.y>=0&&v.x<=a.width&&v.y<=a.height)break;g.lng>a.center.lng?g.lng-=360:g.lng+=360}return g.lng!==f.lng&&a.isPointOnMapSurface(a.locationToScreenPoint(g))?g:f}const ic={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 Nc(g,t,a){const c=g.classList;for(const f in ic)c.remove(`maplibregl-${a}-anchor-${f}`);c.add(`maplibregl-${a}-anchor-${t}`)}class Fc extends u.E{constructor(t){if(super(),this._onKeyPress=a=>{const c=a.code,f=a.charCode||a.keyCode;c!=="Space"&&c!=="Enter"&&f!==32&&f!==13||this.togglePopup()},this._onMapClick=a=>{const c=a.originalEvent.target,f=this._element;this._popup&&(c===f||f.contains(c))&&this.togglePopup()},this._update=a=>{if(!this._map)return;const c=this._map.loaded()&&!this._map.isMoving();(a?.type==="terrain"||a?.type==="render"&&!c)&&this._map.once("render",this._update),this._lngLat=tc(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let f="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?f=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(f=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let v="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?v="rotateX(0deg)":this._pitchAlignment==="map"&&(v=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),ve.setTransform(this._element,`${ic[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${v} ${f}`),Se.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(a&&a.type==="moveend")})).catch((()=>{}))},this._onMove=a=>{if(!this._isDragging){const c=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=c}this._isDragging&&(this._pos=a.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 u.l("dragstart"))),this.fire(new u.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new u.l("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.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=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=u.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=ve.create("div");const a=ve.createNS("http://www.w3.org/2000/svg","svg"),c=41,f=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${c}px`),a.setAttributeNS(null,"width",`${f}px`),a.setAttributeNS(null,"viewBox",`0 0 ${f} ${c}`);const v=ve.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"stroke","none"),v.setAttributeNS(null,"stroke-width","1"),v.setAttributeNS(null,"fill","none"),v.setAttributeNS(null,"fill-rule","evenodd");const b=ve.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"fill-rule","nonzero");const C=ve.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"transform","translate(3.0, 29.0)"),C.setAttributeNS(null,"fill","#000000");const z=[{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 fe of z){const _e=ve.createNS("http://www.w3.org/2000/svg","ellipse");_e.setAttributeNS(null,"opacity","0.04"),_e.setAttributeNS(null,"cx","10.5"),_e.setAttributeNS(null,"cy","5.80029008"),_e.setAttributeNS(null,"rx",fe.rx),_e.setAttributeNS(null,"ry",fe.ry),C.appendChild(_e)}const O=ve.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"fill",this._color);const U=ve.createNS("http://www.w3.org/2000/svg","path");U.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"),O.appendChild(U);const H=ve.createNS("http://www.w3.org/2000/svg","g");H.setAttributeNS(null,"opacity","0.25"),H.setAttributeNS(null,"fill","#000000");const q=ve.createNS("http://www.w3.org/2000/svg","path");q.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"),H.appendChild(q);const Q=ve.createNS("http://www.w3.org/2000/svg","g");Q.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Q.setAttributeNS(null,"fill","#FFFFFF");const re=ve.createNS("http://www.w3.org/2000/svg","g");re.setAttributeNS(null,"transform","translate(8.0, 8.0)");const de=ve.createNS("http://www.w3.org/2000/svg","circle");de.setAttributeNS(null,"fill","#000000"),de.setAttributeNS(null,"opacity","0.25"),de.setAttributeNS(null,"cx","5.5"),de.setAttributeNS(null,"cy","5.5"),de.setAttributeNS(null,"r","5.4999962");const pe=ve.createNS("http://www.w3.org/2000/svg","circle");pe.setAttributeNS(null,"fill","#FFFFFF"),pe.setAttributeNS(null,"cx","5.5"),pe.setAttributeNS(null,"cy","5.5"),pe.setAttributeNS(null,"r","5.4999962"),re.appendChild(de),re.appendChild(pe),b.appendChild(C),b.appendChild(O),b.appendChild(H),b.appendChild(Q),b.appendChild(re),a.appendChild(b),a.setAttributeNS(null,"height",c*this._scale+"px"),a.setAttributeNS(null,"width",f*this._scale+"px"),this._element.appendChild(a),this._offset=u.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(a=>{a.preventDefault()})),this._element.addEventListener("mousedown",(a=>{a.preventDefault()})),Nc(this._element,this._anchor,"marker"),t&&t.className)for(const a of t.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.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),ve.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=u.V.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const f=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[f,-1*(38.1-13.5+f)],"bottom-right":[-f,-1*(38.1-13.5+f)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var a,c;const f=(a=this._map)===null||a===void 0?void 0:a.terrain,v=this._map.transform.isLocationOccluded(this._lngLat);if(!f||v){const Q=v?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==Q&&(this._element.style.opacity=Q))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const b=this._map,C=b.terrain.depthAtPoint(this._pos),z=b.terrain.getElevationForLngLat(this._lngLat,b.transform);if(b.transform.lngLatToCameraDepth(this._lngLat,z)-C<.006)return void(this._element.style.opacity=this._opacity);const O=-this._offset.y/b.transform.pixelsPerMeter,U=Math.sin(b.getPitch()*Math.PI/180)*O,H=b.terrain.depthAtPoint(new u.P(this._pos.x,this._pos.y-this._offset.y)),q=b.transform.lngLatToCameraDepth(this._lngLat,z+U)-H>.006;!((c=this._popup)===null||c===void 0)&&c.isOpen()&&q&&this._popup.remove(),this._element.style.opacity=q?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=u.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(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(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,a){return(this._opacity===void 0||t===void 0&&a===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=t),a!==void 0&&(this._opacityWhenCovered=a),this._map&&this._updateOpacity(!0),this}}const jc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Vl=0,yl=!1;const Kr={maxWidth:100,unit:"metric"};function jn(g,t,a){const c=a&&a.maxWidth||100,f=g._container.clientHeight/2,v=g._container.clientWidth/2,b=g.unproject([v-c/2,f]),C=g.unproject([v+c/2,f]),z=Math.round(g.project(C).x-g.project(b).x),O=Math.min(c,z,g._container.clientWidth),U=b.distanceTo(C);if(a&&a.unit==="imperial"){const H=3.2808*U;H>5280?jo(t,O,H/5280,g._getUIString("ScaleControl.Miles")):jo(t,O,H,g._getUIString("ScaleControl.Feet"))}else a&&a.unit==="nautical"?jo(t,O,U/1852,g._getUIString("ScaleControl.NauticalMiles")):U>=1e3?jo(t,O,U/1e3,g._getUIString("ScaleControl.Kilometers")):jo(t,O,U,g._getUIString("ScaleControl.Meters"))}function jo(g,t,a,c){const f=(function(v){const b=Math.pow(10,`${Math.floor(v)}`.length-1);let C=v/b;return C=C>=10?10:C>=5?5:C>=3?3:C>=2?2:C>=1?1:(function(z){const O=Math.pow(10,Math.ceil(-Math.log(z)/Math.LN10));return Math.round(z*O)/O})(C),b*C})(a);g.style.width=t*(f/a)+"px",g.innerHTML=`${f}&nbsp;${c}`}const yu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},vu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function nc(g){if(g){if(typeof g=="number"){const t=Math.round(Math.abs(g)/Math.SQRT2);return{center:new u.P(0,0),top:new u.P(0,g),"top-left":new u.P(t,t),"top-right":new u.P(-t,t),bottom:new u.P(0,-g),"bottom-left":new u.P(t,-t),"bottom-right":new u.P(-t,-t),left:new u.P(g,0),right:new u.P(-g,0)}}if(g instanceof u.P||Array.isArray(g)){const t=u.P.convert(g);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:u.P.convert(g.center||[0,0]),top:u.P.convert(g.top||[0,0]),"top-left":u.P.convert(g["top-left"]||[0,0]),"top-right":u.P.convert(g["top-right"]||[0,0]),bottom:u.P.convert(g.bottom||[0,0]),"bottom-left":u.P.convert(g["bottom-left"]||[0,0]),"bottom-right":u.P.convert(g["bottom-right"]||[0,0]),left:u.P.convert(g.left||[0,0]),right:u.P.convert(g.right||[0,0])}}return nc(new u.P(0,0))}const ro=V;T.AJAXError=u.cJ,T.Event=u.l,T.Evented=u.E,T.LngLat=u.V,T.MercatorCoordinate=u.a9,T.Point=u.P,T.addProtocol=u.cK,T.config=u.c,T.removeProtocol=u.cL,T.AttributionControl=Yn,T.BoxZoomHandler=jl,T.CanvasSource=$o,T.CooperativeGesturesHandler=Ut,T.DoubleClickZoomHandler=vh,T.DragPanHandler=Qh,T.DragRotateHandler=os,T.EdgeInsets=Hr,T.FullscreenControl=class extends u.E{constructor(g={}){super(),this._onFullscreenChange=()=>{var t;let a=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((t=a?.shadowRoot)===null||t===void 0)&&t.fullscreenElement;)a=a.shadowRoot.fullscreenElement;a===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,g&&g.container&&(g.container instanceof HTMLElement?this._container=g.container:u.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(g){return this._map=g,this._container||(this._container=this._map.getContainer()),this._controlContainer=ve.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ve.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const g=this._fullscreenButton=ve.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ve.create("span","maplibregl-ctrl-icon",g).setAttribute("aria-hidden","true"),g.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const g=this._getTitle();this._fullscreenButton.setAttribute("aria-label",g),this._fullscreenButton.title=g}_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 u.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new u.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},T.GeoJSONSource=pr,T.GeolocateControl=class extends u.E{constructor(g){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new u.l("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
829RROR":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(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new u.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{const a=new u.V(t.coords.longitude,t.coords.latitude),c=t.coords.accuracy,f=this._map.getBearing(),v=u.e({bearing:f},this.options.fitBoundsOptions),b=yn.fromLngLat(a,c);this._map.fitBounds(b,v,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const a=new u.V(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(t.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 a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&yl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new u.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=ve.create("button","maplibregl-ctrl-geolocate",this._container),ve.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){u.w("Geolocation support is not available so the GeolocateControl will be disabled.");const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{const a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ve.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Fc({element:this._dotElement}),this._circleElement=ve.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(a=>{const c=a?.[0]instanceof ResizeObserverEntry;a.geolocateSource||this._watchState!=="ACTIVE_LOCK"||c||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new u.l("trackuserlocationend")),this.fire(new u.l("userlocationlostfocus")))}))}},this.options=u.e({},jc,g)}onAdd(g){return this._map=g,this._container=ve.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return u._(this,arguments,void 0,(function*(t=!1){if(no!==void 0&&!t)return no;if(window.navigator.permissions===void 0)return no=!!window.navigator.geolocation,no;try{no=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{no=!!window.navigator.geolocation}return no}))})().then((t=>this._finishSetupUI(t))),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(),ve.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,Vl=0,yl=!1}_isOutOfMapMaxBounds(g){const t=this._map.getMaxBounds(),a=g.coords;return t&&(a.longitude<t.getWest()||a.longitude>t.getEast()||a.latitude<t.getSouth()||a.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
829RROR",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":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){const g=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&g))return;const t=this._map.project(g),a=this._map.unproject([t.x+100,t.y]),c=g.distanceTo(a)/100,f=2*this._accuracy/c;this._circleElement.style.width=`${f.toFixed(2)}px`,this._circleElement.style.height=`${f.toFixed(2)}px`}trigger(){if(!this._setup)return u.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 u.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Vl--,yl=!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 u.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.l("trackuserlocationstart")),this.fire(new u.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Vl++,Vl>1?(g={maximumAge:6e5,timeout:0},yl=!0):(g=this.options.positionOptions,yl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,g)}}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)}},T.GlobeControl=class{constructor(){this._toggleProjection=()=>{var g;const t=(g=this._map.getProjection())===null||g===void 0?void 0:g.type;this._map.setProjection(t!=="mercator"&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var g;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((g=this._map.getProjection())===null||g===void 0?void 0:g.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(g){return this._map=g,this._container=ve.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=ve.create("button","maplibregl-ctrl-globe",this._container),ve.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(){ve.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},T.Hash=nr,T.ImageSource=Sa,T.KeyboardHandler=an,T.LngLatBounds=yn,T.LogoControl
vendor: 39,894 bytes, line 829
829=Bc,T.Map=class extends rr{get _ownerWindow(){var g,t;return((t=(g=this._container)===null||g===void 0?void 0:g.ownerDocument)===null||t===void 0?void 0:t.defaultView)||window}constructor(g){var t,a;u.cH.mark(u.cI.create);const c=Object.assign(Object.assign(Object.assign({},_l),g),{canvasContextAttributes:Object.assign(Object.assign({},_l.canvasContextAttributes),g.canvasContextAttributes)});if(c.minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const f=new $n,v=new Ci;c.minZoom!==void 0&&f.setMinZoom(c.minZoom),c.maxZoom!==void 0&&f.setMaxZoom(c.maxZoom),c.minPitch!==void 0&&f.setMinPitch(c.minPitch),c.maxPitch!==void 0&&f.setMaxPitch(c.maxPitch),c.renderWorldCopies!==void 0&&f.setRenderWorldCopies(c.renderWorldCopies),c.transformConstrain!==null&&f.setConstrainOverride(c.transformConstrain),super(f,v,{bearingSnap:c.bearingSnap,zoomSnap:c.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new gl,this._controls=[],this._mapId=u.af(),this._lostContextStyle={style:null,images:null},this._contextLost=C=>{C.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy();for(const z of Object.values(this.style._layers))if(z.type==="custom"&&console.warn(`Custom layer with id '${z.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),z._listeners)for(const[O]of Object.entries(z._listeners))console.warn(`Custom layer with id '${z.id}' had event listeners for event '${O}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this._lostContextStyle=this._getStyleAndImages(),this.style.destroy(),this.style=null,this.fire(new u.l("webglcontextlost",{originalEvent:C}))},this._contextRestored=C=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new u.l("webglcontextrestored",{originalEvent:C}))},this._onMapScroll=C=>{if(C.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},c.canvasContextAttributes),this._trackResize=c.trackResize===!0,this._bearingSnap=c.bearingSnap,this._zoomSnap=c.zoomSnap,this._centerClampedToGround=c.centerClampedToGround,this._refreshExpiredTiles=c.refreshExpiredTiles===!0,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions===!0,this._collectResourceTiming=c.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},gu),c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this._zoomLevelsToOverscale=c.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=c.transformCameraUpdate,this.transformConstrain=c.transformConstrain,this.cancelPendingTileRequestsWhileZooming=c.cancelPendingTileRequestsWhileZooming===!0,c.reduceMotion!==void 0&&(Se.prefersReducedMotion=c.reduceMotion),this._imageQueueHandle=Ft.addThrottleControl((()=>this.isMoving())),this._requestManager=new vi(c.transformRequest),this._container=this._resolveContainer(c.container),c.maxBounds&&this.setMaxBounds(c.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"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Oc(this,c),this._hash=c.hash&&new nr(typeof c.hash=="string"&&c.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:c.center,elevation:c.elevation,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,roll:c.roll}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,u.e({},c.fitBoundsOptions,{duration:0}))));const b=typeof c.style=="string"||((a=(t=c.style)===null||t===void 0?void 0:t.projection)===null||a===void 0?void 0:a.type)!=="globe";this.resize(null,b),this._localIdeographFontFamily=c.localIdeographFontFamily,this._validateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new Yn(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new Bc,c.logoPosition),this.on("style.load",(()=>{if(b||this._resizeTransform(),this.transform.unmodified){const C=u.U(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(C)}})),this.on("data",(C=>{this._update(C.dataType==="style"),this.fire(new u.l(`${C.dataType}data`,C))})),this.on("dataloading",(C=>{this.fire(new u.l(`${C.dataType}dataloading`,C))})),this.on("dataabort",(C=>{this.fire(new u.l("sourcedataabort",C))}))}_getMapId(){return this._mapId}setGlobalStateProperty(g,t){return this.style.setGlobalStateProperty(g,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(g,t){if(t===void 0&&(t=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new u.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const a=g.onAdd(this);this._controls.push(g);const c=this._controlPositions[t];return t.indexOf("bottom")!==-1?c.insertBefore(a,c.firstChild):c.appendChild(a),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new u.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(g);return t>-1&&this._controls.splice(t,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}coveringTiles(g){return dn(this.transform,g)}calculateCameraOptionsFromTo(g,t,a,c){return c==null&&this.terrain&&(c=this.terrain.getElevationForLngLat(a,this.transform)),super.calculateCameraOptionsFromTo(g,t,a,c)}resize(g,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);const a=!this._moving;return a&&(this.stop(),this.fire(new u.l("movestart",g)).fire(new u.l("move",g))),this.fire(new u.l("resize",g)),a&&this.fire(new u.l("moveend",g)),this}_resizeInternal(g=!0){const[t,a]=this._containerDimensions(),c=this._getClampedPixelRatio(t,a);if(this._resizeCanvas(t,a,c),this.painter.resize(t,a,c),this.painter.overLimit()){const f=this.painter.context.gl;this._maxCanvasSize=[f.drawingBufferWidth,f.drawingBufferHeight];const v=this._getClampedPixelRatio(t,a);this._resizeCanvas(t,a,v),this.painter.resize(t,a,v)}this._resizeTransform(g)}_resizeTransform(g=!0){var t;const[a,c]=this._containerDimensions();this.transform.resize(a,c,g),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,c,g)}_getClampedPixelRatio(g,t){const{0:a,1:c}=this._maxCanvasSize,f=this.getPixelRatio(),v=g*f,b=t*f;return Math.min(v>a?a/v:1,b>c?c/b:1)*f}getPixelRatio(){var g;return(g=this._overridePixelRatio)!==null&&g!==void 0?g:devicePixelRatio}setPixelRatio(g){this._overridePixelRatio=g,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(yn.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom){const t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMinZoom(g),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new u.l("zoomstart")).fire(new u.l("zoom")).fire(new u.l("zoomend")).fire(new u.l("movestart")).fire(new u.l("move")).fire(new u.l("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(g){if((g=g??22)>=this.transform.minZoom){const t=this.transform.zoom,a=this._getTransformForUpdate();return a.setMaxZoom(g),this._applyUpdatedTransform(a),this._update(),t!==this.transform.zoom&&this.fire(new u.l("zoomstart")).fire(new u.l("zoom")).fire(new u.l("zoomend")).fire(new u.l("movestart")).fire(new u.l("move")).fire(new u.l("moveend")),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(g){if((g=g??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch){const t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMinPitch(g),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new u.l("pitchstart")).fire(new u.l("pitch")).fire(new u.l("pitchend")).fire(new u.l("movestart")).fire(new u.l("move")).fire(new u.l("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(g){if((g=g??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(g>=this.transform.minPitch){const t=this.transform.pitch,a=this._getTransformForUpdate();return a.setMaxPitch(g),this._applyUpdatedTransform(a),this._update(),t!==this.transform.pitch&&this.fire(new u.l("pitchstart")).fire(new u.l("pitch")).fire(new u.l("pitchend")).fire(new u.l("movestart")).fire(new u.l("move")).fire(new u.l("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(g){return this.transform.setRenderWorldCopies(g),this._update()}setTransformConstrain(g){return this.transform.setConstrainOverride(g),this._update()}project(g){return this.transform.locationToScreenPoint(u.V.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.screenPointToLocation(u.P.convert(g),this.terrain)}isMoving(){var g;return this._moving||((g=this.handlers)===null||g===void 0?void 0:g.isMoving())}isZooming(){var g;return this._zooming||((g=this.handlers)===null||g===void 0?void 0:g.isZooming())}isRotating(){var g;return this._rotating||((g=this.handlers)===null||g===void 0?void 0:g.isRotating())}_createDelegatedListener(g,t,a){if(g==="mouseenter"||g==="mouseover"){let c=!1;return{layers:t,listener:a,delegates:{mousemove:v=>{const b=t.filter((z=>this.getLayer(z))),C=b.length!==0?this.queryRenderedFeatures(v.point,{layers:b}):[];C.length?c||(c=!0,a.call(this,new Er(g,this,v.originalEvent,{features:C}))):c=!1},mouseout:()=>{c=!1}}}}if(g==="mouseleave"||g==="mouseout"){let c=!1;return{layers:t,listener:a,delegates:{mousemove:b=>{const C=t.filter((z=>this.getLayer(z)));(C.length!==0?this.queryRenderedFeatures(b.point,{layers:C}):[]).length?c=!0:c&&(c=!1,a.call(this,new Er(g,this,b.originalEvent)))},mouseout:b=>{c&&(c=!1,a.call(this,new Er(g,this,b.originalEvent)))}}}}{const c=f=>{const v=t.filter((C=>this.getLayer(C))),b=v.length!==0?this.queryRenderedFeatures(f.point,{layers:v}):[];b.length&&(f.features=b,a.call(this,f),delete f.features)};return{layers:t,listener:a,delegates:{[g]:c}}}}_saveDelegatedListener(g,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(t)}_removeDelegatedListener(g,t,a){if(!this._delegatedListeners||!this._delegatedListeners[g])return;const c=this._delegatedListeners[g];for(let f=0;f<c.length;f++){const v=c[f];if(v.listener===a&&v.layers.length===t.length&&v.layers.every((b=>t.includes(b)))){for(const b in v.delegates)this.off(b,v.delegates[b]);return void c.splice(f,1)}}}on(g,t,a){if(a===void 0)return super.on(g,t);const c=typeof t=="string"?[t]:t,f=this._createDelegatedListener(g,c,a);this._saveDelegatedListener(g,f);for(const v in f.delegates)this.on(v,f.delegates[v]);return{unsubscribe:()=>{this._removeDelegatedListener(g,c,a)}}}once(g,t,a){if(a===void 0)return super.once(g,t);const c=typeof t=="string"?[t]:t,f=this._createDelegatedListener(g,c,a);for(const v in f.delegates){const b=f.delegates[v];f.delegates[v]=(...C)=>{this._removeDelegatedListener(g,c,a),b(...C)}}this._saveDelegatedListener(g,f);for(const v in f.delegates)this.once(v,f.delegates[v]);return this}off(g,t,a){return a===void 0?super.off(g,t):(this._removeDelegatedListener(g,typeof t=="string"?[t]:t,a),this)}queryRenderedFeatures(g,t){if(!this.style)return[];let a;const c=g instanceof u.P||Array.isArray(g),f=c?g:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(c?{}:g)||{},f instanceof u.P||typeof f[0]=="number")a=[u.P.convert(f)];else{const v=u.P.convert(f[0]),b=u.P.convert(f[1]);a=[v,new u.P(b.x,v.y),b,new u.P(v.x,b.y),v]}return this.style.queryRenderedFeatures(a,t,this.transform)}querySourceFeatures(g,t){return this.style.querySourceFeatures(g,t)}setStyle(g,t){return(t=u.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&g?(this._diffStyle(g,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(g,t))}setTransformRequest(g){return this._requestManager.setTransformRequest(g),this}_getUIString(g){const t=this._locale[g];if(t==null)throw new Error(`Missing UI string '${g}'`);return t}_updateStyle(g,t){var a,c;if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(g,t)));const f=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new bs(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof g=="string"?this.style.loadURL(g,t,f):this.style.loadJSON(g,t,f),this):((c=(a=this.style)===null||a===void 0?void 0:a.projection)===null||c===void 0||c.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new bs(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,t){if(typeof g=="string"){const a=this._requestManager.transformRequest(g,"Style");u.j(a,new AbortController).then((c=>{this._updateDiff(c.data,t)})).catch((c=>{c&&this.fire(new u.k(c))}))}else typeof g=="object"&&this._updateDiff(g,t)}_updateDiff(g,t){try{this.style.setState(g,t)&&this._update(!0)}catch(a){u.w(`Unable to perform style diff: ${a.message||a.error||a}.  Rebuilding the style from scratch.`),this._updateStyle(g,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():u.w("There is no style added to the map.")}addSource(g,t){return this._lazyInitEmptyStyle(),this.style.addSource(g,t),this._update(!0)}isSourceLoaded(g){const t=this.style&&this.style.tileManagers[g];if(t!==void 0)return t.loaded();this.fire(new u.k(new Error(`There is no tile manager with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){const t=this.style.tileManagers[g.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);this.terrain===null&&t.reload();for(const a in this.style._layers){const c=this.style._layers[a];c.type==="hillshade"&&c.source===g.source&&u.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."),c.type==="color-relief"&&c.source===g.source&&u.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Si(this.painter,t,g),this.painter.renderToTexture=new io(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=a=>{var c;a.dataType==="style"?this.terrain.tileManager.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==g.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))),((c=a.source)===null||c===void 0?void 0:c.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(a.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.tileManager.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 u.l("terrain",{terrain:g})),this}getTerrain(){var g,t;return(t=(g=this.terrain)===null||g===void 0?void 0:g.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const g=this.style&&this.style.tileManagers;for(const t of Object.values(g))if(!t.areTilesLoaded())return!1;return!0}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}setSourceTileLodParams(g,t,a){if(a){const c=this.getSource(a);if(!c)throw new Error(`There is no source with ID "${a}", cannot set LOD parameters`);c.calculateTileZoom=Wt(Math.max(1,g),Math.max(1,t))}else for(const c in this.style.tileManagers)this.style.tileManagers[c].getSource().calculateTileZoom=Wt(Math.max(1,g),Math.max(1,t));return this._update(!0),this}refreshTiles(g,t){const a=this.style.tileManagers[g];if(!a)throw new Error(`There is no tile manager with ID "${g}", cannot refresh tile`);t===void 0?a.reload(!0):a.refreshTiles(t.map((c=>new u.ac(c.z,c.x,c.y))))}addImage(g,t,a={}){const{pixelRatio:c=1,sdf:f=!1,stretchX:v,stretchY:b,content:C,textFitWidth:z,textFitHeight:O}=a;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||u.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new u.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:U,height:H,data:q}=t,Q=t;return this.style.addImage(g,{data:new u.R({width:U,height:H},new Uint8Array(q)),pixelRatio:c,stretchX:v,stretchY:b,content:C,textFitWidth:z,textFitHeight:O,sdf:f,version:0,userImage:Q}),Q.onAdd&&Q.onAdd(this,g),this}}{const{width:U,height:H,data:q}=Se.getImageData(t);this.style.addImage(g,{data:new u.R({width:U,height:H},q),pixelRatio:c,stretchX:v,stretchY:b,content:C,textFitWidth:z,textFitHeight:O,sdf:f,version:0})}}updateImage(g,t){const a=this.style.getImage(g);if(!a)return this.fire(new u.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const c=t instanceof HTMLImageElement||u.b(t)?Se.getImageData(t):t,{width:f,height:v,data:b}=c;if(f===void 0||v===void 0)return this.fire(new u.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(f!==a.data.width||v!==a.data.height)return this.fire(new u.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const C=!(t instanceof HTMLImageElement||u.b(t));return a.data.replace(b,C),this.style.updateImage(g,a),this}getImage(g){return this.style.getImage(g)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new u.k(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g){return Ft.getImage(this._requestManager.transformRequest(g,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(g,t){return this._lazyInitEmptyStyle(),this.style.addLayer(g,t),this._update(!0)}moveLayer(g,t){return this.style.moveLayer(g,t),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(g,t,a){return this.style.setLayerZoomRange(g,t,a),this._update(!0)}setFilter(g,t,a={}){return this.style.setFilter(g,t,a),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,t,a,c={}){return this.style.setPaintProperty(g,t,a,c),this._update(!0)}getPaintProperty(g,t){return this.style.getPaintProperty(g,t)}setLayoutProperty(g,t,a,c={}){return this.style.setLayoutProperty(g,t,a,c),this._update(!0)}getLayoutProperty(g,t){return this.style.getLayoutProperty(g,t)}setGlyphs(g,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,t,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,t,a,(c=>{c||this._update(!0)})),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,t,(a=>{a||this._update(!0)})),this}setLight(g,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(g,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(g,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(g,t){return this.style.setFeatureState(g,t),this._update()}removeFeatureState(g,t){return this.style.removeFeatureState(g,t),this._update()}getFeatureState(g){return this.style.getFeatureState(g)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let g=0,t=0;return this._container&&(g=this._container.clientWidth||400,t=this._container.clientHeight||300),[g,t]}_setupResizeObserver(){var g;let t=!1;const a=Yh((f=>{this._trackResize&&!this._removed&&(this.resize(f),this.redraw())}),50),c=(g=this._ownerWindow.ResizeObserver)!==null&&g!==void 0?g:ResizeObserver;this._resizeObserver=new c((f=>{t?a(f):t=!0})),this._resizeObserver.observe(this._container)}_resolveContainer(g){if(typeof g=="string"){const t=document.getElementById(g);if(!t)throw new Error(`Container '${g}' not found.`);return t}if(g instanceof HTMLElement||g&&typeof g=="object"&&g.nodeType===1)return g;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){const g=this._container;g.classList.add("maplibregl-map");const t=this._canvasContainer=ve.create("div","maplibregl-canvas-container",g);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=ve.create("canvas","maplibregl-canvas",t),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 a=this._containerDimensions(),c=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],c);const f=this._controlContainer=ve.create("div","maplibregl-control-container",g),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((b=>{v[b]=ve.create("div",`maplibregl-ctrl-${b} `,f)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(g,t,a){this._canvas.width=Math.floor(a*g),this._canvas.height=Math.floor(a*t),this._canvas.style.width=`${g}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const g=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let t=null;this._canvas.addEventListener("webglcontextcreationerror",(c=>{t={requestedAttributes:g},c&&(t.statusMessage=c.statusMessage,t.type=c.type)}),{once:!0});let a=null;if(a=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,g):this._canvas.getContext("webgl2",g)||this._canvas.getContext("webgl",g),!a){const c="Failed to initialize WebGL";throw t?(t.message=c,new Error(JSON.stringify(t))):new Error(c)}this.painter=new Gd(a,this.transform),lt.testSupport(a)}migrateProjection(g,t){super.migrateProjection(g,t),this.painter.transform=g,this.fire(new u.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(g){return this._update(),this._renderTaskQueue.add(g)}_cancelRenderFrame(g){this._renderTaskQueue.remove(g)}_render(g){var t,a,c,f,v;const b=this._idleTriggered?this._fadeDuration:0,C=((t=this.style.projection)===null||t===void 0?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let z=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const H=this.transform.zoom,q=Te();this.style.zoomHistory.update(H,q);const Q=new u.H(H,{now:q,fadeDuration:b,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),re=Q.crossFadingFactor();re===1&&re===this._crossFadingFactor||(z=!0,this._crossFadingFactor=re),this.style.update(Q)}const O=((a=this.style.projection)===null||a===void 0?void 0:a.transitionState)>0!==C;(c=this.style.projection)===null||c===void 0||c.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((f=this.style.projection)===null||f===void 0?void 0:f.transitionState,(v=this.style.projection)===null||v===void 0?void 0:v.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||O)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.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,b,this._crossSourceCollisions,O),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:b,showPadding:this.showPadding}),this.fire(new u.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.cH.mark(u.cI.load),this.fire(new u.l("load"))),this.style&&(this.style.hasTransitions()||z)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const U=this._sourcesDirty||this._styleDirty||this._placementDirty;return U||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.l("idle")),!this._loaded||this._fullyLoaded||U||(this._fullyLoaded=!0,u.cH.mark(u.cI.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var g;this._hash&&this._hash.remove();for(const a of this._controls)a.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"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Ft.removeThrottleControl(this._imageQueueHandle),(g=this._resizeObserver)===null||g===void 0||g.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ve.remove(this._canvasContainer),ve.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),u.cH.clearMetrics(),this._removed=!0,this.fire(new u.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Se.frame(this._frameRequest,(g=>{u.cH.frame(g),this._frameRequest=null;try{this._render(g)}catch(t){if(!u.Z(t)&&!(function(a){return a.message===B})(t))throw t}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(g){this._showTileBoundaries!==g&&(this._showTileBoundaries=g,this._update())}get showPadding(){return!!this._showPadding}set showPadding(g){this._showPadding!==g&&(this._showPadding=g,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(g){this._showCollisionBoxes!==g&&(this._showCollisionBoxes=g,g?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(g){this._showOverdrawInspector!==g&&(this._showOverdrawInspector=g,this._update())}get repaint(){return!!this._repaint}set repaint(g){this._repaint!==g&&(this._repaint=g,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(g){this._vertices=g,this._update()}get version(){return _u}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(g){return this._lazyInitEmptyStyle(),this.style.setProjection(g),this._update(!0)}},T.MapMouseEvent=Er,T.MapTouchEvent=Js,T.MapWheelEvent=fh,T.Marker=Fc,T.NavigationControl=class{constructor(g){this._updateZoomButtons=()=>{const t=this._map.getZoom(),a=t===this._map.getMaxZoom(),c=t===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=c,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",c.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=(t,a)=>{const c=this._map._getUIString(`NavigationControl.${a}`);t.title=c,t.setAttribute("aria-label",c)},this.options=u.e({},Jh,g),this._container=ve.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),ve.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),ve.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=ve.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(g){return this._map=g,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 Ln(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ve.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(g,t){const a=ve.create("button",g,this._container);return a.type="button",a.addEventListener("click",t),a}},T.Popup=class extends u.E{constructor(g){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&ve.remove(this._content),this._container&&(ve.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 u.l("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ve.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ve.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const b of this.options.className.split(" "))this._container.classList.add(b);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=tc(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;const a=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let c=this.options.anchor;const f=nc(this.options.offset);if(!c){const b=this._container.offsetWidth,C=this._container.offsetHeight,z=(function(U){var H,q,Q,re;return U?{top:(H=U.top)!==null&&H!==void 0?H:0,right:(q=U.right)!==null&&q!==void 0?q:0,bottom:(Q=U.bottom)!==null&&Q!==void 0?Q:0,left:(re=U.left)!==null&&re!==void 0?re:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding);let O;O=a.y+f.bottom.y<C+z.top?["top"]:a.y>this._map.transform.height-C-z.bottom?["bottom"]:[],a.x<b/2+z.left?O.push("left"):a.x>this._map.transform.width-b/2-z.right&&O.push("right"),c=O.length===0?"bottom":O.join("-")}let v=a.add(f[c]);this.options.subpixelPositioning||(v=v.round()),ve.setTransform(this._container,`${ic[c]} translate(${v.x}px,${v.y}px)`),Nc(this._container,c,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(yu),g)}addTo(g){return this._map&&this.remove(),this._map=g,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 u.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=u.V.convert(g),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(g){return this.setDOMContent(document.createTextNode(g))}setHTML(g){const t=document.createDocumentFragment(),a=document.createElement("body");let c;for(a.innerHTML=g;c=a.firstChild,c;)t.appendChild(c);return this.setDOMContent(t)}getMaxWidth(){var g;return(g=this._container)===null||g===void 0?void 0:g.style.maxWidth}setMaxWidth(g){return this.options.maxWidth=g,this._update(),this}setDOMContent(g){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ve.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){return this._container&&this._container.classList.add(g),this}removeClassName(g){return this._container&&this._container.classList.remove(g),this}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}setSubpixelPositioning(g){this.options.subpixelPositioning=g}setPadding(g){this.options.padding=g,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=ve.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 g=this._container.querySelector(vu);
vendor: 2,258 bytes, line 829
829g&&g.focus()}},T.RasterDEMTileSource=ia,T.RasterTileSource=js,T.ScaleControl=class{constructor(g){this._onMove=()=>{jn(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,jn(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Kr),g)}getDefaultPosition(){return"bottom-left"}onAdd(g){return this._map=g,this._container=ve.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ve.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},T.ScrollZoomHandler=kc,T.Style=bs,T.TerrainControl=class{constructor(g){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=g}onAdd(g){return this._map=g,this._container=ve.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ve.create("button","maplibregl-ctrl-terrain",this._container),ve.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ve.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},T.TwoFingersTouchPitchHandler=pl,T.TwoFingersTouchRotateHandler=Ic,T.TwoFingersTouchZoomHandler=No,T.TwoFingersTouchZoomRotateHandler=mu,T.VectorTileSource=mo,T.VideoSource=Ha,T.addSourceType=(g,t)=>u._(void 0,void 0,void 0,(function*(){if(Al(g))throw new Error(`A source type called "${g}" already exists.`);((a,c)=>{ms[a]=c})(g,t)})),T.clearPrewarmedResources=function(){const g=ri;
vendor: 1,088 bytes, line 829
829g&&(g.isPreloaded()&&g.numActive()===1?(g.release(Pt),ri=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()"))},T.createTileMesh=Vu,T.getMaxParallelImageRequests=function(){return u.c.MAX_PARALLEL_IMAGE_REQUESTS},T.getRTLTextPluginStatus=function(){return ae().getRTLTextPluginStatus()},T.getVersion=function(){return ro},T.getWorkerCount=function(){return St.workerCount},T.getWorkerUrl=function(){return u.c.WORKER_URL},T.importScriptInWorkers=function(g){return Ur().broadcast("IS",g)},T.isTimeFrozen=function(){return Ie.isFrozen()},T.now=Te,T.prewarm=function(){Wi().acquire(Pt)},T.restoreNow=function(){Ie.restoreNow()},T.setMaxParallelImageRequests=function(g){u.c.MAX_PARALLEL_IMAGE_REQUESTS=g},T.setNow=function(g){Ie.setNow(g)},T.setRTLTextPlugin=function(g,t){return ae().setRTLTextPlugin(g,t)},T.setWorkerCount=function(g){St.workerCount=g},T.setWorkerUrl=function(g){u.c.WORKER_URL=g}}));var E=D;return E}))}
829)(vg)),vg.exports}var nb=yg.exports,fy;function rb(){return fy||(fy=1,(function(j,P){(function(D,R){j.exports=R(Oy(),ib())})(typeof globalThis<"u"?globalThis:nb||self,function(D,R){D.MaplibreGL=D.Layer.extend({options:{updateInterval:32,padding:.1,interactive:!1,pane:"tilePane"},initialize:function(N){D.setOptions(this,N),this._throttledUpdate=D.Util.throttle(this._update,this.options.updateInterval,this)},onAdd:function(N){this._container||this._initContainer();var E=this.getPaneName();N.getPane(E).appendChild(this._container),this._initGL(),this._offset=this._map.containerPointToLayerPoint([0,0]),N.options.zoomAnimation&&D.DomEvent.on(N._proxy,D.DomUtil.TRANSITION_END,this._transitionEnd,this)},onRemove:function(N){this._map._proxy&&this._map.options.zoomAnimation&&D.DomEvent.off(this._map._proxy,D.DomUtil.TRANSITION_END,this._transitionEnd,this);var E=this.getPaneName();N.getPane(E).removeChild(this._container),this._glMap.remove(),this._glMap=null},getEvents:function(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize}},getAttribution:function(){if(this.options.attributionControl)return this.options.attributionControl.customAttribution;var N=this._glMap;
829if(N&&this.options.attributionControl!==!1){var E=N.getStyle();if(E&&E.sources)return Object.keys(E.sources).map(function(T){var u=N.getSource(T);return u&&typeof u.attribution=="string"?u.attribution.trim():null}).filter(Boolean).join(", ")}return""},getMaplibreMap:function(){return this._glMap},getCanvas:function(){return this._glMap.getCanvas()},getSize:function(){return this._map.getSize().multiplyBy(1+this.options.padding*2)},getBounds:function(){var N=this.getSize().multiplyBy(.5),E=this._map.latLngToContainerPoint(this._map.getCenter());return D.latLngBounds(this._map.containerPointToLatLng(E.subtract(N)),this._map.containerPointToLatLng(E.add(N)))},getContainer:function(){return this._container},getPaneName:function(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},_roundPoint:function(N){return{x:Math.round(N.x),y:Math.round(N.y)}},_initContainer:function(){var N=this._container=D.DomUtil.create("div","leaflet-gl-layer");this._resizeContainer();var E=this._map.getSize().multiplyBy(this.options.padding),T=this._map.containerPointToLayerPoint([0,0]).subtract(E);D.DomUtil.setPosition(N,this._roundPoint(T))},_resizeContainer:function(){var N=this.getSize();this._container.style.width=N.x+"px",this._container.style.height=N.y+"px"},_initGL:function(){var N=this._map.getCenter(),E=D.extend({},this.options,{container:this._container,center:[N.lng,N.lat],zoom:this._map.getZoom()-1,attributionControl:!1});this._glMap=new R.Map(E);var T=this._map,u=this.getAttribution(),V=this.getAttribution.bind(this);this._glMap.on("load",function(){T&&T.attributionControl&&(T.attributionControl.removeAttribution(u),T.attributionControl.addAttribution(V()))});var X=Object.getPrototypeOf(this._glMap.transform),ce=Object.getOwnPropertyDescriptor(X,"latRange");(!ce||ce.set||ce.writable)&&(this._glMap.transform.latRange=null);var ne=Object.getOwnPropertyDescriptor(X,"maxValidLatitude");(!ne||ne.set||ne.writable)&&(this._glMap.transform.maxValidLatitude=1/0),this._glMap.transform._helper&&this._glMap.transform._helper._latRange&&(this._glMap.transform._helper._latRange=[-1/0,1/0]),this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas;var ye=this._glMap._actualCanvas;D.DomUtil.addClass(ye,"leaflet-image-layer"),D.DomUtil.addClass(ye,"leaflet-zoom-animated"),this.options.interactive&&D.DomUtil.addClass(ye,"leaflet-interactive"),this.options.className&&D.DomUtil.addClass(ye,this.options.className)},_update:function(N){if(this._map&&(this._offset=this._map.containerPointToLayerPoint([0,0]),!this._zooming)){var E=this._container,T=this._glMap,u=this._map.getSize().multiplyBy(this.options.padding),V=this._map.containerPointToLayerPoint([0,0]).subtract(u);D.DomUtil.setPosition(E,this._roundPoint(V)),this._transformGL(T)}},_transformGL:function(N){var E=this._map.getCenter(),T=N._getTransformForUpdate();T.setCenter?(T.setCenter(R.LngLat.convert([E.lng,E.lat])),T.setZoom(this._map.getZoom()-1),N.transform.apply(T)):(T=N.transform,T.center=R.LngLat.convert([E.lng,E.lat]),T.zoom=this._map.getZoom()-1),N._fireMoveEvents()},_pinchZoom:function(N){this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom:function(N){var E=this._map.getZoomScale(N.zoom),T=this._map.getSize().multiplyBy(this.options.padding*E),u=this.getSize()._divideBy(2),V=this._map.project(N.center,N.zoom)._subtract(u)._add(this._map._getMapPanePos().add(T))._round(),X=this._map.project(this._map.getBounds().getNorthWest(),N.zoom)._subtract(V);D.DomUtil.setTransform(this._glMap._actualCanvas,X.subtract(this._offset),E)},_zoomStart:function(N){this._zooming=!0},_zoomEnd:function(){var N=this._map.getZoomScale(this._map.getZoom());D.DomUtil.setTransform(this._glMap._actualCanvas,null,N),this._zooming=!1,this._update()},_transitionEnd:function(N){D.Util.requestAnimFrame(function(){var E=this._map.getZoom(),T=this._map.getCenter(),u=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());this._resizeContainer(),D.DomUtil.setTransform(this._glMap._actualCanvas,u,1),this._glMap.once("moveend",D.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:T,zoom:E-1})},this)},_resize:function(N){this._transitionEnd(N)}}),D.maplibreGL=function(N){return new D.MaplibreGL(N)}})})(yg)),yg.exports}rb();function ab({styleUrl:j}){const P=Pg(),D=Qe.useRef(null);return Qe.useEffect(()=>{D.current&&(P.removeLayer(D.current),D.current=null);const R=ih.maplibreGL({style:j,interactive:!1});return R.addTo(P),D.current=R,()=>{D.current&&(P.removeLayer(D.current),D.current=null)}},[P,j]),null}const f_=[{id:"lightbasemap",labelKey:"layers.light",type:"vector",styleUrl:"https://vectortiles.geo.admin.ch/styles/ch.swisstopo.lightbasemap.vt/style.json",preview:"✨"},{id:"pixelkarte-farbe",labelKey:"layers.color",type:"raster",url:"https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857
829/{z}/{x}/{y}.jpeg",maxNativeZoom:18,preview:"🗺️"},{id:"pixelkarte-grau",labelKey:"layers.grey",type:"raster",url:"https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-grau/default/current/3857/{z}/{x}/{y}.jpeg",maxNativeZoom:18,preview:"🌫️"},{id:"swissimage",labelKey:"layers.satellite",type:"raster",url:"https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/{z}/{x}/{y}.jpeg",maxNativeZoom:20,preview:"🛰️"}];function sb({activeLayerId:j,onLayerChange:P}){const{t:D}=qa(),[R,N]=Qe.useState(!1);return te.jsxs("div",{className:`layer-switcher ${R?"layer-switcher--open":""}`,children:[te.jsx("button",{className:"layer-switcher-toggle",onClick:()=>N(!R),title:D("layers.title"),children:te.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[te.jsx("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),te.jsx("polyline",{points:"2 17 12 22 22 17"}),te.jsx("polyline",{points:"2 12 12 17 22 12"})]})}),R&&te.jsx("div",{className:"layer-switcher-backdrop",onClick:()=>N(!1)}),R&&te.jsx("div",{className:"layer-switcher-panel",children:f_.map(E=>te.jsxs("button",{className:`layer-switcher-option ${E.id===j?"layer-switcher-option--active":""}`,onClick:()=>{P(E.id),N(!1)},children:[te.jsx("span",{className:"layer-switcher-preview",children:E.preview}),te.jsx("span",{className:"layer-switcher-label",children:D(E.labelKey)})]},E.id))})]})}const _g=th.cerasifera;function ob({activeFilters:j,onFilterChange:P,counts:D,lang:R,bloomFilterActive:N,showCherryPlums:E,onToggleCherryPlums:T,cherryPlumCount:u}){const[V,X]=Qe.useState(!1),ce=new Date,ne=Qf.every(Te=>j.has(Te)),ye=Qf.filter(Te=>j.has(Te)).length;function Se(Te){const ve=new Set(j);ve.has(Te)?ve.delete(Te):ve.add(Te),P(ve)}function Ie(){P(ne?new Set:new Set(Qf))}return te.jsxs(te.Fragment,{children:[te.jsxs("button",{className:`filter-toggle ${V?"filter-toggle--open":""} ${ne?"":"filter-toggle--filtered"}`,onClick:()=>X(!V),title:R==="de"?"Arten filtern":"Filter species",children:[te.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:te.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),!ne&&te.jsx("span",{className:"filter-toggle-badge",children:ye})]}),V&&te.jsx("div",{className:"filter-backdrop",onClick:()=>X(!1)}),V&&te.jsxs("div",{className:"filter-panel",children:[te.jsxs("div",{className:"filter-panel-header",children:[te.jsx("span",{className:"filter-panel-title",children:R==="de"?"Arten":"Species"}),te.jsx("button",{className:"filter-panel-toggle-all",onClick:Ie,children:ne?R==="de"?"Keine":"None":R==="de"?"Alle":"All"})]}),te.jsx("div",{className:"filter-panel-list",children:Qf.map(Te=>{const ve=th[Te],lt=j.has(Te),Tt=D[Te]||0,dt=N&&!dm(Te,ce);return te.jsxs("button",{className:`filter-item ${lt?"filter-item--active":"filter-item--inactive"}${dt?" filter-item--dimmed":""}`,onClick:()=>Se(Te),children:[te.jsx("span",{className:"filter-item-dot",style:{background:lt?ve.color:"transparent",borderColor:ve.color==="#FFFFFF"?"#ccc":ve.color}}),te.jsx("span",{className:"filter-item-label",children:ve[R]?.name||ve.en?.name||Te}),te.jsx("span",{className:"filter-item-count",children:Tt})]},Te)})}),te.jsx("div",{className:"filter-panel-divider"}),te.jsx("div",{className:"filter-panel-section-label",children:R==="de"?"Weitere Blüher":"More blossoms"}),te.jsx("div",{className:"filter-panel-list",children:te.jsxs("button",{className:`filter-item ${E?"filter-item--active":"filter-item--inactive"}`,onClick:T,children:[te.jsx("span",{className:"filter-item-dot",style:{background:E?_g.color:"transparent",borderColor:_g.color}}),te.jsx("span",{className:"filter-item-label",children:_g[R]?.name||_g.en.name}),te.jsx("span",{className:"filter-item-count",children:u||"318"})]})})]})]})}function lb(j){if(!j||j.length<2)return null;const P=`${j[0].lat},${j[0].lng}`,D=`${j[j.length-1].lat},${j[j.length-1].lng}`,N=j.slice(1,-1).slice(0,8).map(T=>`${T.lat},${T.lng}`).join("|");let E=`https://www.google.com/maps/dir/?api=1&origin=${P}
829&destination=${D}&travelmode=walking`;return N&&(E+=`&waypoints=${N}`),E}function ub({activeRoute:j,onClearRoute:P,lang:D}){const{t:R}=qa();if(!j)return null;const N=j.routeName,E=N?N[D]||N.de:null,T=lb(j.waypoints);return te.jsxs("div",{className:"active-walk-bar",children:[te.jsxs("div",{className:"active-walk-info",children:[te.jsx("div",{className:"active-walk-name",children:E?.name||R("walk.activeWalk")}),te.jsxs("div",{className:"active-walk-meta",children:[te.jsx("span",{children:R("routes.trees",{count:N?.treeCount||0})}),te.jsx("span",{className:"active-walk-sep",children:"|"}),te.jsx("span",{children:R("routes.length",{length:N?.estimatedMinutes||0})}),j.distance>0&&te.jsxs(te.Fragment,{children:[te.jsx("span",{className:"active-walk-sep",children:"|"}),te.jsx("span",{children:R("walk.distance",{km:(j.distance/1e3).toFixed(1)})})]})]})]}),te.jsxs("div",{className:"active-walk-actions",children:[T&&te.jsxs("a",{className:"active-walk-navigate",href:T,target:"_blank",rel:"noopener noreferrer",children:[te.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:te.jsx("polygon",{points:"3 11 22 2 13 21 11 13 3 11"})}),R("walk.openMaps")]}),te.jsx("button",{className:"active-walk-end",onClick:P,children:R("walk.endWalk")})]})]})}const cb=[47.378,8.535],hb=[[47.3,8.44],[47.45,8.62]];function db({trees:j,userPosition:P,activeRoute:D,activeRouteId:R,mapRef:N,lang:E,heatmapVisible:T,onHeatmapToggle:u,highlightedTreeId:V,activeFilters:X,onFilterChange:ce,counts:ne,bloomFilterActive:ye,showCherryPlums:Se,onToggleCherryPlums:Ie,cherryPlumTrees:Te,showRoutePreview:ve,onSelectRoute:lt,onClearRoute:Tt}){const[dt,Bt]=Qe.useState("lightbasemap"),Vt=f_.find(ui=>ui.id===dt)||f_[0];return te.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[te.jsxs(Sx,{center:cb,zoom:13,minZoom:11,maxZoom:19,maxBounds:hb,zoomControl:!1,attributionControl:!1,className:"map-container",ref:N,children:[Vt.type==="vector"?te.jsx(ab,{styleUrl:Vt.styleUrl},Vt.id):te.jsx(Ex,{attribution:'© <a href="https://www.swisstopo.admin.ch">swisstopo</a> | Daten: Stadt Zürich (CC-0)',url:Vt.url,maxNativeZoom:Vt.maxNativeZoom},Vt.id),te.jsx(Px,{position:"bottomright"}),T&&te.jsx(eb,{trees:j}),ve&&te.jsx(Jx,{onSelectRoute:lt,activeRouteId:R,lang:E}),te.jsx($x,{trees:j,lang:E,highlightedTreeId:V,showCherryPlums:Se,cherryPlumTrees:Te}),P&&te.jsx(Xx,{position:P}),D&&te.jsx(Kx,{route:D,lang:E})]}),te.jsxs("div",{className:"map-controls-right",children:[te.jsx(ob,{activeFilters:X,onFilterChange:ce,counts:ne,lang:E,bloomFilterActive:ye,showCherryPlums:Se,onToggleCherryPlums:Ie,cherryPlumCount:Te.length}),te.jsx(sb,{activeLayerId:dt,onLayerChange:Bt}),te.jsx("button",{className:`heatmap-toggle ${T?"heatmap-toggle--active":""}`,onClick:u,title:T?"Hide heatmap":"Show heatmap",children:te.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[te.jsx("circle",{cx:"12",cy:"12",r:"10",opacity:"0.3"}),te.jsx("circle",{cx:"12",cy:"12",r:"6",opacity:"0.5"}),te.jsx("circle",{cx:"12",cy:"12",r:"2"})]})})]}),te.jsx(ub,{activeRoute:D,onClearRoute:Tt,lang:E}),te.jsxs("div",{className:"map-attribution",children:["© ",te.jsx("a",{href:"https://www.swisstopo.admin.ch",target:"_blank",rel:"noopener noreferrer",children:"swisstopo"})]})]})}function fb({geo:j,nearestTrees:P,onShowTree:D,lang:R}){const{t:N}=qa();return te.jsxs("div",{className:"nearest-panel",children:[j.active?te.jsx("button",{className:"nearest-btn nearest-btn--stop",onClick:j.stop,children:N("nearest.stopLocation")}):te.jsx("button",{className:"nearest-btn",onClick:j.start,children:N("nearest.findNearest")}),j.loading&&te.jsx("p",{className:"nearest-status",children:N("nearest.loading")}),j.error&&te.jsx("p",{className:"nearest-status nearest-status--error",children:j.error}),P.length>0&&te.jsx("div",{className:"nearest-list",children:P.map(({feature:E,distance:T})=>{const u=E.properties,V=th[u.category],X=V?.[R]||V?.de,[ce,ne]=E.geometry.coordinates;return te.jsxs("div",{className:"nearest-item",children:[te.jsxs("div",{className:"nearest-item-header",children:[te.jsx("span",{className:"species-dot",style:{background:V?.color||"#FF69B4",borderColor:V?.color==="#FFFFFF"?"#ccc":V?.color}}),te.jsx("span",{className:"nearest-item-name",children:X?.name||u.baumnamedeu}),te.jsx("span",{className:"nearest-item-distance",children:N("nearest.distance",{distance:Math.round(T)})})]}),te.jsxs("div",{className:"nearest-item-location",children:[u.strasse,", ",u.quartier]}),te.jsxs("div",{className:"nearest-item-actions",children:[te.jsx("button",{className:"nearest-action",onClick:()=>D(E),children:N("nearest.showOnMap")}),te.jsx("a",{className:"nearest-action",href:`https://www.google.com/maps/dir/?api=1&destination=${ne},${ce}&travelmode=walking`,target:"_blank",rel:"noopener noreferrer",children:N("nearest.
829navigate")})]})]},u.id)})})]})}function py(j,P,D,R){const E=(D-j)*Math.PI/180,T=(R-P)*Math.PI/180,u=Math.sin(E/2)**2+Math.cos(j*Math.PI/180)*Math.cos(D*Math.PI/180)*Math.sin(T/2)**2;return 6371e3*2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function my(j){const P=j.waypoints,D=P.reduce((N,E)=>N+E.lat,0)/P.length,R=P.reduce((N,E)=>N+E.lng,0)/P.length;return{lat:D,lng:R}}function pb({onSelectRoute:j,onClearRoute:P,activeRouteId:D,lang:R,userPosition:N,onRequestLocation:E}){const{t:T}=qa(),[u,V]=Qe.useState("popular");function X(){!N&&E&&E(),V("nearby")}const ce=Qe.useMemo(()=>{const ne=[...hm];return u==="trees"?ne.sort((ye,Se)=>Se.treeCount-ye.treeCount):u==="nearby"&&N?ne.sort((ye,Se)=>{const Ie=my(ye),Te=my(Se),ve=py(N.lat,N.lng,Ie.lat,Ie.lng),lt=py(N.lat,N.lng,Te.lat,Te.lng);return ve-lt}):ne.sort((ye,Se)=>(ye.popular||99)-(Se.popular||99)),ne},[u,N]);return te.jsxs("div",{className:"routes-panel",children:[te.jsxs("div",{className:"routes-sort",children:[te.jsx("button",{className:`routes-sort-btn ${u==="popular"?"routes-sort-btn--active":""}`,onClick:()=>V("popular"),children:T("routes.sortPopular")}),te.jsx("button",{className:`routes-sort-btn ${u==="nearby"?"routes-sort-btn--active":""}`,onClick:X,children:T("routes.sortNearby")}),te.jsx("button",{className:`routes-sort-btn ${u==="trees"?"routes-sort-btn--active":""}`,onClick:()=>V("trees"),children:T("routes.sortTrees")})]}),ce.map(ne=>{const ye=ne[R]||ne.de,Se=D===ne.id,Ie=`${window.location.origin}${window.location.pathname}#route=${ne.id}`;return te.jsxs("div",{className:`route-card ${Se?"route-card--active":""}`,children:[te.jsx("h3",{className:"route-card-name",children:ye.name}),te.jsx("p",{className:"route-card-desc",children:ye.description}),te.jsx("div",{className:"route-card-tags",children:(ne.tags||[]).map(Te=>{const ve=Qx[Te];return ve?te.jsx("span",{className:"route-tag",title:ve[R]||ve.de,children:ve.emoji},Te):null})}),te.jsxs("div",{className:"route-card-meta",children:[te.jsx("span",{children:T("routes.trees",{count:ne.treeCount})}),te.jsx("span",{children:T("routes.length",{length:ne.estimatedMinutes})})]}),te.jsxs("div",{className:"route-card-actions",children:[Se?te.jsx("button",{className:"route-btn route-btn--clear",onClick:P,children:T("routes.endWalk")}):te.jsx("button",{className:"route-btn",onClick:()=>j(ne),children:T("routes.startWalk")}),te.jsx(jy,{url:Ie,title:ye.name})]})]},ne.id)})]})}const mb={City:1,Enge:2,Wollishofen:2,Leimbach:2,"Alt-Wiedikon":3,Friesenberg:3,Sihlfeld:3,Werd:4,Langstrasse:4,Hard:4,Gewerbeschule:5,Unterstrass:6,Oberstrass:6,Fluntern:7,Hottingen:7,Hirslanden:7,Witikon:7,Seefeld:8,Mühlebach:8,Weinegg:8,Albisrieden:9,Altstetten:9,Höngg:10,Wipkingen:10,Affoltern:11,Oerlikon:11,Seebach:11,"Schwamendingen-Mitte":11,Hirzenbach:12,Saatlen:12},gb={1:"Kreis 1 — Altstadt",2:"Kreis 2 — Enge / Wollishofen",3:"Kreis 3 — Wiedikon",4:"Kreis 4 — Aussersihl",5:"Kreis 5 — Industriequartier",6:"Kreis 6 — Unterstrass / Oberstrass",7:"Kreis 7 — Fluntern / Hottingen / Witikon",8:"Kreis 8 — Riesbach",9:"Kreis 9 — Albisrieden / Altstetten",10:"Kreis 10 — Höngg / Wipkingen",11:"Kreis 11 — Affoltern / Oerlikon / Seebach",12:"Kreis 12 — Schwamendingen"};function _b(j){if(!j.length)return[];const P=j.filter(Ie=>Ie.properties.pflanzjahr&&Ie.properties.pflanzjahr>1800),D=j.filter(Ie=>Ie.properties.kronendurchmesser>0),R=P.length?P.reduce((Ie,Te)=>Ie.properties.pflanzjahr<Te.properties.pflanzjahr?Ie:Te):null,N=P.length?P.reduce((Ie,Te)=>Ie.properties.pflanzjahr>Te.properties.pflanzjahr?Ie:Te):null,E=D.length?D.reduce((Ie,Te)=>Ie.properties.kronendurchmesser>Te.properties.kronendurchmesser?Ie:Te):null,T=D.length?D.reduce((Ie,Te)=>Ie.properties.kronendurchmesser<Te.properties.kronendurchmesser?Ie:Te):null,u=j.length>200?j.filter((Ie,Te)=>Te%Math.ceil(j.length/200)===0):j;let V=null,X=0;for(const Ie of u){const[Te,ve]=Ie.geometry.coordinates;let lt=1/0;for(const Tt of j){if(Tt===Ie)continue;const[dt,Bt]=Tt.geometry.coordinates,Vt=Math.sqrt((ve-Bt)**2+(Te-dt)**2);Vt<lt&&(lt=Vt)}lt>X&&(X=lt,V=Ie)}const ce={};j.forEach(Ie=>{const Te=Ie.properties.quartier;
829ce[Te]=(ce[Te]||0)+1});const ne=Object.entries(ce).sort((Ie,Te)=>Te[1]-Ie[1])[0],ye={};j.forEach(Ie=>{const Te=Ie.properties.category;ye[Te]=(ye[Te]||0)+1});const Se=Object.entries(ye).sort((Ie,Te)=>Ie[1]-Te[1])[0];return[R&&{id:"oldest",emoji:"🏆",tree:R,value:R.properties.pflanzjahr},N&&{id:"youngest",emoji:"🌱",tree:N,value:N.properties.pflanzjahr},E&&{id:"biggest",emoji:"🌳",tree:E,value:`${E.properties.kronendurchmesser} m`},T&&{id:"smallest",emoji:"🌿",tree:T,value:`${T.properties.kronendurchmesser} m`},V&&{id:"loneliest",emoji:"🏝️",tree:V,value:`${Math.round(X*111e3)} m`},ne&&{id:"topQuartier",emoji:"🏘️",tree:null,value:`${ne[0]} (${ne[1]})`},Se&&{id:"rareSpecies",emoji:"💎",tree:null,value:`${Se[1]}`,speciesName:Se[0]}].filter(Boolean)}function yb({allTrees:j,onShowTree:P,lang:D}){const{t:R}=qa(),[N,E]=Qe.useState("all"),T=Qe.useMemo(()=>{const X=j||[];if(N==="all")return X;const ce=Number(N);return X.filter(ne=>mb[ne.properties.quartier]===ce)},[j,N]),u=T.length,V=Qe.useMemo(()=>_b(T),[T]);return te.jsxs("div",{className:"quartett",children:[te.jsx("p",{className:"quartett-intro",children:R("entdecken.quartettIntro")}),te.jsxs("div",{className:"quartett-filter",children:[te.jsxs("select",{value:N,onChange:X=>E(X.target.value),className:"quartett-select",children:[te.jsx("option",{value:"all",children:R("entdecken.allCity")}),Object.entries(gb).map(([X,ce])=>te.jsx("option",{value:X,children:ce},X))]}),te.jsx("span",{className:"quartett-count",children:R("filter.treeCount",{count:u})})]}),V.length>0?te.jsx("div",{className:"quartett-grid",children:V.map(X=>te.jsxs("div",{className:`quartett-card ${X.tree?"quartett-card--clickable":""}`,onClick:()=>X.tree&&P(X.tree),children:[te.jsx("div",{className:"quartett-card-emoji",children:X.emoji}),te.jsxs("div",{className:"quartett-card-info",children:[te.jsx("div",{className:"quartett-card-title",children:R(`entdecken.${X.id}`)}),te.jsx("div",{className:"quartett-card-value",children:X.value}),X.tree&&te.jsx("div",{className:"quartett-card-location",children:X.tree.properties.strasse}),X.tree&&te.jsx("div",{className:"quartett-card-species",children:X.tree.properties.baumnamedeu}),X.speciesName&&te.jsx("div",{className:"quartett-card-species",children:X.speciesName})]})]},X.id))}):te.jsx("p",{className:"quartett-empty",children:R("entdecken.noTreesInKreis")})]})}const Gy="cherryblossom_bingo";function vb(){try{return JSON.parse(localStorage.getItem(Gy))||{}}catch{return{}}}function gy(j){localStorage.setItem(Gy,JSON.stringify(j))}function xb(j){const P=Object.keys(th).map(N=>({id:`species-${N}`,group:"species",emoji:"🌸",name:j("entdecken.seeSpecies"),target:th[N]?.de?.name||N})),D=hm.map(N=>({id:`route-${N.id}`,group:"routes",emoji:"🚶",name:j("entdecken.walkRoute"),target:N.de.name})),R=[{id:"special-5species",group:"special",emoji:"🏅",name:j("entdecken.fiveSpecies")},{id:"special-allspecies",group:"special",emoji:"🏆",name:j("entdecken.allSpecies")},{id:"special-3routes",group:"special",emoji:"🧭",name:j("entdecken.threeRoutes")},{id:"special-allroutes",group:"special",emoji:"🚀",name:j("entdecken.allRoutes")},{id:"special-photo",group:"special",emoji:"📸",name:j("entdecken.takePhoto")},{id:"special-share",group:"special",emoji:"📤",name:j("entdecken.shareApp")}];return{speciesChallenges:P,routeChallenges:D,specialChallenges:R}}function bb(){const{t:j}=qa(),[P,D]=Qe.useState(vb),R=Qe.useCallback(ye=>{D(Se=>{const Ie={...Se,[ye]:!Se[ye]};return gy(Ie),Ie})},[]),N=Qe.useCallback(()=>{D({}),gy({})},[]),{speciesChallenges:E,routeChallenges:T,specialChallenges:u}=xb(j),V=[...E,...T,...u],X=V.filter(ye=>P[ye.id]).length,ce=V.length,ne=ce>0?Math.round(X/ce*100):0;return te.jsxs("div",{className:"bingo",children:[te.jsxs("div",{className:"bingo-progress",children:[te.jsx("div",{className:"bingo-progress-bar",children:te.jsx("div",{className:"bingo-progress-fill",style:{width:`${ne}%`}})}),te.jsxs("span",{className:"bingo-progress-text",children:[X,"/",ce," (",ne,"%)"]})]}),te.jsxs("div",{className:"bingo-section",children:[te.jsx("h3",{className:"bingo-section-title",children:j("entdecken.bingoSpecial")}),u.map(ye=>te.jsxs("label",{className:`bingo-item ${P[ye.id]?"bingo-item--done":""}`,children:[te.jsx("input",{type:"checkbox",checked:!!P[ye.id],onChange:()=>R(ye.id)}),te.jsx("span",{className:"bingo-item-emoji",children:ye.emoji}),te.jsx("span",{className:"bingo-item-name",children:ye.name})]},ye.id))]}),te.jsxs("div",{className:"bingo-section",children:[te.jsx("h3",{className:"bingo-section-title",children:j("entdecken.bingoSpecies")}),E.map(ye=>te.jsxs("label",{className:`bingo-item ${P[ye.id]?"bingo-item--done":""}`,children:[te.jsx("input",{type:"checkbox",checked:!!P[ye.id],onChange:()=>R(ye.id)}),te.jsx("span",{className:"bingo-item-emoji",children:ye.emoji}),te.jsx("span",{className:"bingo-item-name",children:ye.target})]},ye.id))]}),te.jsxs("div",{className:"bingo-section",children:[te.jsx("h3",{className:"bingo-section-title",children:j("entdecken.bingoRoutes")}),T.map(ye=>te.jsxs("label",{className:`bingo-item ${P[ye.id]?"bingo-item--done":""}`,children:[te.jsx("input",{type:"checkbox",checked:!!P[ye.id],onChange:()=>R(ye.id)}),te.jsx("span",{className:"bingo-item-emoji",children:ye.emoji}),te.jsx("span",{className:"bingo-item-name",children:ye.target})]},ye.id))]}),X>0&&te.jsx("button",{className:"bingo-reset",onClick:N,children:j("entdecken.bingoReset")})]})}const wb="3.0";function Tb({open:j,onClose:P}){const{t:D}=qa();return j?te.jsxs(te.Fragment,{children:[te.jsx("div",{className:"impressum-backdrop",onClick:P}),te.jsxs("div",{className:"impressum-modal",children:[te.jsx("button",{className:"impressum-close",onClick:P,"aria-label":"Close",children:"✕"}),te.jsx("h2",{className:"impressum-title",children:D("impressum.title")}),te.jsxs("div",{className:"impressum-section",children:[te.jsx("h3",{children:D("impressum.operator")}),te.jsxs("p",{children:["sinnhaft GmbH",te.jsx("br",{}
829),"Dufourstrasse 178",te.jsx("br",{}),"8008 Zürich",te.jsx("br",{}),te.jsx("a",{href:"https://www.sinnhaft.ch",target:"_blank",rel:"noopener noreferrer",className:"impressum-link",children:"www.sinnhaft.ch"}),te.jsx("br",{}),te.jsx("a",{href:"https://www.hanami-zh.ch",target:"_blank",rel:"noopener noreferrer",className:"impressum-link",children:"www.hanami-zh.ch"})]})]}),te.jsxs("div",{className:"impressum-section",children:[te.jsx("h3",{children:D("impressum.developer")}),te.jsxs("p",{children:[te.jsx("a",{href:"https://martina-meyer.ch/",target:"_blank",rel:"noopener",className:"impressum-link",children:"Martina Meyer"}),te.jsx("br",{}),te.jsx("a",{href:"https://www.linkedin.com/in/martina-a-meyer/",target:"_blank",rel:"noopener noreferrer",className:"impressum-link",children:"LinkedIn"}),te.jsx("br",{}),te.jsx("a",{href:"https://martina-meyer.ch/blog/designer-ai-was-wir-design-nennen/",target:"_blank",rel:"noopener",className:"impressum-link",children:D("impressum.howBuilt")})]})]}),te.jsxs("div",{className:"impressum-section",children:[te.jsx("h3",{children:D("impressum.contact")}),te.jsx("p",{children:te.jsx("a",{href:"mailto:[email protected]?subject=Hanami%20Zürich",target:"_blank",rel:"noopener noreferrer",className:"impressum-link",children:"[email protected]"})})]}),te.jsxs("div",{className:"impressum-section",children:[te.jsx("h3",{children:D("impressum.version")}),te.jsxs("p",{children:["v",wb]})]}),te.jsxs("div",{className:"impressum-section",children:[te.jsx("h3",{children:D("impressum.dataCredits")}),te.jsxs("ul",{className:"impressum-credits",children:[te.jsxs("li",{children:[te.jsx("strong",{children:D("impressum.treeData")}),te.jsx("br",{}),D("impressum.treeDataDesc")]}),te.jsxs("li",{children:[te.jsx("strong",{children:D("impressum.basemap")}),te.jsx("br",{}),D("impressum.basemapDesc")]}),te.jsxs("li",{children:[te.jsx("strong",{children:D("impressum.routing")}),te.jsx("br",{}),D("impressum.routingDesc")]})]})]}),te.jsxs("div",{className:"impressum-copy",children:["© ",new Date().getFullYear()," sinnhaft GmbH"]})]})]}):null}function Sb({geo:j,nearestTrees:P,onShowTree:D,onSelectRoute:R,onClearRoute:N,activeRouteId:E,allTrees:T,lang:u}){const{t:V,i18n:X}=qa(),ce=X.language?.startsWith("de")?"de":"en",ne=Qe.useCallback(()=>{X.changeLanguage(ce==="de"?"en":"de")},[X,ce]),[ye,Se]=Qe.useState(!1),[Ie,Te]=Qe.useState("routes"),[ve,lt]=Qe.useState(!1),[Tt,dt]=Qe.useState(!1),Bt=Qe.useRef(null),Vt=Qe.useCallback(qt=>{Bt.current=qt.touches[0].clientY},[]),ui=Qe.useCallback(qt=>{if(Bt.current===null)return;qt.changedTouches[0].clientY-Bt.current>80&&Se(!1),Bt.current=null},[]),Ft=Qe.useCallback(qt=>{Se(!1),R(qt)},[R]),vi=Qe.useCallback(qt=>{window.innerWidth<=768&&Se(!1),D(qt)},[D]),Kt=Qe.useCallback(async()=>{const qt="https://hanami-zh.ch/",Ht=V("shareApp.title"),Xt=V("shareApp.text");if(navigator.share)try{await navigator.share({title:Ht,text:Xt,url:qt})}catch{}else{try{await navigator.clipboard.writeText(`${Xt}
830${qt}`)}catch{const si=document.createElement("textarea");si.value=`${Xt}
831${qt}`,si.style.position="fixed",si.style.opacity="0",document.body.appendChild(si),si.select(),document.execCommand("copy"),document.body.removeChild(si)}alert(V("share.copied"))}},[V]);return te.jsxs(te.Fragment,{children:[te.jsx("button",{className:`sidebar-toggle ${ye?"sidebar-toggle--open":""}`,onClick:()=>Se(!ye),"aria-label":ye?"Close sidebar":"Open sidebar",children:ye?te.jsx("span",{className:"sidebar-toggle-icon",children:"✕"}):te.jsxs(te.Fragment,{children:[te.jsx("span",{className:"sidebar-toggle-icon",children:"🌸"}),te.jsx("span",{className:"sidebar-toggle-label",children:V("sidebar.explore")})]})}),ye&&te.jsx("div",{className:"sidebar-backdrop",onClick:()=>Se(!1)}),te.jsxs("div",{className:`sidebar ${ye?"sidebar--open":""}`,onTouchStart:Vt,onTouchEnd:ui,children:[te.jsx("div",{className:"sidebar-drag-handle"}),te.jsxs("div",{className:"sidebar-tabs",children:[te.jsx("button",{className:`sidebar-tab ${Ie==="routes"?"sidebar-tab--active":""}`,onClick:()=>Te("routes"),children:V("routes.title")}),te.jsx("button",{className:`sidebar-tab ${Ie==="nearest"?"sidebar-tab--active":""}`,onClick:()=>Te("nearest"),children:V("nearest.title")}),te.jsx("button",{className:`sidebar-tab ${Ie==="entdecken"?"sidebar-tab--active":""}`,onClick:()=>Te("entdecken"),children:V("entdecken.title")})]}),te.jsxs("div",{className:"sidebar-content",children:[Ie==="nearest"&&te.jsx(fb,{geo:j,nearestTrees:P,onShowTree:vi,lang:u}),Ie==="routes"&&te.jsx(pb,{onSelectRoute:Ft,onClearRoute:N,activeRouteId:E,lang:u,userPosition:j.position,onRequestLocation:j.start}),Ie==="entdecken"&&te.jsxs(te.Fragment,{children:[te.jsx("h3",{className:"entdecken-section-title",children:V("entdecken.quartettTitle")}),te.jsx(yb,{allTrees:T,onShowTree:vi,lang:u}),te.jsx("h3",{className:"entdecken-section-title entdecken-section-title--spaced",children:V("entdecken.bingoTitle")}),te.jsx(bb,{lang:u})]})]}),te.jsxs("div",{className:"sidebar-footer",children:[te.jsx("span",{children:V("footer.dataSource")}),te.jsxs("div",{className:"sidebar-footer-links",children:[te.jsx("button",{className:"sidebar-footer-link",onClick:()=>lt(!0),children:V("footer.impressum")}
831),te.jsx("span",{className:"sidebar-footer-sep",children:"·"}),te.jsx("button",{className:"sidebar-footer-link",onClick:()=>dt(!0),children:V("footer.imageTerms")}),te.jsx("span",{className:"sidebar-footer-sep",children:"·"}),te.jsx("button",{className:"sidebar-footer-link",onClick:Kt,children:V("footer.shareApp")}),te.jsx("span",{className:"sidebar-footer-sep",children:"·"}),te.jsx("button",{className:"sidebar-footer-link",onClick:ne,children:ce==="de"?"English":"Deutsch"})]})]})]}),te.jsx(Tb,{open:ve,onClose:()=>lt(!1)}),te.jsx(Vy,{open:Tt,onClose:()=>dt(!1)})]})}function Cb({treeCount:j,speciesCount:P,routeCount:D,onDismiss:R}){const{t:N}=qa();return te.jsx("div",{className:"welcome-overlay",children:te.jsxs("div",{className:"welcome-card",children:[te.jsx("div",{className:"welcome-blossom",children:"🌸"}),te.jsx("h1",{className:"welcome-title",children:N("onboarding.title")}),te.jsx("p",{className:"welcome-subtitle",children:N("onboarding.subtitle")}),te.jsxs("div",{className:"welcome-stats",children:[te.jsxs("div",{className:"welcome-stat",children:[te.jsx("span",{className:"welcome-stat-number",children:j.toLocaleString()}),te.jsx("span",{className:"welcome-stat-label",children:N("onboarding.trees")})]}),te.jsxs("div",{className:"welcome-stat",children:[te.jsx("span",{className:"welcome-stat-number",children:P}),te.jsx("span",{className:"welcome-stat-label",children:N("onboarding.species")})]}),te.jsxs("div",{className:"welcome-stat",children:[te.jsx("span",{className:"welcome-stat-number",children:D}),te.jsx("span",{className:"welcome-stat-label",children:N("onboarding.routes")})]})]}),te.jsx("button",{className:"welcome-cta",onClick:R,children:N("onboarding.explore")})]})})}const _y="G-34D68T0FNV",a_="cherryblossom_analytics",yy={de:{text:"Diese Seite verwendet Cookies für anonyme Nutzungsstatistiken.",accept:"OK",decline:"Nein"},en:{text:"This site uses cookies for anonymous usage statistics.",accept:"OK",decline:"No"}};function vy(){if(document.getElementById("gtag-script"))return;const j=document.createElement("script");j.id="gtag-script",j.async=!0,j.src=`https://www.googletagmanager.com/gtag/js?id=${_y}`,document.head.appendChild(j),window.dataLayer=window.dataLayer||[];function P(){window.dataLayer.push(arguments)}P("js",new Date),P("config",_y)}function Mb({lang:j}){const[P,D]=Qe.useState(!1);Qe.useEffect(()=>{const T=localStorage.getItem(a_);T==="yes"?vy():T===null&&D(!0)},[]);const R=Qe.useCallback(()=>{localStorage.setItem(a_,"yes"),D(!1),vy()},[]),N=Qe.useCallback(()=>{localStorage.setItem(a_,"no"),D(!1)},[]);if(!P)return null;const E=yy[j]||yy.de;return te.jsxs("div",{className:"cookie-consent",children:[te.jsx("span",{className:"cookie-consent-text",children:E.text}),te.jsxs("div",{className:"cookie-consent-buttons",children:[te.jsx("button",{className:"cookie-consent-accept",onClick:R,children:E.accept}),te.jsx("button",{className:"cookie-consent-decline",onClick:N,children:E.decline})]})]})}function Eb(j){const[P,D]=Qe.useState([]),[R,N]=Qe.useState(!0),[E,T]=Qe.useState(null);Qe.useEffect(()=>{fetch("/cherry-trees.json").then(X=>{if(!X.ok)throw new Error("Failed to load tree data");return X.json()}).then(X=>{D(X.features),N(!1)}).catch(X=>{T(X.message),N(!1)})},[]);const u=Qe.useMemo(()=>j?P.filter(X=>j.has(X.properties.category)):P,[P,j]),V=Qe.useMemo(()=>{const X={};for(const ce of P){const ne=ce.properties.category;X[ne]=(X[ne]||0)+1}return X},[P]);return{allTrees:P,filteredTrees:u,counts:V,loading:R,error:E}}function Ab(){const[j,P]=Qe.useState(null),[D,R]=Qe.useState(null),[N,E]=Qe.useState(!1),[T,u]=Qe.useState(!1),V=Qe.useRef(null),X=Qe.useCallback(()=>{if(!navigator.geolocation){R("Geolocation is not supported");return}E(!0),u(!0),R(null),V.current=navigator.geolocation.watchPosition(ne=>{P({lat:ne.coords.latitude,lng:ne.coords.longitude}),E(!1)},ne=>{R(ne.message),E(!1)},{enableHighAccuracy:!0,timeout:1e4,maximumAge:3e4})},[]),ce=Qe.useCallback(()=>{V.current!==null&&(navigator.geolocation.clearWatch(V.current),V.current=null),u(!1),P(null)},[]);return Qe.useEffect(()=>()=>{V.current!==null&&navigator.geolocation.clearWatch(V.current)},[]),{position:j,error:D,loading:N,active:T,start:X,stop:ce}}const Pb=6371e3;function qy(j,P,D,R){const N=V=>V*Math.PI/180,E=N(D-j),T=N(R-P),u=Math.sin(E/2)**2+Math.cos(N(j))*Math.cos(N(D))*Math.sin(T/2)**2;return Pb*2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function zb(j,P,D){const R=Hy(j,P,D,20);if(R.length===0)return null;let N=0,E=0,T=0;for(const{feature:u,distance:V}of R){if(V>2e3)break;const[X,ce]=u.geometry.coordinates;N+=ce,E+=X,T++}return T===0?null:{lat:N/T,lng:E/T}}function Hy(j,P,D,R=10){return D.map(N=>{const[E,T]=N.geometry.coordinates;return{feature:N,distance:qy(j,P,T,E)}}).sort((N,E)=>N.distance-E.distance).slice(0,R)}
831function Lb(j,P,D=10){return Qe.useMemo(()=>!j||!P.length?[]:Hy(j.lat,j.lng,P,D),[j,P,D])}function Db(j){if(!j||j.length<2)return null;const P=j.slice(1);if(P.startsWith("route="))return{type:"route",value:P.slice(6)};if(P.startsWith("tree="))return{type:"tree",value:P.slice(5)};if(P.startsWith("map=")){const D=P.slice(4).split(",");if(D.length===3)return{type:"map",value:{lat:parseFloat(D[0]),lng:parseFloat(D[1]),zoom:parseInt(D[2],10)}}}return null}function Ib(){const[j]=Qe.useState(()=>Db(window.location.hash));function P(R){window.history.replaceState(null,"",`${window.location.pathname}#${R}`)}function D(R){return`${window.location.origin}${window.location.pathname}#${R}`}return{initialState:j,buildShareUrl:D,setRouteHash:R=>P(`route=${R}`),setTreeHash:R=>P(`tree=${R}`),clearHash:()=>window.history.replaceState(null,"",window.location.pathname)}}const kb="https://router.project-osrm.org/route/v1/foot/";async function Rb(j){const P=j.map(R=>`${R.lng},${R.lat}`).join(";"),D=`${kb}${P}?overview=full&geometries=geojson&steps=false`;try{const R=await fetch(D);if(!R.ok)throw new Error(`OSRM error: ${R.status}`);const N=await R.json();if(N.code!=="Ok"||!N.routes?.length)throw new Error("No route found");const E=N.routes[0];return{geometry:E.geometry,distance:Math.round(E.distance),duration:Math.round(E.duration/60)}}catch{return{geometry:{type:"LineString",coordinates:j.map(R=>[R.lng,R.lat])},distance:null,duration:null,fallback:!0}}}const s_=window.location.hash&&window.location.hash.length>1;function Ob(){const{i18n:j}=qa(),P=j.language?.startsWith("de")?"de":"en",[D,R]=Qe.useState(()=>new Set(Qf)),[N,E]=Qe.useState(null),[T,u]=Qe.useState(null),[V,X]=Qe.useState(!1),[ce,ne]=Qe.useState(!1),[ye,Se]=Qe.useState(!1),[Ie,Te]=Qe.useState(!1),[ve,lt]=Qe.useState([]),[Tt,dt]=Qe.useState(null),Bt=Qe.useRef(null),Vt=Qe.useRef(!1),[ui,Ft]=Qe.useState(()=>!(s_||localStorage.getItem("cherryblossom_onboarded")==="true")),[vi,Kt]=Qe.useState(()=>s_?!1:localStorage.getItem("cherryblossom_onboarded")==="true"),qt=Qe.useRef(s_||localStorage.getItem("cherryblossom_onboarded")==="true"),Ht=Qe.useMemo(()=>Dy(new Date),[]),Xt=Qe.useMemo(()=>ce?new Set([...D].filter(St=>Ht.includes(St))):D,[D,ce,Ht]),{allTrees:si,filteredTrees:ii,counts:Vi,loading:Ke,error:mt}=Eb(Xt),gt=Ab(),Yt=Lb(gt.position,ii),It=Ib(),ze=Qe.useCallback(St=>{const[Ct,ri]=St.geometry.coordinates,wi=Bt.current;wi&&wi.setView([ri,Ct],18),dt(St.properties.id)},[]),rt=Qe.useCallback(async St=>{u(St.id);const Ct=await Rb(St.waypoints);E({...Ct,waypoints:St.waypoints,transitStops:St.transitStops,routeName:St}),St.cherryPlums&&!Ie&&Te(!0),gt.active||gt.start()},[gt,Ie]),Et=Qe.useCallback(()=>{E(null),u(null)},[]),Pt=Qe.useCallback(()=>{localStorage.setItem("cherryblossom_onboarded","true"),Ft(!1),Kt(!0),gt.start()},[gt]);return Qe.useEffect(()=>{if(qt.current||ui||!gt.position||!si.length||(qt.current=!0,qy(gt.position.lat,gt.position.lng,47.378,8.535)>15e3))return;const Wi=zb(gt.position.lat,gt.position.lng,si),vr=Bt.current;vr&&Wi&&vr.flyTo([Wi.lat,Wi.lng],16,{duration:1.5})},[ui,gt.position,si]),Qe.useEffect(()=>{if(Ke||Vt.current||!It.initialState)return;Vt.current=!0;const{type:St,value:Ct}=It.initialState;if(St==="route"){const ri=hm.find(wi=>wi.id===Ct);ri&&rt(ri)}if(St==="tree"&&si.find(wi=>wi.properties.id===Ct)&&dt(Ct),St==="map"){const ri=Bt.current;ri&&Ct.lat&&Ct.lng&&Ct.zoom&&ri.setView([Ct.lat,Ct.lng],Ct.zoom)}},[Ke,It.initialState,si,rt]),Qe.useEffect(()=>{!Ie||ve.length>0||fetch("/cherry-plum-trees.json").then(St=>St.json()).then(St=>lt(St.features)).catch(()=>{})},[Ie,ve.length]),Qe.useEffect(()=>{if(!Ke){const St=document.getElementById("splash");St&&(St.classList.add("hidden"),setTimeout(()=>St.remove(),600))}},[Ke]),Ke?null:mt?te.jsx("div",{className:"loading-screen",children:te.jsxs("p",{children:["Error: ",mt]})}):te.jsxs("div",{className:`app ${N?"walk-active":""}`,children:[te.jsx(W0,{}),te.jsx(ix,{bloomFilterActive:ce,onBloomFilterChange:ne,onOpenCalendar:()=>Se(!0)}),te.jsx(db,{trees:ii,userPosition:gt.position,activeRoute:N,activeRouteId:T,mapRef:Bt,lang:P,heatmapVisible:V,onHeatmapToggle:()=>X(!V),highlightedTreeId:Tt,activeFilters:D,onFilterChange:R,counts:Vi,bloomFilterActive:ce,showCherryPlums:Ie,onToggleCherryPlums:()=>Te(St=>!St),cherryPlumTrees:ve,showRoutePreview:vi,onSelectRoute:rt,onClearRoute:Et}),te.jsx(Sb,{geo:gt,nearestTrees:Yt,onShowTree:ze,onSelectRoute:rt,onClearRoute:Et,activeRouteId:T,allTrees:si,lang:P}),te.jsx(lx,{open:ye,onClose:()=>Se(!1)}),ui&&te.jsx(Cb,{treeCount:si.length,speciesCount:Qf.length,routeCount:hm.length,onDismiss:Pt}),te.jsx(Mb,{lang:P})]})}wy.createRoot(document.getElementById("root")).render(te.jsx(Qe.StrictMode,{children:te.jsx(Ob,{})}));

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.