diff --git a/frontend/dist/frontend/assets/trondheim_kommune.png b/frontend/dist/frontend/assets/trondheim_kommune.png new file mode 100644 index 0000000..5729cb2 Binary files /dev/null and b/frontend/dist/frontend/assets/trondheim_kommune.png differ diff --git a/frontend/dist/frontend/index.html b/frontend/dist/frontend/index.html index 0d2856d..20a3f83 100644 --- a/frontend/dist/frontend/index.html +++ b/frontend/dist/frontend/index.html @@ -9,6 +9,6 @@ - + \ No newline at end of file diff --git a/frontend/dist/frontend/main.0f2936143d35c1c4.js b/frontend/dist/frontend/main.0f2936143d35c1c4.js new file mode 100644 index 0000000..103d697 --- /dev/null +++ b/frontend/dist/frontend/main.0f2936143d35c1c4.js @@ -0,0 +1 @@ +(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[179],{418:(Vm,Au,ku)=>{"use strict";function sr(e){return"function"==typeof e}function Kh(e){const n=e(r=>{Error.call(r),r.stack=(new Error).stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}const Um=Kh(e=>function(n){e(this),this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=n});function b(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class vr{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(const o of n)o.remove(this);else n.remove(this);const{initialTeardown:r}=this;if(sr(r))try{r()}catch(o){t=o instanceof Um?o.errors:[o]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const o of i)try{Pl(o)}catch(c){t=t??[],c instanceof Um?t=[...t,...c.errors]:t.push(c)}}if(t)throw new Um(t)}}add(t){var n;if(t&&t!==this)if(this.closed)Pl(t);else{if(t instanceof vr){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}}_hasParent(t){const{_parentage:n}=this;return n===t||Array.isArray(n)&&n.includes(t)}_addParent(t){const{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t}_removeParent(t){const{_parentage:n}=this;n===t?this._parentage=null:Array.isArray(n)&&b(n,t)}remove(t){const{_finalizers:n}=this;n&&b(n,t),t instanceof vr&&t._removeParent(this)}}vr.EMPTY=(()=>{const e=new vr;return e.closed=!0,e})();const Rs=vr.EMPTY;function ds(e){return e instanceof vr||e&&"closed"in e&&sr(e.remove)&&sr(e.add)&&sr(e.unsubscribe)}function Pl(e){sr(e)?e():e.unsubscribe()}const Zt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Te={setTimeout(e,t,...n){const{delegate:r}=Te;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=Te;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function zi(e){Te.setTimeout(()=>{const{onUnhandledError:t}=Zt;if(!t)throw e;t(e)})}function Fs(){}const Os=wi("C",void 0,void 0);function wi(e,t,n){return{kind:e,value:t,error:n}}let io=null;function pn(e){if(Zt.useDeprecatedSynchronousErrorHandling){const t=!io;if(t&&(io={errorThrown:!1,error:null}),e(),t){const{errorThrown:n,error:r}=io;if(io=null,n)throw r}}else e()}class kc extends vr{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,ds(t)&&t.add(this)):this.destination=Pu}static create(t,n,r){return new oo(t,n,r)}next(t){this.isStopped?Hn(function Rl(e){return wi("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Hn(function Ra(e){return wi("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Hn(Os,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Mo=Function.prototype.bind;function na(e,t){return Mo.call(e,t)}class Ls{constructor(t){this.partialObserver=t}next(t){const{partialObserver:n}=this;if(n.next)try{n.next(t)}catch(r){Fa(r)}}error(t){const{partialObserver:n}=this;if(n.error)try{n.error(t)}catch(r){Fa(r)}else Fa(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(n){Fa(n)}}}class oo extends kc{constructor(t,n,r){let i;if(super(),sr(t)||!t)i={next:t??void 0,error:n??void 0,complete:r??void 0};else{let o;this&&Zt.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&na(t.next,o),error:t.error&&na(t.error,o),complete:t.complete&&na(t.complete,o)}):i=t}this.destination=new Ls(i)}}function Fa(e){Zt.useDeprecatedSynchronousErrorHandling?function ii(e){Zt.useDeprecatedSynchronousErrorHandling&&io&&(io.errorThrown=!0,io.error=e)}(e):zi(e)}function Hn(e,t){const{onStoppedNotification:n}=Zt;n&&Te.setTimeout(()=>n(e,t))}const Pu={closed:!0,next:Fs,error:function fs(e){throw e},complete:Fs},Tt="function"==typeof Symbol&&Symbol.observable||"@@observable";function qr(e){return e}function Ns(e){return 0===e.length?qr:1===e.length?e[0]:function(n){return e.reduce((r,i)=>i(r),n)}}let Nn=(()=>{class e{constructor(n){n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,i){const o=function La(e){return e&&e instanceof kc||function Fl(e){return e&&sr(e.next)&&sr(e.error)&&sr(e.complete)}(e)&&ds(e)}(n)?n:new oo(n,r,i);return pn(()=>{const{operator:c,source:d}=this;o.add(c?c.call(o,d):d?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return new(r=Pc(r))((i,o)=>{const c=new oo({next:d=>{try{n(d)}catch(p){o(p),c.unsubscribe()}},error:o,complete:i});this.subscribe(c)})}_subscribe(n){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(n)}[Tt](){return this}pipe(...n){return Ns(n)(this)}toPromise(n){return new(n=Pc(n))((r,i)=>{let o;this.subscribe(c=>o=c,c=>i(c),()=>r(o))})}}return e.create=t=>new e(t),e})();function Pc(e){var t;return null!==(t=e??Zt.Promise)&&void 0!==t?t:Promise}const Rc=Kh(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let oi=(()=>{class e extends Nn{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){const r=new Na(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new Rc}next(n){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(n)}})}error(n){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;const{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){pn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return(null===(n=this.observers)||void 0===n?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){const{hasError:r,isStopped:i,observers:o}=this;return r||i?Rs:(this.currentObservers=null,o.push(n),new vr(()=>{this.currentObservers=null,b(o,n)}))}_checkFinalizedStatuses(n){const{hasError:r,thrownError:i,isStopped:o}=this;r?n.error(i):o&&n.complete()}asObservable(){const n=new Nn;return n.source=this,n}}return e.create=(t,n)=>new Na(t,n),e})();class Na extends oi{constructor(t,n){super(),this.destination=t,this.source=n}next(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)}error(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)}complete(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)}_subscribe(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:Rs}}function ra(e){return sr(e?.lift)}function yr(e){return t=>{if(ra(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Qn(e,t,n,r,i){return new Ae(e,t,n,r,i)}class Ae extends kc{constructor(t,n,r,i,o,c){super(t),this.onFinalize=o,this.shouldUnsubscribe=c,this._next=n?function(d){try{n(d)}catch(p){t.error(p)}}:super._next,this._error=i?function(d){try{i(d)}catch(p){t.error(p)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(d){t.error(d)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:n}=this;super.unsubscribe(),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Pe(e,t){return yr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>{r.next(e.call(t,o,i++))}))})}function lo(e){return this instanceof lo?(this.v=e,this):new lo(e)}function Ll(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),o=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(I){r[I]&&(i[I]=function(P){return new Promise(function(N,G){o.push([I,P,N,G])>1||d(I,P)})})}function d(I,P){try{!function p(I){I.value instanceof lo?Promise.resolve(I.value.v).then(v,C):D(o[0][2],I)}(r[I](P))}catch(N){D(o[0][3],N)}}function v(I){d("next",I)}function C(I){d("throw",I)}function D(I,P){I(P),o.shift(),o.length&&d(o[0][0],o[0][1])}}function oa(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function ia(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(c){return new Promise(function(d,p){!function i(o,c,d,p){Promise.resolve(p).then(function(v){o({value:v,done:d})},c)}(d,p,(c=e[o](c)).done,c.value)})}}}const co=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function Zr(e){return sr(e?.then)}function Vr(e){return sr(e[Tt])}function pi(e){return Symbol.asyncIterator&&sr(e?.[Symbol.asyncIterator])}function mi(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const J=function Bs(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function V(e){return sr(e?.[J])}function $(e){return Ll(this,arguments,function*(){const n=e.getReader();try{for(;;){const{value:r,done:i}=yield lo(n.read());if(i)return yield lo(void 0);yield yield lo(r)}}finally{n.releaseLock()}})}function K(e){return sr(e?.getReader)}function te(e){if(e instanceof Nn)return e;if(null!=e){if(Vr(e))return function ce(e){return new Nn(t=>{const n=e[Tt]();if(sr(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(co(e))return function ge(e){return new Nn(t=>{for(let n=0;n{e.then(n=>{t.closed||(t.next(n),t.complete())},n=>t.error(n)).then(null,zi)})}(e);if(pi(e))return xe(e);if(V(e))return function ue(e){return new Nn(t=>{for(const n of e)if(t.next(n),t.closed)return;t.complete()})}(e);if(K(e))return function Me(e){return xe($(e))}(e)}throw mi(e)}function xe(e){return new Nn(t=>{(function je(e,t){var n,r,i,o;return function gs(e,t,n,r){return new(n||(n=Promise))(function(o,c){function d(C){try{v(r.next(C))}catch(D){c(D)}}function p(C){try{v(r.throw(C))}catch(D){c(D)}}function v(C){C.done?o(C.value):function i(o){return o instanceof n?o:new n(function(c){c(o)})}(C.value).then(d,p)}v((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(n=oa(e);!(r=yield n.next()).done;)if(t.next(r.value),t.closed)return}catch(c){i={error:c}}finally{try{r&&!r.done&&(o=n.return)&&(yield o.call(n))}finally{if(i)throw i.error}}t.complete()})})(e,t).catch(n=>t.error(n))})}function Ie(e,t,n,r=0,i=!1){const o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function dt(e,t,n=1/0){return sr(t)?dt((r,i)=>Pe((o,c)=>t(r,o,i,c))(te(e(r,i))),n):("number"==typeof t&&(n=t),yr((r,i)=>function Dt(e,t,n,r,i,o,c,d){const p=[];let v=0,C=0,D=!1;const I=()=>{D&&!p.length&&!v&&t.complete()},P=G=>v{o&&t.next(G),v++;let U=!1;te(n(G,C++)).subscribe(Qn(t,Z=>{i?.(Z),o?P(Z):t.next(Z)},()=>{U=!0},void 0,()=>{if(U)try{for(v--;p.length&&vN(Z)):N(Z)}I()}catch(Z){t.error(Z)}}))};return e.subscribe(Qn(t,P,()=>{D=!0,I()})),()=>{d?.()}}(r,i,e,n)))}function ft(e=1/0){return dt(qr,e)}const xt=new Nn(e=>e.complete());function nn(e){return e&&sr(e.schedule)}function an(e){return e[e.length-1]}function ar(e){return nn(an(e))?e.pop():void 0}function kr(e,t=0){return yr((n,r)=>{n.subscribe(Qn(r,i=>Ie(r,e,()=>r.next(i),t),()=>Ie(r,e,()=>r.complete(),t),i=>Ie(r,e,()=>r.error(i),t)))})}function Ua(e,t=0){return yr((n,r)=>{r.add(e.schedule(()=>n.subscribe(r),t))})}function ja(e,t){if(!e)throw new Error("Iterable cannot be null");return new Nn(n=>{Ie(n,t,()=>{const r=e[Symbol.asyncIterator]();Ie(n,t,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function Cr(e,t){return t?function Ou(e,t){if(null!=e){if(Vr(e))return function kf(e,t){return te(e).pipe(Ua(t),kr(t))}(e,t);if(co(e))return function $a(e,t){return new Nn(n=>{let r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(Zr(e))return function Pf(e,t){return te(e).pipe(Ua(t),kr(t))}(e,t);if(pi(e))return ja(e,t);if(V(e))return function Fu(e,t){return new Nn(n=>{let r;return Ie(n,t,()=>{r=e[J](),Ie(n,t,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(c){return void n.error(c)}o?n.complete():n.next(i)},0,!0)}),()=>sr(r?.return)&&r.return()})}(e,t);if(K(e))return function aa(e,t){return ja($(e),t)}(e,t)}throw mi(e)}(e,t):te(e)}function Bl(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new oo({next:()=>{r.unsubscribe(),e()}});return t(...n).subscribe(r)}function Bn(e){for(let t in e)if(e[t]===Bn)return t;throw Error("Could not find renamed property on target object.")}function Mn(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Mn).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Lu(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Rf=Bn({__forward_ref__:Bn});function Yn(e){return e.__forward_ref__=Yn,e.toString=function(){return Mn(this())},e}function Mt(e){return function Vl(e){return"function"==typeof e&&e.hasOwnProperty(Rf)&&e.__forward_ref__===Yn}(e)?e():e}class nt extends Error{constructor(t,n){super(function wn(e,t){return`NG0${Math.abs(e)}${t?": "+t.trim():""}`}(t,n)),this.code=t}}function $t(e){return"string"==typeof e?e:null==e?"":String(e)}function Nu(e,t){throw new nt(-201,!1)}function $i(e,t){null==e&&function Rn(e,t,n,r){throw new Error(`ASSERTION ERROR: ${e}`+(null==r?"":` [Expected=> ${n} ${r} ${t} <=Actual]`))}(t,e,null,"!=")}function Ot(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Ei(e){return{providers:e.providers||[],imports:e.imports||[]}}function Uu(e){return Nc(e,gn)||Nc(e,ju)}function Nc(e,t){return e.hasOwnProperty(t)?e[t]:null}function Ha(e){return e&&(e.hasOwnProperty($u)||e.hasOwnProperty(Ga))?e[$u]:null}const gn=Bn({\u0275prov:Bn}),$u=Bn({\u0275inj:Bn}),ju=Bn({ngInjectableDef:Bn}),Ga=Bn({ngInjectorDef:Bn});var Rt=(()=>((Rt=Rt||{})[Rt.Default=0]="Default",Rt[Rt.Host=1]="Host",Rt[Rt.Self=2]="Self",Rt[Rt.SkipSelf=4]="SkipSelf",Rt[Rt.Optional=8]="Optional",Rt))();let la;function uo(e){const t=la;return la=e,t}function Hu(e,t,n){const r=Uu(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&Rt.Optional?null:void 0!==t?t:void Nu(Mn(e))}function Wo(e){return{toString:e}.toString()}var Xo=(()=>((Xo=Xo||{})[Xo.OnPush=0]="OnPush",Xo[Xo.Default=1]="Default",Xo))(),ys=(()=>{return(e=ys||(ys={}))[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",ys;var e})();const er=(()=>typeof globalThis<"u"&&globalThis||typeof global<"u"&&global||typeof window<"u"&&window||typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self)(),ca={},Cn=[],qa=Bn({\u0275cmp:Bn}),zc=Bn({\u0275dir:Bn}),Bc=Bn({\u0275pipe:Bn}),ld=Bn({\u0275mod:Bn}),To=Bn({\u0275fac:Bn}),ua=Bn({__NG_ELEMENT_ID__:Bn});let Ao=0;function Vs(e){return Wo(()=>{const n=!0===e.standalone,r={},i={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:r,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===Xo.OnPush,directiveDefs:null,pipeDefs:null,standalone:n,dependencies:n&&e.dependencies||null,getStandaloneInjector:null,selectors:e.selectors||Cn,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||ys.Emulated,id:"c"+Ao++,styles:e.styles||Cn,_:null,setInput:null,schemas:e.schemas||null,tView:null},o=e.dependencies,c=e.features;return i.inputs=zf(e.inputs,r),i.outputs=zf(e.outputs),c&&c.forEach(d=>d(i)),i.directiveDefs=o?()=>("function"==typeof o?o():o).map(ud).filter(Za):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(kt).filter(Za):null,i})}function ud(e){return Nt(e)||Xr(e)}function Za(e){return null!==e}function ai(e){return Wo(()=>({type:e.type,bootstrap:e.bootstrap||Cn,declarations:e.declarations||Cn,imports:e.imports||Cn,exports:e.exports||Cn,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function zf(e,t){if(null==e)return ca;const n={};for(const r in e)if(e.hasOwnProperty(r)){let i=e[r],o=i;Array.isArray(i)&&(o=i[1],i=i[0]),n[i]=r,t&&(t[i]=o)}return n}const Lt=Vs;function ji(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function Nt(e){return e[qa]||null}function Xr(e){return e[zc]||null}function kt(e){return e[Bc]||null}function cn(e,t){const n=e[ld]||null;if(!n&&!0===t)throw new Error(`Type ${Mn(e)} does not have '\u0275mod' property.`);return n}function Xe(e){return Array.isArray(e)&&"object"==typeof e[1]}function po(e){return Array.isArray(e)&&!0===e[1]}function fd(e){return 0!=(8&e.flags)}function Zu(e){return 2==(2&e.flags)}function jl(e){return 1==(1&e.flags)}function ko(e){return null!==e.template}function Uc(e){return 0!=(256&e[2])}function bs(e,t){return e.hasOwnProperty(To)?e[To]:null}class wt{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function yt(){return Qa}function Qa(e){return e.type.prototype.ngOnChanges&&(e.setInput=vd),_d}function _d(){const e=jc(this),t=e?.current;if(t){const n=e.previous;if(n===ca)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function vd(e,t,n,r){const i=jc(e)||function Ko(e,t){return e[Di]=t}(e,{previous:ca,current:null}),o=i.current||(i.current={}),c=i.previous,d=this.declaredInputs[n],p=c[d];o[d]=new wt(p&&p.currentValue,t,c===ca),e[r]=t}yt.ngInherit=!0;const Di="__ngSimpleChanges__";function jc(e){return e[Di]||null}function Sr(e){for(;Array.isArray(e);)e=e[0];return e}function Si(e,t){return Sr(t[e.index])}function Zl(e,t){return e.data[t]}function Mi(e,t){const n=t[e];return Xe(n)?n:n[0]}function Wl(e){return 64==(64&e[2])}function xs(e,t){return null==t?null:e[t]}function Hs(e){e[18]=0}function Xl(e,t){e[5]+=t;let n=e,r=e[3];for(;null!==r&&(1===t&&1===n[5]||-1===t&&0===n[5]);)r[5]+=t,n=r,r=r[3]}const Vt={lFrame:ie(null),bindingsEnabled:!0};function qc(){return Vt.bindingsEnabled}function He(){return Vt.lFrame.lView}function en(){return Vt.lFrame.tView}function ma(e){return Vt.lFrame.contextLView=e,e[8]}function Gs(e){return Vt.lFrame.contextLView=null,e}function Pr(){let e=ih();for(;null!==e&&64===e.type;)e=e.parent;return e}function ih(){return Vt.lFrame.currentTNode}function ws(e,t){const n=Vt.lFrame;n.currentTNode=e,n.isParent=t}function Sd(){return Vt.lFrame.isParent}function h(){const e=Vt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function w(){return Vt.lFrame.bindingIndex++}function R(e,t){const n=Vt.lFrame;n.bindingIndex=n.bindingRootIndex=e,L(t)}function L(e){Vt.lFrame.currentDirectiveIndex=e}function Q(){return Vt.lFrame.currentQueryIndex}function ee(e){Vt.lFrame.currentQueryIndex=e}function Y(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function ae(e,t,n){if(n&Rt.SkipSelf){let i=t,o=e;for(;!(i=i.parent,null!==i||n&Rt.Host||(i=Y(o),null===i||(o=o[15],10&i.type))););if(null===i)return!1;t=i,e=o}const r=Vt.lFrame=ye();return r.currentTNode=t,r.lView=e,!0}function _e(e){const t=ye(),n=e[1];Vt.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function ye(){const e=Vt.lFrame,t=null===e?null:e.child;return null===t?ie(e):t}function ie(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function we(){const e=Vt.lFrame;return Vt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const De=we;function Se(){const e=we();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Le(){return Vt.lFrame.selectedIndex}function Ne(e){Vt.lFrame.selectedIndex=e}function ht(){Vt.lFrame.currentNamespace="svg"}function Ht(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[p]<0&&(e[18]+=65536),(d>11>16&&(3&e[2])===t){e[2]+=2048;try{o.call(d)}finally{}}}else try{o.call(d)}finally{}}class li{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Yr(e,t,n){let r=0;for(;rt){c=o-1;break}}}for(;o>16}(e),r=t;for(;n>0;)r=r[15],n--;return r}let Md=!0;function Mr(e){const t=Md;return Md=e,t}let Id=0;const _a={};function lh(e,t){const n=Xm(e,t);if(-1!==n)return n;const r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,Wf(r.data,e),Wf(t,null),Wf(r.blueprint,null));const i=ch(e,t),o=e.injectorIndex;if(ya(i)){const c=Zs(i),d=Cs(i,t),p=d[1].data;for(let v=0;v<8;v++)t[o+v]=d[c+v]|p[c+v]}return t[o+8]=i,o}function Wf(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Xm(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function ch(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;null!==i;){if(r=F_(i),null===r)return-1;if(n++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return-1}function Td(e,t,n){!function Zf(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(ua)&&(r=n[ua]),null==r&&(r=n[ua]=Id++);const i=255&r;t.data[e+(i>>5)]|=1<=0?255&t:Kx:t}(n);if("function"==typeof o){if(!ae(t,e,r))return r&Rt.Host?uh(i,0,r):Oo(t,n,r,i);try{const c=o(r);if(null!=c||r&Rt.Optional)return c;Nu()}finally{De()}}else if("number"==typeof o){let c=null,d=Xm(e,t),p=-1,v=r&Rt.Host?t[16][6]:null;for((-1===d||r&Rt.SkipSelf)&&(p=-1===d?ch(e,t):t[d+8],-1!==p&&Kl(r,!1)?(c=t[1],d=Zs(p),t=Cs(p,t)):d=-1);-1!==d;){const C=t[1];if(Jm(o,d,C.data)){const D=Yx(d,t,n,c,r,v);if(D!==_a)return D}p=t[d+8],-1!==p&&Kl(r,t[1].data[d+8]===v)&&Jm(o,d,t)?(c=C,d=Zs(p),t=Cs(p,t)):d=-1}}return i}function Yx(e,t,n,r,i,o){const c=t[1],d=c.data[e+8],C=Xf(d,c,n,null==r?Zu(d)&&Md:r!=c&&0!=(3&d.type),i&Rt.Host&&o===d);return null!==C?nl(t,c,C,d):_a}function Xf(e,t,n,r,i){const o=e.providerIndexes,c=t.data,d=1048575&o,p=e.directiveStart,C=o>>20,I=i?d+C:e.directiveEnd;for(let P=r?d:d+C;P=p&&N.type===n)return P}if(i){const P=c[p];if(P&&ko(P)&&P.type===n)return p}return null}function nl(e,t,n,r){let i=e[n];const o=t.data;if(function Ii(e){return e instanceof li}(i)){const c=i;c.resolving&&function Qh(e,t){const n=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new nt(-200,`Circular dependency in DI detected for ${e}${n}`)}(function yn(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():$t(e)}(o[n]));const d=Mr(c.canSeeViewProviders);c.resolving=!0;const p=c.injectImpl?uo(c.injectImpl):null;ae(e,r,Rt.Default);try{i=e[n]=c.factory(void 0,o,e,r),t.firstCreatePass&&n>=r.directiveStart&&function An(e,t,n){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=t.type.prototype;if(r){const c=Qa(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,c),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,c)}i&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,i),o&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,o),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,o))}(n,o[n],t)}finally{null!==p&&uo(p),Mr(d),c.resolving=!1,De()}}return i}function Jm(e,t,n){return!!(n[t+(e>>5)]&1<{const r=function eg(e){return function(...n){if(e){const r=e(...n);for(const i in r)this[i]=r[i]}}}(t);function i(...o){if(this instanceof i)return r.apply(this,o),this;const c=new i(...o);return d.annotation=c,d;function d(p,v,C){const D=p.hasOwnProperty(Jl)?p[Jl]:Object.defineProperty(p,Jl,{value:[]})[Jl];for(;D.length<=C;)D.push(null);return(D[C]=D[C]||[]).push(c),p}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i})}class It{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=Ot({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function _o(e,t){void 0===t&&(t=e);for(let n=0;nArray.isArray(n)?rl(n,t):t(n))}function B_(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function ep(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}const il={},np="__NG_DI_FLAG__",rp="ngTempTokenPath",c1=/\n/gm,j_="__source";let Nd;function Xc(e){const t=Nd;return Nd=e,t}function lg(e,t=Rt.Default){if(void 0===Nd)throw new nt(-203,!1);return null===Nd?Hu(e,void 0,t):Nd.get(e,t&Rt.Optional?null:void 0,t)}function St(e,t=Rt.Default){return(function $l(){return la}()||lg)(Mt(e),t)}function Fr(e,t=Rt.Default){return"number"!=typeof t&&(t=0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)),St(e,t)}function ip(e){const t=[];for(let n=0;n((Xi=Xi||{})[Xi.Important=1]="Important",Xi[Xi.DashCase=2]="DashCase",Xi))();const cp=new Map;let ec=0;const hp="__ngContext__";function ui(e,t){Xe(t)?(e[hp]=t[20],function J_(e){cp.set(e[20],e)}(t)):e[hp]=t}function Eg(e,t){return undefined(e,t)}function Gd(e){const t=e[3];return po(t)?t[3]:t}function _h(e){return iv(e[13])}function qd(e){return iv(e[4])}function iv(e){for(;null!==e&&!po(e);)e=e[4];return e}function nc(e,t,n,r,i){if(null!=r){let o,c=!1;po(r)?o=r:Xe(r)&&(c=!0,r=r[0]);const d=Sr(r);0===e&&null!==n?null==i?Ag(t,n,d):oc(t,n,d,i||null,!0):1===e&&null!==n?oc(t,n,d,i||null,!0):2===e?function Yd(e,t,n){const r=vh(e,t);r&&function yp(e,t,n,r){e.removeChild(t,n,r)}(e,r,t,n)}(t,d,c):3===e&&t.destroyNode(d),null!=o&&function F1(e,t,n,r,i){const o=n[7];o!==Sr(n)&&nc(t,e,r,o,i);for(let d=10;d0&&(e[n-1][4]=r[4]);const o=ep(e,10+t);!function mp(e,t){sl(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(r[1],r);const c=o[19];null!==c&&c.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-65}return r}function xr(e,t){if(!(128&t[2])){const n=t[11];n.destroyNode&&sl(e,t,n,3,null,null),function A1(e){let t=e[13];if(!t)return ic(e[1],e);for(;t;){let n=null;if(Xe(t))n=t[13];else{const r=t[10];r&&(n=r)}if(!n){for(;t&&!t[4]&&t!==e;)Xe(t)&&ic(t[1],t),t=t[3];null===t&&(t=e),Xe(t)&&ic(t[1],t),n=t&&t[4]}t=n}}(t)}}function ic(e,t){if(!(128&t[2])){t[2]&=-65,t[2]|=128,function cv(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let r=0;r=0?r[i=v]():r[i=-v].unsubscribe(),o+=2}else{const c=r[i=n[o+1]];n[o].call(c)}if(null!==r){for(let o=i+1;o{const c=o;Vg(c,n,[],r)&&(i||(i=[]),i.push(c))}),void 0!==i&&hv(i,n),n}function hv(e,t){for(let n=0;n{t.push(o)})}}function Vg(e,t,n,r){if(!(e=Mt(e)))return!1;let i=null,o=Ha(e);const c=!o&&Nt(e);if(o||c){if(c&&!c.standalone)return!1;i=e}else{const p=e.ngModule;if(o=Ha(p),!o)return!1;i=p}const d=r.has(i);if(c){if(d)return!1;if(r.add(i),c.dependencies){const p="function"==typeof c.dependencies?c.dependencies():c.dependencies;for(const v of p)Vg(v,t,n,r)}}else{if(!o)return!1;{if(null!=o.imports&&!d){let v;r.add(i);try{rl(o.imports,C=>{Vg(C,t,n,r)&&(v||(v=[]),v.push(C))})}finally{}void 0!==v&&hv(v,t)}if(!d){const v=bs(i)||(()=>new i);t.push({provide:i,useFactory:v,deps:Cn},{provide:Ng,useValue:i,multi:!0},{provide:Jd,useValue:()=>St(i),multi:!0})}const p=o.providers;null==p||d||rl(p,C=>{t.push(C)})}}return i!==e&&void 0!==e.providers}const N1=Bn({provide:String,useValue:Bn});function Ug(e){return null!==e&&"object"==typeof e&&N1 in e}function eu(e){return"function"==typeof e}const wh=new It("Set Injector scope."),Qd={},wo={};let Is;function ac(){return void 0===Is&&(Is=new wp),Is}class Ts{}class $g extends Ts{constructor(t,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,z1(t,c=>this.processProvider(c)),this.records.set(xa,Cp(void 0,this)),i.has("environment")&&this.records.set(Ts,Cp(void 0,this));const o=this.records.get(wh);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Ng.multi,Cn,Rt.Self))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const t of this._ngOnDestroyHooks)t.ngOnDestroy();for(const t of this._onDestroyHooks)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),this._onDestroyHooks.length=0}}onDestroy(t){this._onDestroyHooks.push(t)}runInContext(t){this.assertNotDestroyed();const n=Xc(this),r=uo(void 0);try{return t()}finally{Xc(n),uo(r)}}get(t,n=il,r=Rt.Default){this.assertNotDestroyed();const i=Xc(this),o=uo(void 0);try{if(!(r&Rt.SkipSelf)){let d=this.records.get(t);if(void 0===d){const p=function L6(e){return"function"==typeof e||"object"==typeof e&&e instanceof It}(t)&&Uu(t);d=p&&this.injectableDefInScope(p)?Cp(cl(t),Qd):null,this.records.set(t,d)}if(null!=d)return this.hydrate(t,d)}return(r&Rt.Self?ac():this.parent).get(t,n=r&Rt.Optional&&n===il?null:n)}catch(c){if("NullInjectorError"===c.name){if((c[rp]=c[rp]||[]).unshift(Mn(t)),i)throw c;return function d1(e,t,n,r){const i=e[rp];throw t[j_]&&i.unshift(t[j_]),e.message=function H_(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let i=Mn(t);if(Array.isArray(t))i=t.map(Mn).join(" -> ");else if("object"==typeof t){let o=[];for(let c in t)if(t.hasOwnProperty(c)){let d=t[c];o.push(c+":"+("string"==typeof d?JSON.stringify(d):Mn(d)))}i=`{${o.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${e.replace(c1,"\n ")}`}("\n"+e.message,i,n,r),e.ngTokenPath=i,e[rp]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{uo(o),Xc(i)}}resolveInjectorInitializers(){const t=Xc(this),n=uo(void 0);try{const r=this.get(Jd.multi,Cn,Rt.Self);for(const i of r)i()}finally{Xc(t),uo(n)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(Mn(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new nt(205,!1)}processProvider(t){let n=eu(t=Mt(t))?t:Mt(t&&t.provide);const r=function R6(e){return Ug(e)?Cp(void 0,e.useValue):Cp(function B2(e,t,n){let r;if(eu(e)){const i=Mt(e);return bs(i)||cl(i)}if(Ug(e))r=()=>Mt(e.useValue);else if(function fv(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...ip(e.deps||[]));else if(function dv(e){return!(!e||!e.useExisting)}(e))r=()=>St(Mt(e.useExisting));else{const i=Mt(e&&(e.useClass||e.provide));if(!function F6(e){return!!e.deps}(e))return bs(i)||cl(i);r=()=>new i(...ip(e.deps))}return r}(e),Qd)}(t);if(eu(t)||!0!==t.multi)this.records.get(n);else{let i=this.records.get(n);i||(i=Cp(void 0,Qd,!0),i.factory=()=>ip(i.multi),this.records.set(n,i)),n=t,i.multi.push(t)}this.records.set(n,r)}hydrate(t,n){return n.value===Qd&&(n.value=wo,n.value=n.factory()),"object"==typeof n.value&&n.value&&function O6(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}injectableDefInScope(t){if(!t.providedIn)return!1;const n=Mt(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}}function cl(e){const t=Uu(e),n=null!==t?t.factory:bs(e);if(null!==n)return n;if(e instanceof It)throw new nt(204,!1);if(e instanceof Function)return function P6(e){const t=e.length;if(t>0)throw function Fd(e,t){const n=[];for(let r=0;rn.factory(e):()=>new e}(e);throw new nt(204,!1)}function Cp(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function N6(e){return!!e.\u0275providers}function z1(e,t){for(const n of e)Array.isArray(n)?z1(n,t):N6(n)?z1(n.\u0275providers,t):t(n)}class V2{}class V6{resolveComponentFactory(t){throw function B6(e){const t=Error(`No component factory found for ${Mn(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(t)}}let jg=(()=>{class e{}return e.NULL=new V6,e})();function U6(){return Ep(Pr(),He())}function Ep(e,t){return new Xs(Si(e,t))}let Xs=(()=>{class e{constructor(n){this.nativeElement=n}}return e.__NG_ELEMENT_ID__=U6,e})();function $6(e){return e instanceof Xs?e.nativeElement:e}class $2{}let ul=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>function j6(){const e=He(),n=Mi(Pr().index,e);return(Xe(n)?n:e)[11]}(),e})(),H6=(()=>{class e{}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:()=>null}),e})();class Hg{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const G6=new Hg("14.3.0"),B1={};function U1(e){return e.ngOriginalError}class Dp{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&U1(t);for(;n&&U1(n);)n=U1(n);return n||null}}function tu(e){return e instanceof Function?e():e}function H2(e,t,n){let r=e.length;for(;;){const i=e.indexOf(t,n);if(-1===i)return i;if(0===i||e.charCodeAt(i-1)<=32){const o=t.length;if(i+o===r||e.charCodeAt(i+o)<=32)return i}n=i+1}}const G2="ng-template";function nz(e,t,n){let r=0;for(;ro?"":i[D+1].toLowerCase();const P=8&r?I:null;if(P&&-1!==H2(P,v,0)||2&r&&v!==I){if(hl(r))return!1;c=!0}}}}else{if(!c&&!hl(r)&&!hl(p))return!1;if(c&&hl(p))continue;c=!1,r=p|1&r}}return hl(r)||c}function hl(e){return 0==(1&e)}function oz(e,t,n,r){if(null===t)return-1;let i=0;if(r||!n){let o=!1;for(;i-1)for(n++;n0?'="'+d+'"':"")+"]"}else 8&r?i+="."+c:4&r&&(i+=" "+c);else""!==i&&!hl(c)&&(t+=W2(o,i),i=""),r=c,o=o||!hl(r);n++}return""!==i&&(t+=W2(o,i)),t}const tn={};function Qi(e){X2(en(),He(),Le()+e,!1)}function X2(e,t,n,r){if(!r)if(3==(3&t[2])){const o=e.preOrderCheckHooks;null!==o&&on(t,o,n)}else{const o=e.preOrderHooks;null!==o&&Fn(t,o,0,n)}Ne(n)}function Q2(e,t=null,n=null,r){const i=eM(e,t,n,r);return i.resolveInjectorInitializers(),i}function eM(e,t=null,n=null,r,i=new Set){const o=[n||Cn,zg(e)];return r=r||("object"==typeof e?void 0:Mn(e)),new $g(o,t||ac(),r||null,i)}let Ys=(()=>{class e{static create(n,r){if(Array.isArray(n))return Q2({name:""},r,n,"");{const i=n.name??"";return Q2({name:i},n.parent,n.providers,i)}}}return e.THROW_IF_NOT_FOUND=il,e.NULL=new wp,e.\u0275prov=Ot({token:e,providedIn:"any",factory:()=>St(xa)}),e.__NG_ELEMENT_ID__=-1,e})();function qe(e,t=Rt.Default){const n=He();return null===n?St(e,t):Km(Pr(),n,Mt(e),t)}function q1(){throw new Error("invalid")}function yM(e,t){const n=e.contentQueries;if(null!==n)for(let r=0;r22&&X2(e,t,22,!1),n(r,i)}finally{Ne(o)}}function ow(e,t,n){!qc()||(function Kz(e,t,n,r){const i=n.directiveStart,o=n.directiveEnd;e.firstCreatePass||lh(n,t),ui(r,t);const c=n.initialInputs;for(let d=i;d0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(d)!=p&&d.push(p),d.push(r,i,c)}}function SM(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function MM(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function t8(e,t,n){if(n){if(t.exportAs)for(let r=0;r0&&uw(n)}}function uw(e){for(let r=_h(e);null!==r;r=qd(r))for(let i=10;i0&&uw(o)}const n=e[1].components;if(null!==n)for(let r=0;r0&&uw(i)}}function l8(e,t){const n=Mi(t,e),r=n[1];(function c8(e,t){for(let n=t.length;n-1&&(Zd(t,r),ep(n,r))}this._attachedToViewContainer=!1}xr(this._lView[1],this._lView)}onDestroy(t){xM(this._lView[1],this._lView,null,t)}markForCheck(){hw(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-65}reattach(){this._lView[2]|=64}detectChanges(){xv(this._lView[1],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new nt(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function T1(e,t){sl(e,t,t[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new nt(902,!1);this._appRef=t}}class u8 extends Gg{constructor(t){super(t),this._view=t}detectChanges(){const t=this._view;xv(t[1],t,t[8],!1)}checkNoChanges(){}get context(){return null}}class pw extends jg{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const n=Nt(t);return new qg(n,this.ngModule)}}function OM(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}class d8{constructor(t,n){this.injector=t,this.parentInjector=n}get(t,n,r){const i=this.injector.get(t,B1,r);return i!==B1||n===B1?i:this.parentInjector.get(t,n,r)}}class qg extends V2{constructor(t,n){super(),this.componentDef=t,this.ngModule=n,this.componentType=t.type,this.selector=function hz(e){return e.map(uz).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!n}get inputs(){return OM(this.componentDef.inputs)}get outputs(){return OM(this.componentDef.outputs)}create(t,n,r,i){let o=(i=i||this.ngModule)instanceof Ts?i:i?.injector;o&&null!==this.componentDef.getStandaloneInjector&&(o=this.componentDef.getStandaloneInjector(o)||o);const c=o?new d8(t,o):t,d=c.get($2,null);if(null===d)throw new nt(407,!1);const p=c.get(H6,null),v=d.createRenderer(null,this.componentDef),C=this.componentDef.selectors[0][0]||"div",D=r?function Gz(e,t,n){return e.selectRootElement(t,n===ys.ShadowDom)}(v,r,this.componentDef.encapsulation):pp(v,C,function h8(e){const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":null}(C)),I=this.componentDef.onPush?288:272,P=aw(0,null,null,1,0,null,null,null,null,null),N=_v(null,P,null,I,null,null,d,v,p,c,null);let G,U;_e(N);try{const Z=function m8(e,t,n,r,i,o){const c=n[1];n[22]=e;const p=Ip(c,22,2,"#host",null),v=p.mergedAttrs=t.hostAttrs;null!==v&&(wv(p,v,!0),null!==e&&(Yr(i,e,v),null!==p.classes&&xh(i,e,p.classes),null!==p.styles&&bp(i,e,p.styles)));const C=r.createRenderer(e,t),D=_v(n,bM(t),null,t.onPush?32:16,n[22],p,r,C,o||null,null,null);return c.firstCreatePass&&(Td(lh(p,n),c,t.type),MM(c,p),IM(p,n.length,1)),bv(n,D),n[22]=D}(D,this.componentDef,N,d,v);if(D)if(r)Yr(v,D,["ng-version",G6.full]);else{const{attrs:ne,classes:X}=function dz(e){const t=[],n=[];let r=1,i=2;for(;r0&&xh(v,D,X.join(" "))}if(U=Zl(P,22),void 0!==n){const ne=U.projection=[];for(let X=0;Xd(Sr(fe[r.index])):r.index;let re=null;if(!d&&p&&(re=function F8(e,t,n,r){const i=e.cleanup;if(null!=i)for(let o=0;op?d[p]:null}"string"==typeof c&&(o+=2)}return null}(e,t,i,r.index)),null!==re)(re.__ngLastListenerFn__||re).__ngNextListenerFn__=o,re.__ngLastListenerFn__=o,P=!1;else{o=KM(r,t,D,o,!1);const fe=n.listen(Z,i,o);I.push(o,fe),C&&C.push(i,X,ne,ne+1)}}else o=KM(r,t,D,o,!1);const N=r.outputs;let G;if(P&&null!==N&&(G=N[i])){const U=G.length;if(U)for(let Z=0;Z0;)t=t[15],e--;return t}(e,Vt.lFrame.contextLView))[8]}(e)}function Ri(e,t=""){const n=He(),r=en(),i=e+22,o=r.firstCreatePass?Ip(r,i,1,t,null):r.data[i],c=n[i]=function rc(e,t){return e.createText(t)}(n[11],t);Wd(r,n,c,o),ws(o,!1)}function nf(e){return Dh("",e,""),nf}function Dh(e,t,n){const r=He(),i=function kp(e,t,n,r){return Bo(e,w(),n)?t+$t(n)+r:tn}(r,e,t,n);return i!==tn&&ru(r,Le(),i),Dh}const rf=void 0;var xB=["en",[["a","p"],["AM","PM"],rf],[["AM","PM"],rf,rf],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],rf,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],rf,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",rf,"{1} 'at' {0}",rf],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function bB(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let $p={};function os(e){const t=function wB(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=UI(t);if(n)return n;const r=t.split("-")[0];if(n=UI(r),n)return n;if("en"===r)return xB;throw new nt(701,!1)}function UI(e){return e in $p||($p[e]=er.ng&&er.ng.common&&er.ng.common.locales&&er.ng.common.locales[e]),$p[e]}var vt=(()=>((vt=vt||{})[vt.LocaleId=0]="LocaleId",vt[vt.DayPeriodsFormat=1]="DayPeriodsFormat",vt[vt.DayPeriodsStandalone=2]="DayPeriodsStandalone",vt[vt.DaysFormat=3]="DaysFormat",vt[vt.DaysStandalone=4]="DaysStandalone",vt[vt.MonthsFormat=5]="MonthsFormat",vt[vt.MonthsStandalone=6]="MonthsStandalone",vt[vt.Eras=7]="Eras",vt[vt.FirstDayOfWeek=8]="FirstDayOfWeek",vt[vt.WeekendRange=9]="WeekendRange",vt[vt.DateFormat=10]="DateFormat",vt[vt.TimeFormat=11]="TimeFormat",vt[vt.DateTimeFormat=12]="DateTimeFormat",vt[vt.NumberSymbols=13]="NumberSymbols",vt[vt.NumberFormats=14]="NumberFormats",vt[vt.CurrencyCode=15]="CurrencyCode",vt[vt.CurrencySymbol=16]="CurrencySymbol",vt[vt.CurrencyName=17]="CurrencyName",vt[vt.Currencies=18]="Currencies",vt[vt.Directionality=19]="Directionality",vt[vt.PluralCase=20]="PluralCase",vt[vt.ExtraData=21]="ExtraData",vt))();const jp="en-US";let $I=jp;class sf{}class pT{}class mT extends sf{constructor(t,n){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new pw(this);const r=cn(t);this._bootstrapComponents=tu(r.bootstrap),this._r3Injector=eM(t,n,[{provide:sf,useValue:this},{provide:jg,useValue:this.componentFactoryResolver}],Mn(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Tw extends pT{constructor(t){super(),this.moduleType=t}create(t){return new mT(this.moduleType,t)}}class xV extends sf{constructor(t,n,r){super(),this.componentFactoryResolver=new pw(this),this.instance=null;const i=new $g([...t,{provide:sf,useValue:this},{provide:jg,useValue:this.componentFactoryResolver}],n||ac(),r,new Set(["environment"]));this.injector=i,i.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function Rv(e,t,n=null){return new xV(e,t,n).injector}let wV=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n.id)){const r=Bg(0,n.type),i=r.length>0?Rv([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n.id,i)}return this.cachedInjectors.get(n.id)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}}return e.\u0275prov=Ot({token:e,providedIn:"environment",factory:()=>new e(St(Ts))}),e})();function gT(e){e.getStandaloneInjector=t=>t.get(wV).getOrCreateStandaloneInjector(e)}function kw(e,t,n,r){return function CT(e,t,n,r,i,o){const c=t+n;return Bo(e,c,i)?cc(e,c+1,o?r.call(o,i):r(i)):ny(e,c+1)}(He(),h(),e,t,n,r)}function ny(e,t){const n=e[t];return n===tn?void 0:n}function ET(e,t,n,r,i,o,c){const d=t+n;return function tf(e,t,n,r){const i=Bo(e,t,n);return Bo(e,t+1,r)||i}(e,d,i,o)?cc(e,d+2,c?r.call(c,i,o):r(i,o)):ny(e,d+2)}function Pw(e,t){const n=en();let r;const i=e+22;n.firstCreatePass?(r=function VV(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(i,r.onDestroy)):r=n.data[i];const o=r.factory||(r.factory=bs(r.type)),c=uo(qe);try{const d=Mr(!1),p=o();return Mr(d),function A8(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,He(),i,p),p}finally{uo(c)}}function Rw(e,t,n,r){const i=e+22,o=He(),c=function pa(e,t){return e[t]}(o,i);return function ry(e,t){return e[1].data[t].pure}(o,i)?ET(o,h(),t,c.transform,n,r,c):c.transform(n,r)}function Fw(e){return t=>{setTimeout(e,void 0,t)}}const Qr=class GV extends oi{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,n,r){let i=t,o=n||(()=>null),c=r;if(t&&"object"==typeof t){const p=t;i=p.next?.bind(p),o=p.error?.bind(p),c=p.complete?.bind(p)}this.__isAsync&&(o=Fw(o),i&&(i=Fw(i)),c&&(c=Fw(c)));const d=super.subscribe({next:i,error:o,complete:c});return t instanceof vr&&t.add(d),d}};function qV(){return this._results[ef()]()}class Ow{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const n=ef(),r=Ow.prototype;r[n]||(r[n]=qV)}get changes(){return this._changes||(this._changes=new Qr)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){const r=this;r.dirty=!1;const i=_o(t);(this._changesDetected=!function rg(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r{class e{}return e.__NG_ELEMENT_ID__=XV,e})();const ZV=iu,WV=class extends ZV{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}createEmbeddedView(t,n){const r=this._declarationTContainer.tViews,i=_v(this._declarationLView,r,t,16,null,r.declTNode,null,null,null,null,n||null);i[17]=this._declarationLView[this._declarationTContainer.index];const c=this._declarationLView[19];return null!==c&&(i[19]=c.createEmbeddedView(r)),iw(r,i,t),new Gg(i)}};function XV(){return Fv(Pr(),He())}function Fv(e,t){return 4&e.type?new WV(t,e,Ep(e,t)):null}let gl=(()=>{class e{}return e.__NG_ELEMENT_ID__=YV,e})();function YV(){return AT(Pr(),He())}const KV=gl,IT=class extends KV{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Ep(this._hostTNode,this._hostLView)}get injector(){return new va(this._hostTNode,this._hostLView)}get parentInjector(){const t=ch(this._hostTNode,this._hostLView);if(ya(t)){const n=Cs(t,this._hostLView),r=Zs(t);return new va(n[1].data[r+8],n)}return new va(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=TT(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,n,r){let i,o;"number"==typeof r?i=r:null!=r&&(i=r.index,o=r.injector);const c=t.createEmbeddedView(n||{},o);return this.insert(c,i),c}createComponent(t,n,r,i,o){const c=t&&!function Rd(e){return"function"==typeof e}(t);let d;if(c)d=n;else{const D=n||{};d=D.index,r=D.injector,i=D.projectableNodes,o=D.environmentInjector||D.ngModuleRef}const p=c?t:new qg(Nt(t)),v=r||this.parentInjector;if(!o&&null==p.ngModule){const I=(c?v:this.parentInjector).get(Ts,null);I&&(o=I)}const C=p.create(v,i,void 0,o);return this.insert(C.hostView,d),C}insert(t,n){const r=t._lView,i=r[1];if(function th(e){return po(e[3])}(r)){const C=this.indexOf(t);if(-1!==C)this.detach(C);else{const D=r[3],I=new IT(D,D[6],D[3]);I.detach(I.indexOf(t))}}const o=this._adjustIndex(n),c=this._lContainer;!function k1(e,t,n,r){const i=10+r,o=n.length;r>0&&(n[i-1][4]=t),r0)r.push(c[d/2]);else{const v=o[d+1],C=t[-p];for(let D=10;D{class e{constructor(n){this.appInits=n,this.resolve=Lv,this.reject=Lv,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const n=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i{o.subscribe({complete:d,error:p})});n.push(c)}}Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),0===n.length&&r(),this.initialized=!0}}return e.\u0275fac=function(n){return new(n||e)(St(Nv,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const oy=new It("AppId",{providedIn:"root",factory:function eA(){return`${Zw()}${Zw()}${Zw()}`}});function Zw(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const tA=new It("Platform Initializer"),Ww=new It("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),nA=new It("appBootstrapListener");let SU=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();const ou=new It("LocaleId",{providedIn:"root",factory:()=>Fr(ou,Rt.Optional|Rt.SkipSelf)||function MU(){return typeof $localize<"u"&&$localize.locale||jp}()});class TU{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let Xw=(()=>{class e{compileModuleSync(n){return new Tw(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),o=tu(cn(n).declarations).reduce((c,d)=>{const p=Nt(d);return p&&c.push(new qg(p)),c},[]);return new TU(r,o)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const PU=(()=>Promise.resolve(0))();function Yw(e){typeof Zone>"u"?PU.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class Fi{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Qr(!1),this.onMicrotaskEmpty=new Qr(!1),this.onStable=new Qr(!1),this.onError=new Qr(!1),typeof Zone>"u")throw new nt(908,!1);Zone.assertZonePatched();const i=this;if(i._nesting=0,i._outer=i._inner=Zone.current,Zone.AsyncStackTaggingZoneSpec){const o=Zone.AsyncStackTaggingZoneSpec;i._inner=i._inner.fork(new o("Angular"))}Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&n,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function RU(){let e=er.requestAnimationFrame,t=er.cancelAnimationFrame;if(typeof Zone<"u"&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function LU(e){const t=()=>{!function OU(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(er,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Jw(e),e.isCheckStableRunning=!0,Kw(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Jw(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,i,o,c,d)=>{try{return oA(e),n.invokeTask(i,o,c,d)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===o.type||e.shouldCoalesceRunChangeDetection)&&t(),sA(e)}},onInvoke:(n,r,i,o,c,d,p)=>{try{return oA(e),n.invoke(i,o,c,d,p)}finally{e.shouldCoalesceRunChangeDetection&&t(),sA(e)}},onHasTask:(n,r,i,o)=>{n.hasTask(i,o),r===i&&("microTask"==o.change?(e._hasPendingMicrotasks=o.microTask,Jw(e),Kw(e)):"macroTask"==o.change&&(e.hasPendingMacrotasks=o.macroTask))},onHandleError:(n,r,i,o)=>(n.handleError(i,o),e.runOutsideAngular(()=>e.onError.emit(o)),!1)})}(i)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Fi.isInAngularZone())throw new nt(909,!1)}static assertNotInAngularZone(){if(Fi.isInAngularZone())throw new nt(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,i){const o=this._inner,c=o.scheduleEventTask("NgZoneEvent: "+i,t,FU,Lv,Lv);try{return o.runTask(c,n,r)}finally{o.cancelTask(c)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const FU={};function Kw(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Jw(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function oA(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function sA(e){e._nesting--,Kw(e)}class NU{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Qr,this.onMicrotaskEmpty=new Qr,this.onStable=new Qr,this.onError=new Qr}run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,i){return t.apply(n,r)}}const aA=new It(""),Bv=new It("");let tC,Qw=(()=>{class e{constructor(n,r,i){this._ngZone=n,this.registry=r,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,tC||(function zU(e){tC=e}(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Fi.assertNotInAngularZone(),Yw(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Yw(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb(this._didWork)}this._didWork=!1});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(c=>c.timeoutId!==o),n(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:n,timeoutId:o,updateCb:i})}whenStable(n,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}}return e.\u0275fac=function(n){return new(n||e)(St(Fi),St(eC),St(Bv))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),eC=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return tC?.findTestabilityInTree(this,n,r)??null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})(),Ih=null;const lA=new It("AllowMultipleToken"),nC=new It("PlatformDestroyListeners");class cA{constructor(t,n){this.name=t,this.token=n}}function hA(e,t,n=[]){const r=`Platform: ${t}`,i=new It(r);return(o=[])=>{let c=rC();if(!c||c.injector.get(lA,!1)){const d=[...n,...o,{provide:i,useValue:!0}];e?e(d):function UU(e){if(Ih&&!Ih.get(lA,!1))throw new nt(400,!1);Ih=e;const t=e.get(fA);(function uA(e){const t=e.get(tA,null);t&&t.forEach(n=>n())})(e)}(function dA(e=[],t){return Ys.create({name:t,providers:[{provide:wh,useValue:"platform"},{provide:nC,useValue:new Set([()=>Ih=null])},...e]})}(d,r))}return function jU(e){const t=rC();if(!t)throw new nt(401,!1);return t}()}}function rC(){return Ih?.get(fA)??null}let fA=(()=>{class e{constructor(n){this._injector=n,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(n,r){const i=function mA(e,t){let n;return n="noop"===e?new NU:("zone.js"===e?void 0:e)||new Fi(t),n}(r?.ngZone,function pA(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!(!e||!e.ngZoneEventCoalescing)||!1,shouldCoalesceRunChangeDetection:!(!e||!e.ngZoneRunCoalescing)||!1}}(r)),o=[{provide:Fi,useValue:i}];return i.run(()=>{const c=Ys.create({providers:o,parent:this.injector,name:n.moduleType.name}),d=n.create(c),p=d.injector.get(Dp,null);if(!p)throw new nt(402,!1);return i.runOutsideAngular(()=>{const v=i.onError.subscribe({next:C=>{p.handleError(C)}});d.onDestroy(()=>{Uv(this._modules,d),v.unsubscribe()})}),function gA(e,t,n){try{const r=n();return Xg(r)?r.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(p,i,()=>{const v=d.injector.get(zv);return v.runInitializers(),v.donePromise.then(()=>(function jI(e){$i(e,"Expected localeId to be defined"),"string"==typeof e&&($I=e.toLowerCase().replace(/_/g,"-"))}(d.injector.get(ou,jp)||jp),this._moduleDoBootstrap(d),d))})})}bootstrapModule(n,r=[]){const i=yA({},r);return function BU(e,t,n){const r=new Tw(n);return Promise.resolve(r)}(0,0,n).then(o=>this.bootstrapModuleFactory(o,i))}_moduleDoBootstrap(n){const r=n.injector.get(Vv);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!n.instance.ngDoBootstrap)throw new nt(403,!1);n.instance.ngDoBootstrap(r)}this._modules.push(n)}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new nt(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());const n=this._injector.get(nC,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(n){return new(n||e)(St(Ys))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();function yA(e,t){return Array.isArray(t)?t.reduce(yA,e):{...e,...t}}let Vv=(()=>{class e{constructor(n,r,i){this._zone=n,this._injector=r,this._exceptionHandler=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this._destroyed=!1,this._destroyListeners=[],this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new Nn(d=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{d.next(this._stable),d.complete()})}),c=new Nn(d=>{let p;this._zone.runOutsideAngular(()=>{p=this._zone.onStable.subscribe(()=>{Fi.assertNotInAngularZone(),Yw(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,d.next(!0))})})});const v=this._zone.onUnstable.subscribe(()=>{Fi.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{d.next(!1)}))});return()=>{p.unsubscribe(),v.unsubscribe()}});this.isStable=function zl(...e){const t=ar(e),n=function si(e,t){return"number"==typeof an(e)?e.pop():t}(e,1/0),r=e;return r.length?1===r.length?te(r[0]):ft(n)(Cr(r,t)):xt}(o,c.pipe(function Jh(e={}){const{connector:t=(()=>new oi),resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=e;return o=>{let c,d,p,v=0,C=!1,D=!1;const I=()=>{d?.unsubscribe(),d=void 0},P=()=>{I(),c=p=void 0,C=D=!1},N=()=>{const G=c;P(),G?.unsubscribe()};return yr((G,U)=>{v++,!D&&!C&&I();const Z=p=p??t();U.add(()=>{v--,0===v&&!D&&!C&&(d=Bl(N,i))}),Z.subscribe(U),!c&&v>0&&(c=new oo({next:ne=>Z.next(ne),error:ne=>{D=!0,I(),d=Bl(P,n,ne),Z.error(ne)},complete:()=>{C=!0,I(),d=Bl(P,r),Z.complete()}}),te(G).subscribe(c))})(o)}}()))}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(n,r){const i=n instanceof V2;if(!this._injector.get(zv).done)throw!i&&function Us(e){const t=Nt(e)||Xr(e)||kt(e);return null!==t&&t.standalone}(n),new nt(405,false);let c;c=i?n:this._injector.get(jg).resolveComponentFactory(n),this.componentTypes.push(c.componentType);const d=function VU(e){return e.isBoundToModule}(c)?void 0:this._injector.get(sf),v=c.create(Ys.NULL,[],r||c.selector,d),C=v.location.nativeElement,D=v.injector.get(aA,null);return D?.registerApplication(C),v.onDestroy(()=>{this.detachView(v.hostView),Uv(this.components,v),D?.unregisterApplication(C)}),this._loadComponent(v),v}tick(){if(this._runningTick)throw new nt(101,!1);try{this._runningTick=!0;for(let n of this._views)n.detectChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;Uv(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n),this._injector.get(nA,[]).concat(this._bootstrapListeners).forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Uv(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new nt(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return e.\u0275fac=function(n){return new(n||e)(St(Fi),St(Ts),St(Dp))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Uv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let vA=!0,sy=(()=>{class e{}return e.__NG_ELEMENT_ID__=qU,e})();function qU(e){return function ZU(e,t,n){if(Zu(e)&&!n){const r=Mi(e.index,t);return new Gg(r,r)}return 47&e.type?new Gg(t[16],t):null}(Pr(),He(),16==(16&e))}class EA{constructor(){}supports(t){return Zg(t)}create(t){return new QU(t)}}const JU=(e,t)=>t;class QU{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||JU}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,i=0,o=null;for(;n||r;){const c=!r||n&&n.currentIndex{c=this._trackByFn(i,d),null!==n&&Object.is(n.trackById,c)?(r&&(n=this._verifyReinsertion(n,d,c,i)),Object.is(n.item,d)||this._addIdentityChange(n,d)):(n=this._mismatch(n,d,c,i),r=!0),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,i){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,o,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,o,i)):t=this._addAfter(new e$(n,r),o,i),t}_verifyReinsertion(t,n,r,i){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==o?t=this._reinsertAfter(o,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,o=t._nextRemoved;return null===i?this._removalsHead=o:i._nextRemoved=o,null===o?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const i=null===n?this._itHead:n._next;return t._next=i,t._prev=n,null===i?this._itTail=t:i._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new DA),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new DA),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class e${constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class t${constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class DA{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new t$,this.map.set(n,r)),r.add(t)}get(t,n){const i=this.map.get(t);return i?i.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function SA(e,t,n){const r=e.previousIndex;if(null===r)return r;let i=0;return n&&r{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const o=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const i=this._records.get(t);this._maybeAddToChanges(i,n);const o=i._prev,c=i._next;return o&&(o._next=c),c&&(c._prev=o),i._next=null,i._prev=null,i}const r=new r$(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class r${constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function IA(){return new Hv([new EA])}let Hv=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(null!=r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||IA()),deps:[[e,new Tr,new Bd]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(null!=r)return r;throw new nt(901,!1)}}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:IA}),e})();function TA(){return new ay([new MA])}let ay=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||TA()),deps:[[e,new Tr,new Bd]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(r)return r;throw new nt(901,!1)}}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:TA}),e})();const s$=hA(null,"core",[]);let a$=(()=>{class e{constructor(n){}}return e.\u0275fac=function(n){return new(n||e)(St(Vv))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})(),Gv=null;function fc(){return Gv}const as=new It("DocumentToken");let lC=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return function h$(){return St(AA)}()},providedIn:"platform"}),e})();const d$=new It("Location Initialized");let AA=(()=>{class e extends lC{constructor(n){super(),this._doc=n,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return fc().getBaseHref(this._doc)}onPopState(n){const r=fc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){const r=fc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",n,!1),()=>r.removeEventListener("hashchange",n)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(n){this.location.pathname=n}pushState(n,r,i){kA()?this._history.pushState(n,r,i):this.location.hash=i}replaceState(n,r,i){kA()?this._history.replaceState(n,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(n=0){this._history.go(n)}getState(){return this._history.state}}return e.\u0275fac=function(n){return new(n||e)(St(as))},e.\u0275prov=Ot({token:e,factory:function(){return function f$(){return new AA(St(as))}()},providedIn:"platform"}),e})();function kA(){return!!window.history.pushState}function cC(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function PA(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function lu(e){return e&&"?"!==e[0]?"?"+e:e}let lf=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return Fr(FA)},providedIn:"root"}),e})();const RA=new It("appBaseHref");let FA=(()=>{class e extends lf{constructor(n,r){super(),this._platformLocation=n,this._removeListenerFns=[],this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Fr(as).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}prepareExternalUrl(n){return cC(this._baseHref,n)}path(n=!1){const r=this._platformLocation.pathname+lu(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,o){const c=this.prepareExternalUrl(i+lu(o));this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,o){const c=this.prepareExternalUrl(i+lu(o));this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(lC),St(RA,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),p$=(()=>{class e extends lf{constructor(n,r){super(),this._platformLocation=n,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}path(n=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(n){const r=cC(this._baseHref,n);return r.length>0?"#"+r:r}pushState(n,r,i,o){let c=this.prepareExternalUrl(i+lu(o));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,o){let c=this.prepareExternalUrl(i+lu(o));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(lC),St(RA,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),uC=(()=>{class e{constructor(n){this._subject=new Qr,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=n;const r=this._locationStrategy.getBaseHref();this._baseHref=PA(OA(r)),this._locationStrategy.onPopState(i=>{this._subject.emit({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(n=!1){return this.normalize(this._locationStrategy.path(n))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(n,r=""){return this.path()==this.normalize(n+lu(r))}normalize(n){return e.stripTrailingSlash(function g$(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,OA(n)))}prepareExternalUrl(n){return n&&"/"!==n[0]&&(n="/"+n),this._locationStrategy.prepareExternalUrl(n)}go(n,r="",i=null){this._locationStrategy.pushState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(n=0){this._locationStrategy.historyGo?.(n)}onUrlChange(n){return this._urlChangeListeners.push(n),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)})),()=>{const r=this._urlChangeListeners.indexOf(n);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(n="",r){this._urlChangeListeners.forEach(i=>i(n,r))}subscribe(n,r,i){return this._subject.subscribe({next:n,error:r,complete:i})}}return e.normalizeQueryParams=lu,e.joinWithSlash=cC,e.stripTrailingSlash=PA,e.\u0275fac=function(n){return new(n||e)(St(lf))},e.\u0275prov=Ot({token:e,factory:function(){return function m$(){return new uC(St(lf))}()},providedIn:"root"}),e})();function OA(e){return e.replace(/\/index.html$/,"")}var hi=(()=>((hi=hi||{})[hi.Format=0]="Format",hi[hi.Standalone=1]="Standalone",hi))(),kn=(()=>((kn=kn||{})[kn.Narrow=0]="Narrow",kn[kn.Abbreviated=1]="Abbreviated",kn[kn.Wide=2]="Wide",kn[kn.Short=3]="Short",kn))(),Hr=(()=>((Hr=Hr||{})[Hr.Short=0]="Short",Hr[Hr.Medium=1]="Medium",Hr[Hr.Long=2]="Long",Hr[Hr.Full=3]="Full",Hr))(),Ut=(()=>((Ut=Ut||{})[Ut.Decimal=0]="Decimal",Ut[Ut.Group=1]="Group",Ut[Ut.List=2]="List",Ut[Ut.PercentSign=3]="PercentSign",Ut[Ut.PlusSign=4]="PlusSign",Ut[Ut.MinusSign=5]="MinusSign",Ut[Ut.Exponential=6]="Exponential",Ut[Ut.SuperscriptingExponent=7]="SuperscriptingExponent",Ut[Ut.PerMille=8]="PerMille",Ut[Ut.Infinity=9]="Infinity",Ut[Ut.NaN=10]="NaN",Ut[Ut.TimeSeparator=11]="TimeSeparator",Ut[Ut.CurrencyDecimal=12]="CurrencyDecimal",Ut[Ut.CurrencyGroup=13]="CurrencyGroup",Ut))();function qv(e,t){return Ea(os(e)[vt.DateFormat],t)}function Zv(e,t){return Ea(os(e)[vt.TimeFormat],t)}function Wv(e,t){return Ea(os(e)[vt.DateTimeFormat],t)}function Ca(e,t){const n=os(e),r=n[vt.NumberSymbols][t];if(typeof r>"u"){if(t===Ut.CurrencyDecimal)return n[vt.NumberSymbols][Ut.Decimal];if(t===Ut.CurrencyGroup)return n[vt.NumberSymbols][Ut.Group]}return r}function NA(e){if(!e[vt.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[vt.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Ea(e,t){for(let n=t;n>-1;n--)if(typeof e[n]<"u")return e[n];throw new Error("Locale data API: locale data undefined")}function dC(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const T$=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,ly={},A$=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var Oi=(()=>((Oi=Oi||{})[Oi.Short=0]="Short",Oi[Oi.ShortGMT=1]="ShortGMT",Oi[Oi.Long=2]="Long",Oi[Oi.Extended=3]="Extended",Oi))(),Gt=(()=>((Gt=Gt||{})[Gt.FullYear=0]="FullYear",Gt[Gt.Month=1]="Month",Gt[Gt.Date=2]="Date",Gt[Gt.Hours=3]="Hours",Gt[Gt.Minutes=4]="Minutes",Gt[Gt.Seconds=5]="Seconds",Gt[Gt.FractionalSeconds=6]="FractionalSeconds",Gt[Gt.Day=7]="Day",Gt))(),un=(()=>((un=un||{})[un.DayPeriods=0]="DayPeriods",un[un.Days=1]="Days",un[un.Months=2]="Months",un[un.Eras=3]="Eras",un))();function k$(e,t,n,r){let i=function V$(e){if(VA(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[i,o=1,c=1]=e.split("-").map(d=>+d);return Xv(i,o-1,c)}const n=parseFloat(e);if(!isNaN(e-n))return new Date(n);let r;if(r=e.match(T$))return function U$(e){const t=new Date(0);let n=0,r=0;const i=e[8]?t.setUTCFullYear:t.setFullYear,o=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const c=Number(e[4]||0)-n,d=Number(e[5]||0)-r,p=Number(e[6]||0),v=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return o.call(t,c,d,p,v),t}(r)}const t=new Date(e);if(!VA(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=cu(n,t)||t;let d,c=[];for(;t;){if(d=A$.exec(t),!d){c.push(t);break}{c=c.concat(d.slice(1));const C=c.pop();if(!C)break;t=C}}let p=i.getTimezoneOffset();r&&(p=BA(r,p),i=function B$(e,t,n){const r=n?-1:1,i=e.getTimezoneOffset();return function z$(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,r*(BA(t,i)-i))}(i,r,!0));let v="";return c.forEach(C=>{const D=function N$(e){if(pC[e])return pC[e];let t;switch(e){case"G":case"GG":case"GGG":t=Ir(un.Eras,kn.Abbreviated);break;case"GGGG":t=Ir(un.Eras,kn.Wide);break;case"GGGGG":t=Ir(un.Eras,kn.Narrow);break;case"y":t=vi(Gt.FullYear,1,0,!1,!0);break;case"yy":t=vi(Gt.FullYear,2,0,!0,!0);break;case"yyy":t=vi(Gt.FullYear,3,0,!1,!0);break;case"yyyy":t=vi(Gt.FullYear,4,0,!1,!0);break;case"Y":t=Qv(1);break;case"YY":t=Qv(2,!0);break;case"YYY":t=Qv(3);break;case"YYYY":t=Qv(4);break;case"M":case"L":t=vi(Gt.Month,1,1);break;case"MM":case"LL":t=vi(Gt.Month,2,1);break;case"MMM":t=Ir(un.Months,kn.Abbreviated);break;case"MMMM":t=Ir(un.Months,kn.Wide);break;case"MMMMM":t=Ir(un.Months,kn.Narrow);break;case"LLL":t=Ir(un.Months,kn.Abbreviated,hi.Standalone);break;case"LLLL":t=Ir(un.Months,kn.Wide,hi.Standalone);break;case"LLLLL":t=Ir(un.Months,kn.Narrow,hi.Standalone);break;case"w":t=fC(1);break;case"ww":t=fC(2);break;case"W":t=fC(1,!0);break;case"d":t=vi(Gt.Date,1);break;case"dd":t=vi(Gt.Date,2);break;case"c":case"cc":t=vi(Gt.Day,1);break;case"ccc":t=Ir(un.Days,kn.Abbreviated,hi.Standalone);break;case"cccc":t=Ir(un.Days,kn.Wide,hi.Standalone);break;case"ccccc":t=Ir(un.Days,kn.Narrow,hi.Standalone);break;case"cccccc":t=Ir(un.Days,kn.Short,hi.Standalone);break;case"E":case"EE":case"EEE":t=Ir(un.Days,kn.Abbreviated);break;case"EEEE":t=Ir(un.Days,kn.Wide);break;case"EEEEE":t=Ir(un.Days,kn.Narrow);break;case"EEEEEE":t=Ir(un.Days,kn.Short);break;case"a":case"aa":case"aaa":t=Ir(un.DayPeriods,kn.Abbreviated);break;case"aaaa":t=Ir(un.DayPeriods,kn.Wide);break;case"aaaaa":t=Ir(un.DayPeriods,kn.Narrow);break;case"b":case"bb":case"bbb":t=Ir(un.DayPeriods,kn.Abbreviated,hi.Standalone,!0);break;case"bbbb":t=Ir(un.DayPeriods,kn.Wide,hi.Standalone,!0);break;case"bbbbb":t=Ir(un.DayPeriods,kn.Narrow,hi.Standalone,!0);break;case"B":case"BB":case"BBB":t=Ir(un.DayPeriods,kn.Abbreviated,hi.Format,!0);break;case"BBBB":t=Ir(un.DayPeriods,kn.Wide,hi.Format,!0);break;case"BBBBB":t=Ir(un.DayPeriods,kn.Narrow,hi.Format,!0);break;case"h":t=vi(Gt.Hours,1,-12);break;case"hh":t=vi(Gt.Hours,2,-12);break;case"H":t=vi(Gt.Hours,1);break;case"HH":t=vi(Gt.Hours,2);break;case"m":t=vi(Gt.Minutes,1);break;case"mm":t=vi(Gt.Minutes,2);break;case"s":t=vi(Gt.Seconds,1);break;case"ss":t=vi(Gt.Seconds,2);break;case"S":t=vi(Gt.FractionalSeconds,1);break;case"SS":t=vi(Gt.FractionalSeconds,2);break;case"SSS":t=vi(Gt.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=Kv(Oi.Short);break;case"ZZZZZ":t=Kv(Oi.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=Kv(Oi.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=Kv(Oi.Long);break;default:return null}return pC[e]=t,t}(C);v+=D?D(i,n,p):"''"===C?"'":C.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),v}function Xv(e,t,n){const r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function cu(e,t){const n=function y$(e){return os(e)[vt.LocaleId]}(e);if(ly[n]=ly[n]||{},ly[n][t])return ly[n][t];let r="";switch(t){case"shortDate":r=qv(e,Hr.Short);break;case"mediumDate":r=qv(e,Hr.Medium);break;case"longDate":r=qv(e,Hr.Long);break;case"fullDate":r=qv(e,Hr.Full);break;case"shortTime":r=Zv(e,Hr.Short);break;case"mediumTime":r=Zv(e,Hr.Medium);break;case"longTime":r=Zv(e,Hr.Long);break;case"fullTime":r=Zv(e,Hr.Full);break;case"short":const i=cu(e,"shortTime"),o=cu(e,"shortDate");r=Yv(Wv(e,Hr.Short),[i,o]);break;case"medium":const c=cu(e,"mediumTime"),d=cu(e,"mediumDate");r=Yv(Wv(e,Hr.Medium),[c,d]);break;case"long":const p=cu(e,"longTime"),v=cu(e,"longDate");r=Yv(Wv(e,Hr.Long),[p,v]);break;case"full":const C=cu(e,"fullTime"),D=cu(e,"fullDate");r=Yv(Wv(e,Hr.Full),[C,D])}return r&&(ly[n][t]=r),r}function Yv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(n,r){return null!=t&&r in t?t[r]:n})),e}function _l(e,t,n="-",r,i){let o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=n));let c=String(e);for(;c.length0||d>-n)&&(d+=n),e===Gt.Hours)0===d&&-12===n&&(d=12);else if(e===Gt.FractionalSeconds)return function P$(e,t){return _l(e,3).substring(0,t)}(d,t);const p=Ca(c,Ut.MinusSign);return _l(d,t,p,r,i)}}function Ir(e,t,n=hi.Format,r=!1){return function(i,o){return function F$(e,t,n,r,i,o){switch(n){case un.Months:return function b$(e,t,n){const r=os(e),o=Ea([r[vt.MonthsFormat],r[vt.MonthsStandalone]],t);return Ea(o,n)}(t,i,r)[e.getMonth()];case un.Days:return function v$(e,t,n){const r=os(e),o=Ea([r[vt.DaysFormat],r[vt.DaysStandalone]],t);return Ea(o,n)}(t,i,r)[e.getDay()];case un.DayPeriods:const c=e.getHours(),d=e.getMinutes();if(o){const v=function E$(e){const t=os(e);return NA(t),(t[vt.ExtraData][2]||[]).map(r=>"string"==typeof r?dC(r):[dC(r[0]),dC(r[1])])}(t),C=function D$(e,t,n){const r=os(e);NA(r);const o=Ea([r[vt.ExtraData][0],r[vt.ExtraData][1]],t)||[];return Ea(o,n)||[]}(t,i,r),D=v.findIndex(I=>{if(Array.isArray(I)){const[P,N]=I,G=c>=P.hours&&d>=P.minutes,U=c0?Math.floor(i/60):Math.ceil(i/60);switch(e){case Oi.Short:return(i>=0?"+":"")+_l(c,2,o)+_l(Math.abs(i%60),2,o);case Oi.ShortGMT:return"GMT"+(i>=0?"+":"")+_l(c,1,o);case Oi.Long:return"GMT"+(i>=0?"+":"")+_l(c,2,o)+":"+_l(Math.abs(i%60),2,o);case Oi.Extended:return 0===r?"Z":(i>=0?"+":"")+_l(c,2,o)+":"+_l(Math.abs(i%60),2,o);default:throw new Error(`Unknown zone width "${e}"`)}}}function zA(e){return Xv(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function fC(e,t=!1){return function(n,r){let i;if(t){const o=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,c=n.getDate();i=1+Math.floor((c+o)/7)}else{const o=zA(n),c=function L$(e){const t=Xv(e,0,1).getDay();return Xv(e,0,1+(t<=4?4:11)-t)}(o.getFullYear()),d=o.getTime()-c.getTime();i=1+Math.round(d/6048e5)}return _l(i,e,Ca(r,Ut.MinusSign))}}function Qv(e,t=!1){return function(n,r){return _l(zA(n).getFullYear(),e,Ca(r,Ut.MinusSign),t)}}const pC={};function BA(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function VA(e){return e instanceof Date&&!isNaN(e.valueOf())}function HA(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const r=n.indexOf("="),[i,o]=-1==r?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===t)return decodeURIComponent(o)}return null}let GA=(()=>{class e{constructor(n,r,i,o){this._iterableDiffers=n,this._keyValueDiffers=r,this._ngEl=i,this._renderer=o,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(n){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof n?n.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(n){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof n?n.split(/\s+/):n,this._rawClass&&(Zg(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const n=this._iterableDiffer.diff(this._rawClass);n&&this._applyIterableChanges(n)}else if(this._keyValueDiffer){const n=this._keyValueDiffer.diff(this._rawClass);n&&this._applyKeyValueChanges(n)}}_applyKeyValueChanges(n){n.forEachAddedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachChangedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachRemovedItem(r=>{r.previousValue&&this._toggleClass(r.key,!1)})}_applyIterableChanges(n){n.forEachAddedItem(r=>{if("string"!=typeof r.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Mn(r.item)}`);this._toggleClass(r.item,!0)}),n.forEachRemovedItem(r=>this._toggleClass(r.item,!1))}_applyClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!0)):Object.keys(n).forEach(r=>this._toggleClass(r,!!n[r])))}_removeClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!1)):Object.keys(n).forEach(r=>this._toggleClass(r,!1)))}_toggleClass(n,r){(n=n.trim())&&n.split(/\s+/g).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}}return e.\u0275fac=function(n){return new(n||e)(qe(Hv),qe(ay),qe(Xs),qe(ul))},e.\u0275dir=Lt({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"},standalone:!0}),e})();class e7{constructor(t,n,r,i){this.$implicit=t,this.ngForOf=n,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let WA=(()=>{class e{constructor(n,r,i){this._viewContainer=n,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(n){this._ngForOf=n,this._ngForOfDirty=!0}set ngForTrackBy(n){this._trackByFn=n}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(n){n&&(this._template=n)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;!this._differ&&n&&(this._differ=this._differs.find(n).create(this.ngForTrackBy))}if(this._differ){const n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}}_applyChanges(n){const r=this._viewContainer;n.forEachOperation((i,o,c)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new e7(i.item,this._ngForOf,-1,-1),null===c?void 0:c);else if(null==c)r.remove(null===o?void 0:o);else if(null!==o){const d=r.get(o);r.move(d,c),XA(d,i)}});for(let i=0,o=r.length;i{XA(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(gl),qe(iu),qe(Hv))},e.\u0275dir=Lt({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),e})();function XA(e,t){e.context.$implicit=t.item}let YA=(()=>{class e{constructor(n,r){this._viewContainer=n,this._context=new n7,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(n){this._context.$implicit=this._context.ngIf=n,this._updateView()}set ngIfThen(n){KA("ngIfThen",n),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){KA("ngIfElse",n),this._elseTemplateRef=n,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(gl),qe(iu))},e.\u0275dir=Lt({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),e})();class n7{constructor(){this.$implicit=null,this.ngIf=null}}function KA(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Mn(t)}'.`)}const y7=new It("DATE_PIPE_DEFAULT_TIMEZONE");let wC=(()=>{class e{constructor(n,r){this.locale=n,this.defaultTimezone=r}transform(n,r="mediumDate",i,o){if(null==n||""===n||n!=n)return null;try{return k$(n,r,o||this.locale,i??this.defaultTimezone??void 0)}catch(c){throw function vl(e,t){return new nt(2100,!1)}()}}}return e.\u0275fac=function(n){return new(n||e)(qe(ou,16),qe(y7,24))},e.\u0275pipe=ji({name:"date",type:e,pure:!0,standalone:!0}),e})(),ek=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})();let k7=(()=>{class e{}return e.\u0275prov=Ot({token:e,providedIn:"root",factory:()=>new P7(St(as),window)}),e})();class P7{constructor(t,n){this.document=t,this.window=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(!this.supportsScrolling())return;const n=function R7(e,t){const n=e.getElementById(t)||e.getElementsByName(t)[0];if(n)return n;if("function"==typeof e.createTreeWalker&&e.body&&(e.body.createShadowRoot||e.body.attachShadow)){const r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const o=i.shadowRoot;if(o){const c=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(c)return c}i=r.nextNode()}}return null}(this.document,t);n&&(this.scrollToElement(n),n.focus())}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const n=this.window.history;n&&n.scrollRestoration&&(n.scrollRestoration=t)}}scrollToElement(t){const n=t.getBoundingClientRect(),r=n.left+this.window.pageXOffset,i=n.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(r-o[0],i-o[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=nk(this.window.history)||nk(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch{return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}function nk(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}class rk{}class MC extends class s9 extends class u${}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function c$(e){Gv||(Gv=e)}(new MC)}onAndCancel(t,n,r){return t.addEventListener(n,r,!1),()=>{t.removeEventListener(n,r,!1)}}dispatchEvent(t,n){t.dispatchEvent(n)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,n){return(n=n||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,n){return"window"===n?window:"document"===n?t:"body"===n?t.body:null}getBaseHref(t){const n=function a9(){return hy=hy||document.querySelector("base"),hy?hy.getAttribute("href"):null}();return null==n?null:function l9(e){r0=r0||document.createElement("a"),r0.setAttribute("href",e);const t=r0.pathname;return"/"===t.charAt(0)?t:`/${t}`}(n)}resetBaseElement(){hy=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return HA(document.cookie,t)}}let r0,hy=null;const lk=new It("TRANSITION_ID"),u9=[{provide:Nv,useFactory:function c9(e,t,n){return()=>{n.get(zv).donePromise.then(()=>{const r=fc(),i=t.querySelectorAll(`style[ng-transition="${e}"]`);for(let o=0;o{class e{build(){return new XMLHttpRequest}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const o0=new It("EventManagerPlugins");let s0=(()=>{class e{constructor(n,r){this._zone=r,this._eventNameToPlugin=new Map,n.forEach(i=>i.manager=this),this._plugins=n.slice().reverse()}addEventListener(n,r,i){return this._findPluginFor(r).addEventListener(n,r,i)}addGlobalEventListener(n,r,i){return this._findPluginFor(r).addGlobalEventListener(n,r,i)}getZone(){return this._zone}_findPluginFor(n){const r=this._eventNameToPlugin.get(n);if(r)return r;const i=this._plugins;for(let o=0;o{class e{constructor(){this._stylesSet=new Set}addStyles(n){const r=new Set;n.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(n){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),dy=(()=>{class e extends uk{constructor(n){super(),this._doc=n,this._hostNodes=new Map,this._hostNodes.set(n.head,[])}_addStylesToHost(n,r,i){n.forEach(o=>{const c=this._doc.createElement("style");c.textContent=o,i.push(r.appendChild(c))})}addHost(n){const r=[];this._addStylesToHost(this._stylesSet,n,r),this._hostNodes.set(n,r)}removeHost(n){const r=this._hostNodes.get(n);r&&r.forEach(hk),this._hostNodes.delete(n)}onStylesAdded(n){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(n,i,r)})}ngOnDestroy(){this._hostNodes.forEach(n=>n.forEach(hk))}}return e.\u0275fac=function(n){return new(n||e)(St(as))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();function hk(e){fc().remove(e)}const IC={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},TC=/%COMP%/g;function a0(e,t,n){for(let r=0;r{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let AC=(()=>{class e{constructor(n,r,i){this.eventManager=n,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new kC(n)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;switch(r.encapsulation){case ys.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new _9(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(n),i}case 1:case ys.ShadowDom:return new v9(this.eventManager,this.sharedStylesHost,n,r);default:if(!this.rendererByCompId.has(r.id)){const i=a0(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(n){return new(n||e)(St(s0),St(dy),St(oy))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();class kC{constructor(t){this.eventManager=t,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(t,n){return n?document.createElementNS(IC[n]||n,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,n){(gk(t)?t.content:t).appendChild(n)}insertBefore(t,n,r){t&&(gk(t)?t.content:t).insertBefore(n,r)}removeChild(t,n){t&&t.removeChild(n)}selectRootElement(t,n){let r="string"==typeof t?document.querySelector(t):t;if(!r)throw new Error(`The selector "${t}" did not match any elements`);return n||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,n,r,i){if(i){n=i+":"+n;const o=IC[i];o?t.setAttributeNS(o,n,r):t.setAttribute(n,r)}else t.setAttribute(n,r)}removeAttribute(t,n,r){if(r){const i=IC[r];i?t.removeAttributeNS(i,n):t.removeAttribute(`${r}:${n}`)}else t.removeAttribute(n)}addClass(t,n){t.classList.add(n)}removeClass(t,n){t.classList.remove(n)}setStyle(t,n,r,i){i&(Xi.DashCase|Xi.Important)?t.style.setProperty(n,r,i&Xi.Important?"important":""):t.style[n]=r}removeStyle(t,n,r){r&Xi.DashCase?t.style.removeProperty(n):t.style[n]=""}setProperty(t,n,r){t[n]=r}setValue(t,n){t.nodeValue=n}listen(t,n,r){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,n,pk(r)):this.eventManager.addEventListener(t,n,pk(r))}}function gk(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class _9 extends kC{constructor(t,n,r,i){super(t),this.component=r;const o=a0(i+"-"+r.id,r.styles,[]);n.addStyles(o),this.contentAttr=function m9(e){return"_ngcontent-%COMP%".replace(TC,e)}(i+"-"+r.id),this.hostAttr=function g9(e){return"_nghost-%COMP%".replace(TC,e)}(i+"-"+r.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,n){const r=super.createElement(t,n);return super.setAttribute(r,this.contentAttr,""),r}}class v9 extends kC{constructor(t,n,r,i){super(t),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const o=a0(i.id,i.styles,[]);for(let c=0;c{class e extends ck{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,i){return n.addEventListener(r,i,!1),()=>this.removeEventListener(n,r,i)}removeEventListener(n,r,i){return n.removeEventListener(r,i)}}return e.\u0275fac=function(n){return new(n||e)(St(as))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const yk=["alt","control","meta","shift"],x9={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},w9={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let C9=(()=>{class e extends ck{constructor(n){super(n)}supports(n){return null!=e.parseEventName(n)}addEventListener(n,r,i){const o=e.parseEventName(r),c=e.eventCallback(o.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>fc().onAndCancel(n,o.domEventName,c))}static parseEventName(n){const r=n.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const o=e._normalizeKey(r.pop());let c="",d=r.indexOf("code");if(d>-1&&(r.splice(d,1),c="code."),yk.forEach(v=>{const C=r.indexOf(v);C>-1&&(r.splice(C,1),c+=v+".")}),c+=o,0!=r.length||0===o.length)return null;const p={};return p.domEventName=i,p.fullKey=c,p}static matchEventFullKeyCode(n,r){let i=x9[n.key]||n.key,o="";return r.indexOf("code.")>-1&&(i=n.code,o="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),yk.forEach(c=>{c!==i&&(0,w9[c])(n)&&(o+=c+".")}),o+=i,o===r)}static eventCallback(n,r,i){return o=>{e.matchEventFullKeyCode(o,n)&&i.runGuarded(()=>r(o))}}static _normalizeKey(n){return"esc"===n?"escape":n}}return e.\u0275fac=function(n){return new(n||e)(St(as))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const M9=hA(s$,"browser",[{provide:Ww,useValue:"browser"},{provide:tA,useValue:function E9(){MC.makeCurrent()},multi:!0},{provide:as,useFactory:function S9(){return function x(e){_=e}(document),document},deps:[]}]),bk=new It(""),xk=[{provide:Bv,useClass:class h9{addToWindow(t){er.getAngularTestability=(r,i=!0)=>{const o=t.findTestabilityInTree(r,i);if(null==o)throw new Error("Could not find testability for element.");return o},er.getAllAngularTestabilities=()=>t.getAllTestabilities(),er.getAllAngularRootElements=()=>t.getAllRootElements(),er.frameworkStabilizers||(er.frameworkStabilizers=[]),er.frameworkStabilizers.push(r=>{const i=er.getAllAngularTestabilities();let o=i.length,c=!1;const d=function(p){c=c||p,o--,0==o&&r(c)};i.forEach(function(p){p.whenStable(d)})})}findTestabilityInTree(t,n,r){return null==n?null:t.getTestability(n)??(r?fc().isShadowRoot(n)?this.findTestabilityInTree(t,n.host,!0):this.findTestabilityInTree(t,n.parentElement,!0):null)}},deps:[]},{provide:aA,useClass:Qw,deps:[Fi,eC,Bv]},{provide:Qw,useClass:Qw,deps:[Fi,eC,Bv]}],wk=[{provide:wh,useValue:"root"},{provide:Dp,useFactory:function D9(){return new Dp},deps:[]},{provide:o0,useClass:b9,multi:!0,deps:[as,Fi,Ww]},{provide:o0,useClass:C9,multi:!0,deps:[as]},{provide:AC,useClass:AC,deps:[s0,dy,oy]},{provide:$2,useExisting:AC},{provide:uk,useExisting:dy},{provide:dy,useClass:dy,deps:[as]},{provide:s0,useClass:s0,deps:[o0,Fi]},{provide:rk,useClass:d9,deps:[]},[]];let I9=(()=>{class e{constructor(n){}static withServerTransition(n){return{ngModule:e,providers:[{provide:oy,useValue:n.appId},{provide:lk,useExisting:oy},u9]}}}return e.\u0275fac=function(n){return new(n||e)(St(bk,12))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[...wk,...xk],imports:[ek,a$]}),e})(),Ck=(()=>{class e{constructor(n){this._doc=n}getTitle(){return this._doc.title}setTitle(n){this._doc.title=n||""}}return e.\u0275fac=function(n){return new(n||e)(St(as))},e.\u0275prov=Ot({token:e,factory:function(n){let r=null;return r=n?new n:function A9(){return new Ck(St(as))}(),r},providedIn:"root"}),e})();function Bt(...e){return Cr(e,ar(e))}typeof window<"u"&&window;class bl extends oi{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const n=super._subscribe(t);return!n.closed&&t.next(this._value),n}getValue(){const{hasError:t,thrownError:n,_value:r}=this;if(t)throw n;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}}const l0=Kh(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:z9}=Array,{getPrototypeOf:B9,prototype:V9,keys:U9}=Object;const{isArray:j9}=Array;function Tk(...e){const t=ar(e),n=function qn(e){return sr(an(e))?e.pop():void 0}(e),{args:r,keys:i}=function Sk(e){if(1===e.length){const t=e[0];if(z9(t))return{args:t,keys:null};if(function $9(e){return e&&"object"==typeof e&&B9(e)===V9}(t)){const n=U9(t);return{args:n.map(r=>t[r]),keys:n}}}return{args:e,keys:null}}(e);if(0===r.length)return Cr([],t);const o=new Nn(function G9(e,t,n=qr){return r=>{Ak(t,()=>{const{length:i}=e,o=new Array(i);let c=i,d=i;for(let p=0;p{const v=Cr(e[p],t);let C=!1;v.subscribe(Qn(r,D=>{o[p]=D,C||(C=!0,d--),d||r.next(n(o.slice()))},()=>{--c||r.complete()}))},r)},r)}}(r,t,i?c=>function Ik(e,t){return e.reduce((n,r,i)=>(n[r]=t[i],n),{})}(i,c):qr));return n?o.pipe(function Mk(e){return Pe(t=>function H9(e,t){return j9(t)?e(...t):e(t)}(e,t))}(n)):o}function Ak(e,t,n){e?Ie(n,e,t):t()}function FC(...e){return function q9(){return ft(1)}()(Cr(e,ar(e)))}function kk(e){return new Nn(t=>{te(e()).subscribe(t)})}function fy(e,t){const n=sr(e)?e:()=>e,r=i=>i.error(n());return new Nn(t?i=>t.schedule(r,0,i):r)}function OC(){return yr((e,t)=>{let n=null;e._refCount++;const r=Qn(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(n=null);const i=e._connection,o=n;n=null,i&&(!o||i===o)&&i.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}class Pk extends Nn{constructor(t,n){super(),this.source=t,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,ra(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new vr;const n=this.getSubject();t.add(this.source.subscribe(Qn(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),t.closed&&(this._connection=null,t=vr.EMPTY)}return t}refCount(){return OC()(this)}}function pc(e,t){return yr((n,r)=>{let i=null,o=0,c=!1;const d=()=>c&&!i&&r.complete();n.subscribe(Qn(r,p=>{i?.unsubscribe();let v=0;const C=o++;te(e(p,C)).subscribe(i=Qn(r,D=>r.next(t?t(p,D,C,v++):D),()=>{i=null,d()}))},()=>{c=!0,d()}))})}function py(e){return e<=0?()=>xt:yr((t,n)=>{let r=0;t.subscribe(Qn(n,i=>{++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function uu(e,t){return yr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>e.call(t,o,i++)&&r.next(o)))})}function c0(e){return yr((t,n)=>{let r=!1;t.subscribe(Qn(n,i=>{r=!0,n.next(i)},()=>{r||n.next(e),n.complete()}))})}function Rk(e=W9){return yr((t,n)=>{let r=!1;t.subscribe(Qn(n,i=>{r=!0,n.next(i)},()=>r?n.complete():n.error(e())))})}function W9(){return new l0}function Ah(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,o)=>e(i,o,r)):qr,py(1),n?c0(t):Rk(()=>new l0))}function kh(e,t){return sr(t)?dt(e,t,1):dt(e,1)}function Vo(e,t,n){const r=sr(e)||t||n?{next:e,error:t,complete:n}:e;return r?yr((i,o)=>{var c;null===(c=r.subscribe)||void 0===c||c.call(r);let d=!0;i.subscribe(Qn(o,p=>{var v;null===(v=r.next)||void 0===v||v.call(r,p),o.next(p)},()=>{var p;d=!1,null===(p=r.complete)||void 0===p||p.call(r),o.complete()},p=>{var v;d=!1,null===(v=r.error)||void 0===v||v.call(r,p),o.error(p)},()=>{var p,v;d&&(null===(p=r.unsubscribe)||void 0===p||p.call(r)),null===(v=r.finalize)||void 0===v||v.call(r)}))}):qr}function Ph(e){return yr((t,n)=>{let o,r=null,i=!1;r=t.subscribe(Qn(n,void 0,void 0,c=>{o=te(e(c,Ph(e)(t))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function X9(e,t,n,r,i){return(o,c)=>{let d=n,p=t,v=0;o.subscribe(Qn(c,C=>{const D=v++;p=d?e(p,C,D):(d=!0,C),r&&c.next(p)},i&&(()=>{d&&c.next(p),c.complete()})))}}function Fk(e,t){return yr(X9(e,t,arguments.length>=2,!0))}function LC(e){return e<=0?()=>xt:yr((t,n)=>{let r=[];t.subscribe(Qn(n,i=>{r.push(i),e{for(const i of r)n.next(i);n.complete()},void 0,()=>{r=null}))})}function Ok(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,o)=>e(i,o,r)):qr,LC(1),n?c0(t):Rk(()=>new l0))}function NC(e){return yr((t,n)=>{try{t.subscribe(n)}finally{n.add(e)}})}const bn="primary",my=Symbol("RouteTitle");class J9{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n[0]:n}return null}getAll(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n:[n]}return[]}get keys(){return Object.keys(this.params)}}function Zp(e){return new J9(e)}function Q9(e,t,n){const r=n.path.split("/");if(r.length>e.length||"full"===n.pathMatch&&(t.hasChildren()||r.lengthr[o]===i)}return e===t}function Nk(e){return Array.prototype.concat.apply([],e)}function zk(e){return e.length>0?e[e.length-1]:null}function Eo(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function Rh(e){return bw(e)?e:Xg(e)?Cr(Promise.resolve(e)):Bt(e)}const nj={exact:function Uk(e,t,n){if(!uf(e.segments,t.segments)||!u0(e.segments,t.segments,n)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const r in t.children)if(!e.children[r]||!Uk(e.children[r],t.children[r],n))return!1;return!0},subset:$k},Bk={exact:function rj(e,t){return mc(e,t)},subset:function ij(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>Lk(e[n],t[n]))},ignored:()=>!0};function Vk(e,t,n){return nj[n.paths](e.root,t.root,n.matrixParams)&&Bk[n.queryParams](e.queryParams,t.queryParams)&&!("exact"===n.fragment&&e.fragment!==t.fragment)}function $k(e,t,n){return jk(e,t,t.segments,n)}function jk(e,t,n,r){if(e.segments.length>n.length){const i=e.segments.slice(0,n.length);return!(!uf(i,n)||t.hasChildren()||!u0(i,n,r))}if(e.segments.length===n.length){if(!uf(e.segments,n)||!u0(e.segments,n,r))return!1;for(const i in t.children)if(!e.children[i]||!$k(e.children[i],t.children[i],r))return!1;return!0}{const i=n.slice(0,e.segments.length),o=n.slice(e.segments.length);return!!(uf(e.segments,i)&&u0(e.segments,i,r)&&e.children[bn])&&jk(e.children[bn],t,o,r)}}function u0(e,t,n){return t.every((r,i)=>Bk[n](e[i].parameters,r.parameters))}class cf{constructor(t,n,r){this.root=t,this.queryParams=n,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Zp(this.queryParams)),this._queryParamMap}toString(){return aj.serialize(this)}}class En{constructor(t,n){this.segments=t,this.children=n,this.parent=null,Eo(n,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return h0(this)}}class gy{constructor(t,n){this.path=t,this.parameters=n}get parameterMap(){return this._parameterMap||(this._parameterMap=Zp(this.parameters)),this._parameterMap}toString(){return Zk(this)}}function uf(e,t){return e.length===t.length&&e.every((n,r)=>n.path===t[r].path)}let Hk=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return new BC},providedIn:"root"}),e})();class BC{parse(t){const n=new gj(t);return new cf(n.parseRootSegment(),n.parseQueryParams(),n.parseFragment())}serialize(t){const n=`/${yy(t.root,!0)}`,r=function uj(e){const t=Object.keys(e).map(n=>{const r=e[n];return Array.isArray(r)?r.map(i=>`${d0(n)}=${d0(i)}`).join("&"):`${d0(n)}=${d0(r)}`}).filter(n=>!!n);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${n}${r}${"string"==typeof t.fragment?`#${function lj(e){return encodeURI(e)}(t.fragment)}`:""}`}}const aj=new BC;function h0(e){return e.segments.map(t=>Zk(t)).join("/")}function yy(e,t){if(!e.hasChildren())return h0(e);if(t){const n=e.children[bn]?yy(e.children[bn],!1):"",r=[];return Eo(e.children,(i,o)=>{o!==bn&&r.push(`${o}:${yy(i,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=function sj(e,t){let n=[];return Eo(e.children,(r,i)=>{i===bn&&(n=n.concat(t(r,i)))}),Eo(e.children,(r,i)=>{i!==bn&&(n=n.concat(t(r,i)))}),n}(e,(r,i)=>i===bn?[yy(e.children[bn],!1)]:[`${i}:${yy(r,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[bn]?`${h0(e)}/${n[0]}`:`${h0(e)}/(${n.join("//")})`}}function Gk(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function d0(e){return Gk(e).replace(/%3B/gi,";")}function VC(e){return Gk(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function f0(e){return decodeURIComponent(e)}function qk(e){return f0(e.replace(/\+/g,"%20"))}function Zk(e){return`${VC(e.path)}${function cj(e){return Object.keys(e).map(t=>`;${VC(t)}=${VC(e[t])}`).join("")}(e.parameters)}`}const hj=/^[^\/()?;=#]+/;function p0(e){const t=e.match(hj);return t?t[0]:""}const dj=/^[^=?&#]+/,pj=/^[^&#]+/;class gj{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new En([],{}):new En([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let n={};this.peekStartsWith("/(")&&(this.capture("/"),n=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(n).length>0)&&(r[bn]=new En(t,n)),r}parseSegment(){const t=p0(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new nt(4009,!1);return this.capture(t),new gy(f0(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const n=p0(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const i=p0(this.remaining);i&&(r=i,this.capture(r))}t[f0(n)]=f0(r)}parseQueryParam(t){const n=function fj(e){const t=e.match(dj);return t?t[0]:""}(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const c=function mj(e){const t=e.match(pj);return t?t[0]:""}(this.remaining);c&&(r=c,this.capture(r))}const i=qk(n),o=qk(r);if(t.hasOwnProperty(i)){let c=t[i];Array.isArray(c)||(c=[c],t[i]=c),c.push(o)}else t[i]=o}parseParens(t){const n={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=p0(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new nt(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=bn);const c=this.parseChildren();n[o]=1===Object.keys(c).length?c[bn]:new En([],c),this.consumeOptional("//")}return n}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new nt(4011,!1)}}function UC(e){return e.segments.length>0?new En([],{[bn]:e}):e}function m0(e){const t={};for(const r of Object.keys(e.children)){const o=m0(e.children[r]);(o.segments.length>0||o.hasChildren())&&(t[r]=o)}return function yj(e){if(1===e.numberOfChildren&&e.children[bn]){const t=e.children[bn];return new En(e.segments.concat(t.segments),t.children)}return e}(new En(e.segments,t))}function hf(e){return e instanceof cf}function bj(e,t,n,r,i){if(0===n.length)return Wp(t.root,t.root,t.root,r,i);const o=function Yk(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Xk(!0,0,e);let t=0,n=!1;const r=e.reduce((i,o,c)=>{if("object"==typeof o&&null!=o){if(o.outlets){const d={};return Eo(o.outlets,(p,v)=>{d[v]="string"==typeof p?p.split("/"):p}),[...i,{outlets:d}]}if(o.segmentPath)return[...i,o.segmentPath]}return"string"!=typeof o?[...i,o]:0===c?(o.split("/").forEach((d,p)=>{0==p&&"."===d||(0==p&&""===d?n=!0:".."===d?t++:""!=d&&i.push(d))}),i):[...i,o]},[]);return new Xk(n,t,r)}(n);return o.toRoot()?Wp(t.root,t.root,new En([],{}),r,i):function c(p){const v=function wj(e,t,n,r){if(e.isAbsolute)return new Xp(t.root,!0,0);if(-1===r)return new Xp(n,n===t.root,0);return function Kk(e,t,n){let r=e,i=t,o=n;for(;o>i;){if(o-=i,r=r.parent,!r)throw new nt(4005,!1);i=r.segments.length}return new Xp(r,!1,i-o)}(n,r+(_y(e.commands[0])?0:1),e.numberOfDoubleDots)}(o,t,e.snapshot?._urlSegment,p),C=v.processChildren?by(v.segmentGroup,v.index,o.commands):jC(v.segmentGroup,v.index,o.commands);return Wp(t.root,v.segmentGroup,C,r,i)}(e.snapshot?._lastPathIndex)}function _y(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function vy(e){return"object"==typeof e&&null!=e&&e.outlets}function Wp(e,t,n,r,i){let c,o={};r&&Eo(r,(p,v)=>{o[v]=Array.isArray(p)?p.map(C=>`${C}`):`${p}`}),c=e===t?n:Wk(e,t,n);const d=UC(m0(c));return new cf(d,o,i)}function Wk(e,t,n){const r={};return Eo(e.children,(i,o)=>{r[o]=i===t?n:Wk(i,t,n)}),new En(e.segments,r)}class Xk{constructor(t,n,r){if(this.isAbsolute=t,this.numberOfDoubleDots=n,this.commands=r,t&&r.length>0&&_y(r[0]))throw new nt(4003,!1);const i=r.find(vy);if(i&&i!==zk(r))throw new nt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Xp{constructor(t,n,r){this.segmentGroup=t,this.processChildren=n,this.index=r}}function jC(e,t,n){if(e||(e=new En([],{})),0===e.segments.length&&e.hasChildren())return by(e,t,n);const r=function Ej(e,t,n){let r=0,i=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;i=n.length)return o;const c=e.segments[i],d=n[r];if(vy(d))break;const p=`${d}`,v=r0&&void 0===p)break;if(p&&v&&"object"==typeof v&&void 0===v.outlets){if(!Qk(p,v,c))return o;r+=2}else{if(!Qk(p,{},c))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex{"string"==typeof o&&(o=[o]),null!==o&&(i[c]=jC(e.children[c],t,o))}),Eo(e.children,(o,c)=>{void 0===r[c]&&(i[c]=o)}),new En(e.segments,i)}}function HC(e,t,n){const r=e.segments.slice(0,t);let i=0;for(;i{"string"==typeof n&&(n=[n]),null!==n&&(t[r]=HC(new En([],{}),0,n))}),t}function Jk(e){const t={};return Eo(e,(n,r)=>t[r]=`${n}`),t}function Qk(e,t,n){return e==n.path&&mc(t,n.parameters)}class hu{constructor(t,n){this.id=t,this.url=n}}class GC extends hu{constructor(t,n,r="imperative",i=null){super(t,n),this.type=0,this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class df extends hu{constructor(t,n,r){super(t,n),this.urlAfterRedirects=r,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class g0 extends hu{constructor(t,n,r,i){super(t,n),this.reason=r,this.code=i,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class eP extends hu{constructor(t,n,r,i){super(t,n),this.error=r,this.target=i,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Sj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Mj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ij extends hu{constructor(t,n,r,i,o){super(t,n),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Tj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Aj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class kj{constructor(t){this.route=t,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Pj{constructor(t){this.route=t,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Rj{constructor(t){this.snapshot=t,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Fj{constructor(t){this.snapshot=t,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Oj{constructor(t){this.snapshot=t,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Lj{constructor(t){this.snapshot=t,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class tP{constructor(t,n,r){this.routerEvent=t,this.position=n,this.anchor=r,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class nP{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const n=this.pathFromRoot(t);return n.length>1?n[n.length-2]:null}children(t){const n=qC(t,this._root);return n?n.children.map(r=>r.value):[]}firstChild(t){const n=qC(t,this._root);return n&&n.children.length>0?n.children[0].value:null}siblings(t){const n=ZC(t,this._root);return n.length<2?[]:n[n.length-2].children.map(i=>i.value).filter(i=>i!==t)}pathFromRoot(t){return ZC(t,this._root).map(n=>n.value)}}function qC(e,t){if(e===t.value)return t;for(const n of t.children){const r=qC(e,n);if(r)return r}return null}function ZC(e,t){if(e===t.value)return[t];for(const n of t.children){const r=ZC(e,n);if(r.length)return r.unshift(t),r}return[]}class du{constructor(t,n){this.value=t,this.children=n}toString(){return`TreeNode(${this.value})`}}function Yp(e){const t={};return e&&e.children.forEach(n=>t[n.value.outlet]=n),t}class rP extends nP{constructor(t,n){super(t),this.snapshot=n,WC(this,t)}toString(){return this.snapshot.toString()}}function iP(e,t){const n=function zj(e,t){const c=new y0([],{},{},"",{},bn,t,null,e.root,-1,{});return new sP("",new du(c,[]))}(e,t),r=new bl([new gy("",{})]),i=new bl({}),o=new bl({}),c=new bl({}),d=new bl(""),p=new ff(r,i,c,d,o,bn,t,n.root);return p.snapshot=n.root,new rP(new du(p,[]),n)}class ff{constructor(t,n,r,i,o,c,d,p){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=c,this.component=d,this.title=this.data?.pipe(Pe(v=>v[my]))??Bt(void 0),this._futureSnapshot=p}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Pe(t=>Zp(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Pe(t=>Zp(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function oP(e,t="emptyOnly"){const n=e.pathFromRoot;let r=0;if("always"!==t)for(r=n.length-1;r>=1;){const i=n[r],o=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(o.component)break;r--}}return function Bj(e){return e.reduce((t,n)=>({params:{...t.params,...n.params},data:{...t.data,...n.data},resolve:{...n.data,...t.resolve,...n.routeConfig?.data,...n._resolvedData}}),{params:{},data:{},resolve:{}})}(n.slice(r))}class y0{constructor(t,n,r,i,o,c,d,p,v,C,D,I){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=c,this.component=d,this.title=this.data?.[my],this.routeConfig=p,this._urlSegment=v,this._lastPathIndex=C,this._correctedLastPathIndex=I??C,this._resolve=D}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Zp(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Zp(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class sP extends nP{constructor(t,n){super(n),this.url=t,WC(this,n)}toString(){return aP(this._root)}}function WC(e,t){t.value._routerState=e,t.children.forEach(n=>WC(e,n))}function aP(e){const t=e.children.length>0?` { ${e.children.map(aP).join(", ")} } `:"";return`${e.value}${t}`}function XC(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,mc(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),mc(t.params,n.params)||e.params.next(n.params),function ej(e,t){if(e.length!==t.length)return!1;for(let n=0;nmc(n.parameters,t[r].parameters))}(e.url,t.url);return n&&!(!e.parent!=!t.parent)&&(!e.parent||YC(e.parent,t.parent))}function xy(e,t,n){if(n&&e.shouldReuseRoute(t.value,n.value.snapshot)){const r=n.value;r._futureSnapshot=t.value;const i=function Uj(e,t,n){return t.children.map(r=>{for(const i of n.children)if(e.shouldReuseRoute(r.value,i.value.snapshot))return xy(e,r,i);return xy(e,r)})}(e,t,n);return new du(r,i)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const c=o.route;return c.value._futureSnapshot=t.value,c.children=t.children.map(d=>xy(e,d)),c}}const r=function $j(e){return new ff(new bl(e.url),new bl(e.params),new bl(e.queryParams),new bl(e.fragment),new bl(e.data),e.outlet,e.component,e)}(t.value),i=t.children.map(o=>xy(e,o));return new du(r,i)}}const KC="ngNavigationCancelingError";function lP(e,t){const{redirectTo:n,navigationBehaviorOptions:r}=hf(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,i=cP(!1,0,t);return i.url=n,i.navigationBehaviorOptions=r,i}function cP(e,t,n){const r=new Error("NavigationCancelingError: "+(e||""));return r[KC]=!0,r.cancellationCode=t,n&&(r.url=n),r}function uP(e){return hP(e)&&hf(e.url)}function hP(e){return e&&e[KC]}class jj{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.injector=null,this.children=new wy,this.attachRef=null}}let wy=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(n,r){const i=this.getOrCreateContext(n);i.outlet=r,this.contexts.set(n,i)}onChildOutletDestroyed(n){const r=this.getContext(n);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const n=this.contexts;return this.contexts=new Map,n}onOutletReAttached(n){this.contexts=n}getOrCreateContext(n){let r=this.getContext(n);return r||(r=new jj,this.contexts.set(n,r)),r}getContext(n){return this.contexts.get(n)||null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const _0=!1;let dP=(()=>{class e{constructor(n,r,i,o,c){this.parentContexts=n,this.location=r,this.changeDetector=o,this.environmentInjector=c,this.activated=null,this._activatedRoute=null,this.activateEvents=new Qr,this.deactivateEvents=new Qr,this.attachEvents=new Qr,this.detachEvents=new Qr,this.name=i||bn,n.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.getContext(this.name)?.outlet===this&&this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const n=this.parentContexts.getContext(this.name);n&&n.route&&(n.attachRef?this.attach(n.attachRef,n.route):this.activateWith(n.route,n.injector))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new nt(4012,_0);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new nt(4012,_0);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new nt(4012,_0);this.location.detach();const n=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(n.instance),n}attach(n,r){this.activated=n,this._activatedRoute=r,this.location.insert(n.hostView),this.attachEvents.emit(n.instance)}deactivate(){if(this.activated){const n=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(n)}}activateWith(n,r){if(this.isActivated)throw new nt(4013,_0);this._activatedRoute=n;const i=this.location,c=n._futureSnapshot.component,d=this.parentContexts.getOrCreateContext(this.name).children,p=new Hj(n,d,i.injector);if(r&&function Gj(e){return!!e.resolveComponentFactory}(r)){const v=r.resolveComponentFactory(c);this.activated=i.createComponent(v,i.length,p)}else this.activated=i.createComponent(c,{index:i.length,injector:p,environmentInjector:r??this.environmentInjector});this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return e.\u0275fac=function(n){return new(n||e)(qe(wy),qe(gl),function Ad(e){return function Ym(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let i=0;for(;i{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Vs({type:e,selectors:[["ng-component"]],standalone:!0,features:[gT],decls:1,vars:0,template:function(n,r){1&n&&is(0,"router-outlet")},dependencies:[dP],encapsulation:2}),e})();function fP(e,t){return e.providers&&!e._injector&&(e._injector=Rv(e.providers,t,`Route: ${e.path}`)),e._injector??t}function eE(e){const t=e.children&&e.children.map(eE),n=t?{...e,children:t}:{...e};return!n.component&&!n.loadComponent&&(t||n.loadChildren)&&n.outlet&&n.outlet!==bn&&(n.component=JC),n}function Da(e){return e.outlet||bn}function pP(e,t){const n=e.filter(r=>Da(r)===t);return n.push(...e.filter(r=>Da(r)!==t)),n}function Cy(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const n=t.routeConfig;if(n?._loadedInjector)return n._loadedInjector;if(n?._injector)return n._injector}return null}class Yj{constructor(t,n,r,i){this.routeReuseStrategy=t,this.futureState=n,this.currState=r,this.forwardEvent=i}activate(t){const n=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(n,r,t),XC(this.futureState.root),this.activateChildRoutes(n,r,t)}deactivateChildRoutes(t,n,r){const i=Yp(n);t.children.forEach(o=>{const c=o.value.outlet;this.deactivateRoutes(o,i[c],r),delete i[c]}),Eo(i,(o,c)=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(t,n,r){const i=t.value,o=n?n.value:null;if(i===o)if(i.component){const c=r.getContext(i.outlet);c&&this.deactivateChildRoutes(t,n,c.children)}else this.deactivateChildRoutes(t,n,r);else o&&this.deactivateRouteAndItsChildren(n,r)}deactivateRouteAndItsChildren(t,n){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,n):this.deactivateRouteAndOutlet(t,n)}detachAndStoreRouteSubtree(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,o=Yp(t);for(const c of Object.keys(o))this.deactivateRouteAndItsChildren(o[c],i);if(r&&r.outlet){const c=r.outlet.detach(),d=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:c,route:t,contexts:d})}}deactivateRouteAndOutlet(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,o=Yp(t);for(const c of Object.keys(o))this.deactivateRouteAndItsChildren(o[c],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(t,n,r){const i=Yp(n);t.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new Lj(o.value.snapshot))}),t.children.length&&this.forwardEvent(new Fj(t.value.snapshot))}activateRoutes(t,n,r){const i=t.value,o=n?n.value:null;if(XC(i),i===o)if(i.component){const c=r.getOrCreateContext(i.outlet);this.activateChildRoutes(t,n,c.children)}else this.activateChildRoutes(t,n,r);else if(i.component){const c=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const d=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),c.children.onOutletReAttached(d.contexts),c.attachRef=d.componentRef,c.route=d.route.value,c.outlet&&c.outlet.attach(d.componentRef,d.route.value),XC(d.route.value),this.activateChildRoutes(t,null,c.children)}else{const d=Cy(i.snapshot),p=d?.get(jg)??null;c.attachRef=null,c.route=i,c.resolver=p,c.injector=d,c.outlet&&c.outlet.activateWith(i,c.injector),this.activateChildRoutes(t,null,c.children)}}else this.activateChildRoutes(t,null,r)}}class mP{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class v0{constructor(t,n){this.component=t,this.route=n}}function Kj(e,t,n){const r=e._root;return Ey(r,t?t._root:null,n,[r.value])}function Kp(e,t){const n=Symbol(),r=t.get(e,n);return r===n?"function"!=typeof e||function od(e){return null!==Uu(e)}(e)?t.get(e):e:r}function Ey(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=Yp(t);return e.children.forEach(c=>{(function Qj(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,c=t?t.value:null,d=n?n.getContext(e.value.outlet):null;if(c&&o.routeConfig===c.routeConfig){const p=function eH(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!uf(e.url,t.url);case"pathParamsOrQueryParamsChange":return!uf(e.url,t.url)||!mc(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!YC(e,t)||!mc(e.queryParams,t.queryParams);default:return!YC(e,t)}}(c,o,o.routeConfig.runGuardsAndResolvers);p?i.canActivateChecks.push(new mP(r)):(o.data=c.data,o._resolvedData=c._resolvedData),Ey(e,t,o.component?d?d.children:null:n,r,i),p&&d&&d.outlet&&d.outlet.isActivated&&i.canDeactivateChecks.push(new v0(d.outlet.component,c))}else c&&Dy(t,d,i),i.canActivateChecks.push(new mP(r)),Ey(e,null,o.component?d?d.children:null:n,r,i)})(c,o[c.value.outlet],n,r.concat([c.value]),i),delete o[c.value.outlet]}),Eo(o,(c,d)=>Dy(c,n.getContext(d),i)),i}function Dy(e,t,n){const r=Yp(e),i=e.value;Eo(r,(o,c)=>{Dy(o,i.component?t?t.children.getContext(c):null:t,n)}),n.canDeactivateChecks.push(new v0(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))}function Sy(e){return"function"==typeof e}function tE(e){return e instanceof l0||"EmptyError"===e?.name}const b0=Symbol("INITIAL_VALUE");function Jp(){return pc(e=>Tk(e.map(t=>t.pipe(py(1),function Z9(...e){const t=ar(e);return yr((n,r)=>{(t?FC(e,n,t):FC(e,n)).subscribe(r)})}(b0)))).pipe(Pe(t=>{for(const n of t)if(!0!==n){if(n===b0)return b0;if(!1===n||n instanceof cf)return n}return!0}),uu(t=>t!==b0),py(1)))}function gP(e){return function Oa(...e){return Ns(e)}(Vo(t=>{if(hf(t))throw lP(0,t)}),Pe(t=>!0===t))}const nE={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function yP(e,t,n,r,i){const o=rE(e,t,n);return o.matched?function yH(e,t,n,r){const i=t.canMatch;return i&&0!==i.length?Bt(i.map(c=>{const d=Kp(c,e);return Rh(function sH(e){return e&&Sy(e.canMatch)}(d)?d.canMatch(t,n):e.runInContext(()=>d(t,n)))})).pipe(Jp(),gP()):Bt(!0)}(r=fP(t,r),t,n).pipe(Pe(c=>!0===c?o:{...nE})):Bt(o)}function rE(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{...nE}:{matched:!0,consumedSegments:[],remainingSegments:n,parameters:{},positionalParamSegments:{}};const i=(t.matcher||Q9)(n,e,t);if(!i)return{...nE};const o={};Eo(i.posParams,(d,p)=>{o[p]=d.path});const c=i.consumed.length>0?{...o,...i.consumed[i.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:n.slice(i.consumed.length),parameters:c,positionalParamSegments:i.posParams??{}}}function x0(e,t,n,r,i="corrected"){if(n.length>0&&function bH(e,t,n){return n.some(r=>w0(e,t,r)&&Da(r)!==bn)}(e,n,r)){const c=new En(t,function vH(e,t,n,r){const i={};i[bn]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;for(const o of n)if(""===o.path&&Da(o)!==bn){const c=new En([],{});c._sourceSegment=e,c._segmentIndexShift=t.length,i[Da(o)]=c}return i}(e,t,r,new En(n,e.children)));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:[]}}if(0===n.length&&function xH(e,t,n){return n.some(r=>w0(e,t,r))}(e,n,r)){const c=new En(e.segments,function _H(e,t,n,r,i,o){const c={};for(const d of r)if(w0(e,n,d)&&!i[Da(d)]){const p=new En([],{});p._sourceSegment=e,p._segmentIndexShift="legacy"===o?e.segments.length:t.length,c[Da(d)]=p}return{...i,...c}}(e,t,n,r,e.children,i));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:n}}const o=new En(e.segments,e.children);return o._sourceSegment=e,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:n}}function w0(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path}function _P(e,t,n,r){return!!(Da(e)===r||r!==bn&&w0(t,n,e))&&("**"===e.path||rE(t,e,n).matched)}function vP(e,t,n){return 0===t.length&&!e.children[n]}const C0=!1;class E0{constructor(t){this.segmentGroup=t||null}}class bP{constructor(t){this.urlTree=t}}function My(e){return fy(new E0(e))}function xP(e){return fy(new bP(e))}class DH{constructor(t,n,r,i,o){this.injector=t,this.configLoader=n,this.urlSerializer=r,this.urlTree=i,this.config=o,this.allowRedirects=!0}apply(){const t=x0(this.urlTree.root,[],[],this.config).segmentGroup,n=new En(t.segments,t.children);return this.expandSegmentGroup(this.injector,this.config,n,bn).pipe(Pe(o=>this.createUrlTree(m0(o),this.urlTree.queryParams,this.urlTree.fragment))).pipe(Ph(o=>{if(o instanceof bP)return this.allowRedirects=!1,this.match(o.urlTree);throw o instanceof E0?this.noMatchError(o):o}))}match(t){return this.expandSegmentGroup(this.injector,this.config,t.root,bn).pipe(Pe(i=>this.createUrlTree(m0(i),t.queryParams,t.fragment))).pipe(Ph(i=>{throw i instanceof E0?this.noMatchError(i):i}))}noMatchError(t){return new nt(4002,C0)}createUrlTree(t,n,r){const i=UC(t);return new cf(i,n,r)}expandSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,n,r).pipe(Pe(o=>new En([],o))):this.expandSegment(t,r,n,r.segments,i,!0)}expandChildren(t,n,r){const i=[];for(const o of Object.keys(r.children))"primary"===o?i.unshift(o):i.push(o);return Cr(i).pipe(kh(o=>{const c=r.children[o],d=pP(n,o);return this.expandSegmentGroup(t,d,c,o).pipe(Pe(p=>({segment:p,outlet:o})))}),Fk((o,c)=>(o[c.outlet]=c.segment,o),{}),Ok())}expandSegment(t,n,r,i,o,c){return Cr(r).pipe(kh(d=>this.expandSegmentAgainstRoute(t,n,r,d,i,o,c).pipe(Ph(v=>{if(v instanceof E0)return Bt(null);throw v}))),Ah(d=>!!d),Ph((d,p)=>{if(tE(d))return vP(n,i,o)?Bt(new En([],{})):My(n);throw d}))}expandSegmentAgainstRoute(t,n,r,i,o,c,d){return _P(i,n,o,c)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,n,i,o,c):d&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c):My(n):My(n)}expandSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,i,c):this.expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,i){const o=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?xP(o):this.lineralizeSegments(r,o).pipe(dt(c=>{const d=new En(c,{});return this.expandSegment(t,d,n,c,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,o,c){const{matched:d,consumedSegments:p,remainingSegments:v,positionalParamSegments:C}=rE(n,i,o);if(!d)return My(n);const D=this.applyRedirectCommands(p,i.redirectTo,C);return i.redirectTo.startsWith("/")?xP(D):this.lineralizeSegments(i,D).pipe(dt(I=>this.expandSegment(t,n,r,I.concat(v),c,!1)))}matchSegmentAgainstRoute(t,n,r,i,o){return"**"===r.path?(t=fP(r,t),r.loadChildren?(r._loadedRoutes?Bt({routes:r._loadedRoutes,injector:r._loadedInjector}):this.configLoader.loadChildren(t,r)).pipe(Pe(d=>(r._loadedRoutes=d.routes,r._loadedInjector=d.injector,new En(i,{})))):Bt(new En(i,{}))):yP(n,r,i,t).pipe(pc(({matched:c,consumedSegments:d,remainingSegments:p})=>c?this.getChildConfig(t=r._injector??t,r,i).pipe(dt(C=>{const D=C.injector??t,I=C.routes,{segmentGroup:P,slicedSegments:N}=x0(n,d,p,I),G=new En(P.segments,P.children);if(0===N.length&&G.hasChildren())return this.expandChildren(D,I,G).pipe(Pe(X=>new En(d,X)));if(0===I.length&&0===N.length)return Bt(new En(d,{}));const U=Da(r)===o;return this.expandSegment(D,G,I,N,U?bn:o,!0).pipe(Pe(ne=>new En(d.concat(ne.segments),ne.children)))})):My(n)))}getChildConfig(t,n,r){return n.children?Bt({routes:n.children,injector:t}):n.loadChildren?void 0!==n._loadedRoutes?Bt({routes:n._loadedRoutes,injector:n._loadedInjector}):function gH(e,t,n,r){const i=t.canLoad;return void 0===i||0===i.length?Bt(!0):Bt(i.map(c=>{const d=Kp(c,e);return Rh(function nH(e){return e&&Sy(e.canLoad)}(d)?d.canLoad(t,n):e.runInContext(()=>d(t,n)))})).pipe(Jp(),gP())}(t,n,r).pipe(dt(i=>i?this.configLoader.loadChildren(t,n).pipe(Vo(o=>{n._loadedRoutes=o.routes,n._loadedInjector=o.injector})):function CH(e){return fy(cP(C0,3))}())):Bt({routes:[],injector:t})}lineralizeSegments(t,n){let r=[],i=n.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return Bt(r);if(i.numberOfChildren>1||!i.children[bn])return fy(new nt(4e3,C0));i=i.children[bn]}}applyRedirectCommands(t,n,r){return this.applyRedirectCreateUrlTree(n,this.urlSerializer.parse(n),t,r)}applyRedirectCreateUrlTree(t,n,r,i){const o=this.createSegmentGroup(t,n.root,r,i);return new cf(o,this.createQueryParams(n.queryParams,this.urlTree.queryParams),n.fragment)}createQueryParams(t,n){const r={};return Eo(t,(i,o)=>{if("string"==typeof i&&i.startsWith(":")){const d=i.substring(1);r[o]=n[d]}else r[o]=i}),r}createSegmentGroup(t,n,r,i){const o=this.createSegments(t,n.segments,r,i);let c={};return Eo(n.children,(d,p)=>{c[p]=this.createSegmentGroup(t,d,r,i)}),new En(o,c)}createSegments(t,n,r,i){return n.map(o=>o.path.startsWith(":")?this.findPosParam(t,o,i):this.findOrReturn(o,r))}findPosParam(t,n,r){const i=r[n.path.substring(1)];if(!i)throw new nt(4001,C0);return i}findOrReturn(t,n){let r=0;for(const i of n){if(i.path===t.path)return n.splice(r),i;r++}return t}}class MH{}class AH{constructor(t,n,r,i,o,c,d,p){this.injector=t,this.rootComponentType=n,this.config=r,this.urlTree=i,this.url=o,this.paramsInheritanceStrategy=c,this.relativeLinkResolution=d,this.urlSerializer=p}recognize(){const t=x0(this.urlTree.root,[],[],this.config.filter(n=>void 0===n.redirectTo),this.relativeLinkResolution).segmentGroup;return this.processSegmentGroup(this.injector,this.config,t,bn).pipe(Pe(n=>{if(null===n)return null;const r=new y0([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},bn,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new du(r,n),o=new sP(this.url,i);return this.inheritParamsAndData(o._root),o}))}inheritParamsAndData(t){const n=t.value,r=oP(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.processChildren(t,n,r):this.processSegment(t,n,r,r.segments,i)}processChildren(t,n,r){return Cr(Object.keys(r.children)).pipe(kh(i=>{const o=r.children[i],c=pP(n,i);return this.processSegmentGroup(t,c,o,i)}),Fk((i,o)=>i&&o?(i.push(...o),i):null),function Y9(e,t=!1){return yr((n,r)=>{let i=0;n.subscribe(Qn(r,o=>{const c=e(o,i++);(c||t)&&r.next(o),!c&&r.complete()}))})}(i=>null!==i),c0(null),Ok(),Pe(i=>{if(null===i)return null;const o=wP(i);return function kH(e){e.sort((t,n)=>t.value.outlet===bn?-1:n.value.outlet===bn?1:t.value.outlet.localeCompare(n.value.outlet))}(o),o}))}processSegment(t,n,r,i,o){return Cr(n).pipe(kh(c=>this.processSegmentAgainstRoute(c._injector??t,c,r,i,o)),Ah(c=>!!c),Ph(c=>{if(tE(c))return vP(r,i,o)?Bt([]):Bt(null);throw c}))}processSegmentAgainstRoute(t,n,r,i,o){if(n.redirectTo||!_P(n,r,i,o))return Bt(null);let c;if("**"===n.path){const d=i.length>0?zk(i).parameters:{},p=EP(r)+i.length;c=Bt({snapshot:new y0(i,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,SP(n),Da(n),n.component??n._loadedComponent??null,n,CP(r),p,MP(n),p),consumedSegments:[],remainingSegments:[]})}else c=yP(r,n,i,t).pipe(Pe(({matched:d,consumedSegments:p,remainingSegments:v,parameters:C})=>{if(!d)return null;const D=EP(r)+p.length;return{snapshot:new y0(p,C,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,SP(n),Da(n),n.component??n._loadedComponent??null,n,CP(r),D,MP(n),D),consumedSegments:p,remainingSegments:v}}));return c.pipe(pc(d=>{if(null===d)return Bt(null);const{snapshot:p,consumedSegments:v,remainingSegments:C}=d;t=n._injector??t;const D=n._loadedInjector??t,I=function PH(e){return e.children?e.children:e.loadChildren?e._loadedRoutes:[]}(n),{segmentGroup:P,slicedSegments:N}=x0(r,v,C,I.filter(U=>void 0===U.redirectTo),this.relativeLinkResolution);if(0===N.length&&P.hasChildren())return this.processChildren(D,I,P).pipe(Pe(U=>null===U?null:[new du(p,U)]));if(0===I.length&&0===N.length)return Bt([new du(p,[])]);const G=Da(n)===o;return this.processSegment(D,I,P,N,G?bn:o).pipe(Pe(U=>null===U?null:[new du(p,U)]))}))}}function RH(e){const t=e.value.routeConfig;return t&&""===t.path&&void 0===t.redirectTo}function wP(e){const t=[],n=new Set;for(const r of e){if(!RH(r)){t.push(r);continue}const i=t.find(o=>r.value.routeConfig===o.value.routeConfig);void 0!==i?(i.children.push(...r.children),n.add(i)):t.push(r)}for(const r of n){const i=wP(r.children);t.push(new du(r.value,i))}return t.filter(r=>!n.has(r))}function CP(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function EP(e){let t=e,n=t._segmentIndexShift??0;for(;t._sourceSegment;)t=t._sourceSegment,n+=t._segmentIndexShift??0;return n-1}function SP(e){return e.data||{}}function MP(e){return e.resolve||{}}function IP(e){return"string"==typeof e.title||null===e.title}function iE(e){return pc(t=>{const n=e(t);return n?Cr(n).pipe(Pe(()=>t)):Bt(t)})}let TP=(()=>{class e{buildTitle(n){let r,i=n.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===bn);return r}getResolvedTitleForRoute(n){return n.data[my]}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:function(){return Fr(AP)},providedIn:"root"}),e})(),AP=(()=>{class e extends TP{constructor(n){super(),this.title=n}updateTitle(n){const r=this.buildTitle(n);void 0!==r&&this.title.setTitle(r)}}return e.\u0275fac=function(n){return new(n||e)(St(Ck))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class UH{}class jH extends class $H{shouldDetach(t){return!1}store(t,n){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,n){return t.routeConfig===n.routeConfig}}{}const S0=new It("",{providedIn:"root",factory:()=>({})}),oE=new It("ROUTES");let sE=(()=>{class e{constructor(n,r){this.injector=n,this.compiler=r,this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap}loadComponent(n){if(this.componentLoaders.get(n))return this.componentLoaders.get(n);if(n._loadedComponent)return Bt(n._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(n);const r=Rh(n.loadComponent()).pipe(Vo(o=>{this.onLoadEndListener&&this.onLoadEndListener(n),n._loadedComponent=o}),NC(()=>{this.componentLoaders.delete(n)})),i=new Pk(r,()=>new oi).pipe(OC());return this.componentLoaders.set(n,i),i}loadChildren(n,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return Bt({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const o=this.loadModuleFactoryOrRoutes(r.loadChildren).pipe(Pe(d=>{this.onLoadEndListener&&this.onLoadEndListener(r);let p,v,C=!1;Array.isArray(d)?v=d:(p=d.create(n).injector,v=Nk(p.get(oE,[],Rt.Self|Rt.Optional)));return{routes:v.map(eE),injector:p}}),NC(()=>{this.childrenLoaders.delete(r)})),c=new Pk(o,()=>new oi).pipe(OC());return this.childrenLoaders.set(r,c),c}loadModuleFactoryOrRoutes(n){return Rh(n()).pipe(dt(r=>r instanceof pT||Array.isArray(r)?Bt(r):Cr(this.compiler.compileModuleAsync(r))))}}return e.\u0275fac=function(n){return new(n||e)(St(Ys),St(Xw))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class GH{}class qH{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,n){return t}}function ZH(e){throw e}function WH(e,t,n){return t.parse("/")}const XH={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},YH={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};function PP(){const e=Fr(Hk),t=Fr(wy),n=Fr(uC),r=Fr(Ys),i=Fr(Xw),o=Fr(oE,{optional:!0})??[],c=Fr(S0,{optional:!0})??{},d=Fr(AP),p=Fr(TP,{optional:!0}),v=Fr(GH,{optional:!0}),C=Fr(UH,{optional:!0}),D=new Do(null,e,t,n,r,i,Nk(o));return v&&(D.urlHandlingStrategy=v),C&&(D.routeReuseStrategy=C),D.titleStrategy=p??d,function KH(e,t){e.errorHandler&&(t.errorHandler=e.errorHandler),e.malformedUriErrorHandler&&(t.malformedUriErrorHandler=e.malformedUriErrorHandler),e.onSameUrlNavigation&&(t.onSameUrlNavigation=e.onSameUrlNavigation),e.paramsInheritanceStrategy&&(t.paramsInheritanceStrategy=e.paramsInheritanceStrategy),e.relativeLinkResolution&&(t.relativeLinkResolution=e.relativeLinkResolution),e.urlUpdateStrategy&&(t.urlUpdateStrategy=e.urlUpdateStrategy),e.canceledNavigationResolution&&(t.canceledNavigationResolution=e.canceledNavigationResolution)}(c,D),D}let Do=(()=>{class e{constructor(n,r,i,o,c,d,p){this.rootComponentType=n,this.urlSerializer=r,this.rootContexts=i,this.location=o,this.config=p,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new oi,this.errorHandler=ZH,this.malformedUriErrorHandler=WH,this.navigated=!1,this.lastSuccessfulId=-1,this.afterPreactivation=()=>Bt(void 0),this.urlHandlingStrategy=new qH,this.routeReuseStrategy=new jH,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.configLoader=c.get(sE),this.configLoader.onLoadEndListener=I=>this.triggerEvent(new Pj(I)),this.configLoader.onLoadStartListener=I=>this.triggerEvent(new kj(I)),this.ngModule=c.get(sf),this.console=c.get(SU);const D=c.get(Fi);this.isNgZoneEnabled=D instanceof Fi&&Fi.isInAngularZone(),this.resetConfig(p),this.currentUrlTree=function tj(){return new cf(new En([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=iP(this.currentUrlTree,this.rootComponentType),this.transitions=new bl({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){return this.location.getState()?.\u0275routerPageId}setupNavigations(n){const r=this.events;return n.pipe(uu(i=>0!==i.id),Pe(i=>({...i,extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),pc(i=>{let o=!1,c=!1;return Bt(i).pipe(Vo(d=>{this.currentNavigation={id:d.id,initialUrl:d.rawUrl,extractedUrl:d.extractedUrl,trigger:d.source,extras:d.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),pc(d=>{const p=this.browserUrlTree.toString(),v=!this.navigated||d.extractedUrl.toString()!==p||p!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||v)&&this.urlHandlingStrategy.shouldProcessUrl(d.rawUrl))return RP(d.source)&&(this.browserUrlTree=d.extractedUrl),Bt(d).pipe(pc(D=>{const I=this.transitions.getValue();return r.next(new GC(D.id,this.serializeUrl(D.extractedUrl),D.source,D.restoredState)),I!==this.transitions.getValue()?xt:Promise.resolve(D)}),function SH(e,t,n,r){return pc(i=>function EH(e,t,n,r,i){return new DH(e,t,n,r,i).apply()}(e,t,n,i.extractedUrl,r).pipe(Pe(o=>({...i,urlAfterRedirects:o}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Vo(D=>{this.currentNavigation={...this.currentNavigation,finalUrl:D.urlAfterRedirects},i.urlAfterRedirects=D.urlAfterRedirects}),function OH(e,t,n,r,i,o){return dt(c=>function TH(e,t,n,r,i,o,c="emptyOnly",d="legacy"){return new AH(e,t,n,r,i,c,d,o).recognize().pipe(pc(p=>null===p?function IH(e){return new Nn(t=>t.error(e))}(new MH):Bt(p)))}(e,t,n,c.urlAfterRedirects,r.serialize(c.urlAfterRedirects),r,i,o).pipe(Pe(d=>({...c,targetSnapshot:d}))))}(this.ngModule.injector,this.rootComponentType,this.config,this.urlSerializer,this.paramsInheritanceStrategy,this.relativeLinkResolution),Vo(D=>{if(i.targetSnapshot=D.targetSnapshot,"eager"===this.urlUpdateStrategy){if(!D.extras.skipLocationChange){const P=this.urlHandlingStrategy.merge(D.urlAfterRedirects,D.rawUrl);this.setBrowserUrl(P,D)}this.browserUrlTree=D.urlAfterRedirects}const I=new Sj(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);r.next(I)}));if(v&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:I,extractedUrl:P,source:N,restoredState:G,extras:U}=d,Z=new GC(I,this.serializeUrl(P),N,G);r.next(Z);const ne=iP(P,this.rootComponentType).snapshot;return Bt(i={...d,targetSnapshot:ne,urlAfterRedirects:P,extras:{...U,skipLocationChange:!1,replaceUrl:!1}})}return this.rawUrlTree=d.rawUrl,d.resolve(null),xt}),Vo(d=>{const p=new Mj(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot);this.triggerEvent(p)}),Pe(d=>i={...d,guards:Kj(d.targetSnapshot,d.currentSnapshot,this.rootContexts)}),function lH(e,t){return dt(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:c}}=n;return 0===c.length&&0===o.length?Bt({...n,guardsResult:!0}):function cH(e,t,n,r){return Cr(e).pipe(dt(i=>function mH(e,t,n,r,i){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?Bt(o.map(d=>{const p=Cy(t)??i,v=Kp(d,p);return Rh(function oH(e){return e&&Sy(e.canDeactivate)}(v)?v.canDeactivate(e,t,n,r):p.runInContext(()=>v(e,t,n,r))).pipe(Ah())})).pipe(Jp()):Bt(!0)}(i.component,i.route,n,t,r)),Ah(i=>!0!==i,!0))}(c,r,i,e).pipe(dt(d=>d&&function tH(e){return"boolean"==typeof e}(d)?function uH(e,t,n,r){return Cr(t).pipe(kh(i=>FC(function dH(e,t){return null!==e&&t&&t(new Rj(e)),Bt(!0)}(i.route.parent,r),function hH(e,t){return null!==e&&t&&t(new Oj(e)),Bt(!0)}(i.route,r),function pH(e,t,n){const r=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(c=>function Jj(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(c)).filter(c=>null!==c).map(c=>kk(()=>Bt(c.guards.map(p=>{const v=Cy(c.node)??n,C=Kp(p,v);return Rh(function iH(e){return e&&Sy(e.canActivateChild)}(C)?C.canActivateChild(r,e):v.runInContext(()=>C(r,e))).pipe(Ah())})).pipe(Jp())));return Bt(o).pipe(Jp())}(e,i.path,n),function fH(e,t,n){const r=t.routeConfig?t.routeConfig.canActivate:null;if(!r||0===r.length)return Bt(!0);const i=r.map(o=>kk(()=>{const c=Cy(t)??n,d=Kp(o,c);return Rh(function rH(e){return e&&Sy(e.canActivate)}(d)?d.canActivate(t,e):c.runInContext(()=>d(t,e))).pipe(Ah())}));return Bt(i).pipe(Jp())}(e,i.route,n))),Ah(i=>!0!==i,!0))}(r,o,e,t):Bt(d)),Pe(d=>({...n,guardsResult:d})))})}(this.ngModule.injector,d=>this.triggerEvent(d)),Vo(d=>{if(i.guardsResult=d.guardsResult,hf(d.guardsResult))throw lP(0,d.guardsResult);const p=new Ij(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot,!!d.guardsResult);this.triggerEvent(p)}),uu(d=>!!d.guardsResult||(this.restoreHistory(d),this.cancelNavigationTransition(d,"",3),!1)),iE(d=>{if(d.guards.canActivateChecks.length)return Bt(d).pipe(Vo(p=>{const v=new Tj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}),pc(p=>{let v=!1;return Bt(p).pipe(function LH(e,t){return dt(n=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=n;if(!i.length)return Bt(n);let o=0;return Cr(i).pipe(kh(c=>function NH(e,t,n,r){const i=e.routeConfig,o=e._resolve;return void 0!==i?.title&&!IP(i)&&(o[my]=i.title),function zH(e,t,n,r){const i=function BH(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e)]}(e);if(0===i.length)return Bt({});const o={};return Cr(i).pipe(dt(c=>function VH(e,t,n,r){const i=Cy(t)??r,o=Kp(e,i);return Rh(o.resolve?o.resolve(t,n):i.runInContext(()=>o(t,n)))}(e[c],t,n,r).pipe(Ah(),Vo(d=>{o[c]=d}))),LC(1),function K9(e){return Pe(()=>e)}(o),Ph(c=>tE(c)?xt:fy(c)))}(o,e,t,r).pipe(Pe(c=>(e._resolvedData=c,e.data=oP(e,n).resolve,i&&IP(i)&&(e.data[my]=i.title),null)))}(c.route,r,e,t)),Vo(()=>o++),LC(1),dt(c=>o===i.length?Bt(n):xt))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Vo({next:()=>v=!0,complete:()=>{v||(this.restoreHistory(p),this.cancelNavigationTransition(p,"",2))}}))}),Vo(p=>{const v=new Aj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}))}),iE(d=>{const p=v=>{const C=[];v.routeConfig?.loadComponent&&!v.routeConfig._loadedComponent&&C.push(this.configLoader.loadComponent(v.routeConfig).pipe(Vo(D=>{v.component=D}),Pe(()=>{})));for(const D of v.children)C.push(...p(D));return C};return Tk(p(d.targetSnapshot.root)).pipe(c0(),py(1))}),iE(()=>this.afterPreactivation()),Pe(d=>{const p=function Vj(e,t,n){const r=xy(e,t._root,n?n._root:void 0);return new rP(r,t)}(this.routeReuseStrategy,d.targetSnapshot,d.currentRouterState);return i={...d,targetRouterState:p}}),Vo(d=>{this.currentUrlTree=d.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(d.urlAfterRedirects,d.rawUrl),this.routerState=d.targetRouterState,"deferred"===this.urlUpdateStrategy&&(d.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,d),this.browserUrlTree=d.urlAfterRedirects)}),((e,t,n)=>Pe(r=>(new Yj(t,r.targetRouterState,r.currentRouterState,n).activate(e),r)))(this.rootContexts,this.routeReuseStrategy,d=>this.triggerEvent(d)),Vo({next(){o=!0},complete(){o=!0}}),NC(()=>{o||c||this.cancelNavigationTransition(i,"",1),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),Ph(d=>{if(c=!0,hP(d)){uP(d)||(this.navigated=!0,this.restoreHistory(i,!0));const p=new g0(i.id,this.serializeUrl(i.extractedUrl),d.message,d.cancellationCode);if(r.next(p),uP(d)){const v=this.urlHandlingStrategy.merge(d.url,this.rawUrlTree),C={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||RP(i.source)};this.scheduleNavigation(v,"imperative",null,C,{resolve:i.resolve,reject:i.reject,promise:i.promise})}else i.resolve(!1)}else{this.restoreHistory(i,!0);const p=new eP(i.id,this.serializeUrl(i.extractedUrl),d,i.targetSnapshot??void 0);r.next(p);try{i.resolve(this.errorHandler(d))}catch(v){i.reject(v)}}return xt}))}))}resetRootComponentType(n){this.rootComponentType=n,this.routerState.root.component=this.rootComponentType}setTransition(n){this.transitions.next({...this.transitions.value,...n})}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(n=>{const r="popstate"===n.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{const i={replaceUrl:!0},o=n.state?.navigationId?n.state:null;if(o){const d={...o};delete d.navigationId,delete d.\u0275routerPageId,0!==Object.keys(d).length&&(i.state=d)}const c=this.parseUrl(n.url);this.scheduleNavigation(c,r,o,i)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(n){this.events.next(n)}resetConfig(n){this.config=n.map(eE),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(n,r={}){const{relativeTo:i,queryParams:o,fragment:c,queryParamsHandling:d,preserveFragment:p}=r,v=i||this.routerState.root,C=p?this.currentUrlTree.fragment:c;let D=null;switch(d){case"merge":D={...this.currentUrlTree.queryParams,...o};break;case"preserve":D=this.currentUrlTree.queryParams;break;default:D=o||null}return null!==D&&(D=this.removeEmptyProps(D)),bj(v,this.currentUrlTree,n,D,C??null)}navigateByUrl(n,r={skipLocationChange:!1}){const i=hf(n)?n:this.parseUrl(n),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,"imperative",null,r)}navigate(n,r={skipLocationChange:!1}){return function JH(e){for(let t=0;t{const o=n[i];return null!=o&&(r[i]=o),r},{})}processNavigations(){this.navigations.subscribe(n=>{this.navigated=!0,this.lastSuccessfulId=n.id,this.currentPageId=n.targetPageId,this.events.next(new df(n.id,this.serializeUrl(n.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.titleStrategy?.updateTitle(this.routerState.snapshot),n.resolve(!0)},n=>{this.console.warn(`Unhandled Navigation Error: ${n}`)})}scheduleNavigation(n,r,i,o,c){if(this.disposed)return Promise.resolve(!1);let d,p,v;c?(d=c.resolve,p=c.reject,v=c.promise):v=new Promise((I,P)=>{d=I,p=P});const C=++this.navigationId;let D;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),D=i&&i.\u0275routerPageId?i.\u0275routerPageId:o.replaceUrl||o.skipLocationChange?this.browserPageId??0:(this.browserPageId??0)+1):D=0,this.setTransition({id:C,targetPageId:D,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:n,extras:o,resolve:d,reject:p,promise:v,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),v.catch(I=>Promise.reject(I))}setBrowserUrl(n,r){const i=this.urlSerializer.serialize(n),o={...r.extras.state,...this.generateNgRouterState(r.id,r.targetPageId)};this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",o):this.location.go(i,"",o)}restoreHistory(n,r=!1){if("computed"===this.canceledNavigationResolution){const i=this.currentPageId-n.targetPageId;"popstate"!==n.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==this.currentNavigation?.finalUrl||0===i?this.currentUrlTree===this.currentNavigation?.finalUrl&&0===i&&(this.resetState(n),this.browserUrlTree=n.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(i)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(n),this.resetUrlToCurrentUrlTree())}resetState(n){this.routerState=n.currentRouterState,this.currentUrlTree=n.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(n,r,i){const o=new g0(n.id,this.serializeUrl(n.extractedUrl),r,i);this.triggerEvent(o),n.resolve(!1)}generateNgRouterState(n,r){return"computed"===this.canceledNavigationResolution?{navigationId:n,\u0275routerPageId:r}:{navigationId:n}}}return e.\u0275fac=function(n){q1()},e.\u0275prov=Ot({token:e,factory:function(){return PP()},providedIn:"root"}),e})();function RP(e){return"imperative"!==e}class FP{}let tG=(()=>{class e{constructor(n,r,i,o,c){this.router=n,this.injector=i,this.preloadingStrategy=o,this.loader=c}setUpPreloading(){this.subscription=this.router.events.pipe(uu(n=>n instanceof df),kh(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(n,r){const i=[];for(const o of r){o.providers&&!o._injector&&(o._injector=Rv(o.providers,n,`Route: ${o.path}`));const c=o._injector??n,d=o._loadedInjector??c;o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent?i.push(this.preloadConfig(c,o)):(o.children||o._loadedRoutes)&&i.push(this.processRoutes(d,o.children??o._loadedRoutes))}return Cr(i).pipe(ft())}preloadConfig(n,r){return this.preloadingStrategy.preload(r,()=>{let i;i=r.loadChildren&&void 0===r.canLoad?this.loader.loadChildren(n,r):Bt(null);const o=i.pipe(dt(c=>null===c?Bt(void 0):(r._loadedRoutes=c.routes,r._loadedInjector=c.injector,this.processRoutes(c.injector??n,c.routes))));return r.loadComponent&&!r._loadedComponent?Cr([o,this.loader.loadComponent(r)]).pipe(ft()):o})}}return e.\u0275fac=function(n){return new(n||e)(St(Do),St(Xw),St(Ts),St(FP),St(sE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const cE=new It("");let OP=(()=>{class e{constructor(n,r,i={}){this.router=n,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(n=>{n instanceof GC?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=n.navigationTrigger,this.restoredId=n.restoredState?n.restoredState.navigationId:0):n instanceof df&&(this.lastId=n.id,this.scheduleScrollEvent(n,this.router.parseUrl(n.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(n=>{n instanceof tP&&(n.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(n.position):n.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(n.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(n,r){this.router.triggerEvent(new tP(n,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return e.\u0275fac=function(n){q1()},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();function Qp(e,t){return{\u0275kind:e,\u0275providers:t}}function uE(e){return[{provide:oE,multi:!0,useValue:e}]}function NP(){const e=Fr(Ys);return t=>{const n=e.get(Vv);if(t!==n.components[0])return;const r=e.get(Do),i=e.get(zP);1===e.get(hE)&&r.initialNavigation(),e.get(BP,null,Rt.Optional)?.setUpPreloading(),e.get(cE,null,Rt.Optional)?.init(),r.resetRootComponentType(n.componentTypes[0]),i.closed||(i.next(),i.unsubscribe())}}const zP=new It("",{factory:()=>new oi}),hE=new It("",{providedIn:"root",factory:()=>1});const BP=new It("");function oG(e){return Qp(0,[{provide:BP,useExisting:tG},{provide:FP,useExisting:e}])}const VP=new It("ROUTER_FORROOT_GUARD"),sG=[uC,{provide:Hk,useClass:BC},{provide:Do,useFactory:PP},wy,{provide:ff,useFactory:function LP(e){return e.routerState.root},deps:[Do]},sE];function aG(){return new cA("Router",Do)}let UP=(()=>{class e{constructor(n){}static forRoot(n,r){return{ngModule:e,providers:[sG,[],uE(n),{provide:VP,useFactory:hG,deps:[[Do,new Bd,new Tr]]},{provide:S0,useValue:r||{}},r?.useHash?{provide:lf,useClass:p$}:{provide:lf,useClass:FA},{provide:cE,useFactory:()=>{const e=Fr(Do),t=Fr(k7),n=Fr(S0);return n.scrollOffset&&t.setOffset(n.scrollOffset),new OP(e,t,n)}},r?.preloadingStrategy?oG(r.preloadingStrategy).\u0275providers:[],{provide:cA,multi:!0,useFactory:aG},r?.initialNavigation?dG(r):[],[{provide:$P,useFactory:NP},{provide:nA,multi:!0,useExisting:$P}]]}}static forChild(n){return{ngModule:e,providers:[uE(n)]}}}return e.\u0275fac=function(n){return new(n||e)(St(VP,8))},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[JC]}),e})();function hG(e){return"guarded"}function dG(e){return["disabled"===e.initialNavigation?Qp(3,[{provide:Nv,multi:!0,useFactory:()=>{const t=Fr(Do);return()=>{t.setUpLocationChangeListener()}}},{provide:hE,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?Qp(2,[{provide:hE,useValue:0},{provide:Nv,multi:!0,deps:[Ys],useFactory:t=>{const n=t.get(d$,Promise.resolve());let r=!1;return()=>n.then(()=>new Promise(o=>{const c=t.get(Do),d=t.get(zP);(function i(o){t.get(Do).events.pipe(uu(d=>d instanceof df||d instanceof g0||d instanceof eP),Pe(d=>d instanceof df||d instanceof g0&&(0===d.code||1===d.code)&&null),uu(d=>null!==d),py(1)).subscribe(()=>{o()})})(()=>{o(!0),r=!0}),c.afterPreactivation=()=>(o(!0),r||d.closed?Bt(void 0):d),c.initialNavigation()}))}}]).\u0275providers:[]]}const $P=new It(""),pG=[];let mG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[UP.forRoot(pG),UP]}),e})();class jP{}class HP{}class gc{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(n=>{const r=n.indexOf(":");if(r>0){const i=n.slice(0,r),o=i.toLowerCase(),c=n.slice(r+1).trim();this.maybeSetNormalizedName(i,o),this.headers.has(o)?this.headers.get(o).push(c):this.headers.set(o,[c])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(n=>{let r=t[n];const i=n.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(n,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const n=this.headers.get(t.toLowerCase());return n&&n.length>0?n[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,n){return this.clone({name:t,value:n,op:"a"})}set(t,n){return this.clone({name:t,value:n,op:"s"})}delete(t,n){return this.clone({name:t,value:n,op:"d"})}maybeSetNormalizedName(t,n){this.normalizedNames.has(n)||this.normalizedNames.set(n,t)}init(){this.lazyInit&&(this.lazyInit instanceof gc?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(n=>{this.headers.set(n,t.headers.get(n)),this.normalizedNames.set(n,t.normalizedNames.get(n))})}clone(t){const n=new gc;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof gc?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([t]),n}applyUpdate(t){const n=t.name.toLowerCase();switch(t.op){case"a":case"s":let r=t.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(t.name,n);const i=("a"===t.op?this.headers.get(n):void 0)||[];i.push(...r),this.headers.set(n,i);break;case"d":const o=t.value;if(o){let c=this.headers.get(n);if(!c)return;c=c.filter(d=>-1===o.indexOf(d)),0===c.length?(this.headers.delete(n),this.normalizedNames.delete(n)):this.headers.set(n,c)}else this.headers.delete(n),this.normalizedNames.delete(n)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(n=>t(this.normalizedNames.get(n),this.headers.get(n)))}}class gG{encodeKey(t){return GP(t)}encodeValue(t){return GP(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const _G=/%(\d[a-f0-9])/gi,vG={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function GP(e){return encodeURIComponent(e).replace(_G,(t,n)=>vG[n]??t)}function A0(e){return`${e}`}class fu{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new gG,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function yG(e,t){const n=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(i=>{const o=i.indexOf("="),[c,d]=-1==o?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,o)),t.decodeValue(i.slice(o+1))],p=n.get(c)||[];p.push(d),n.set(c,p)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(n=>{const r=t.fromObject[n],i=Array.isArray(r)?r.map(A0):[A0(r)];this.map.set(n,i)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const n=this.map.get(t);return n?n[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,n){return this.clone({param:t,value:n,op:"a"})}appendAll(t){const n=[];return Object.keys(t).forEach(r=>{const i=t[r];Array.isArray(i)?i.forEach(o=>{n.push({param:r,value:o,op:"a"})}):n.push({param:r,value:i,op:"a"})}),this.clone(n)}set(t,n){return this.clone({param:t,value:n,op:"s"})}delete(t,n){return this.clone({param:t,value:n,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const n=this.encoder.encodeKey(t);return this.map.get(t).map(r=>n+"="+this.encoder.encodeValue(r)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const n=new fu({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(t),n}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const n=("a"===t.op?this.map.get(t.param):void 0)||[];n.push(A0(t.value)),this.map.set(t.param,n);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let r=this.map.get(t.param)||[];const i=r.indexOf(A0(t.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(t.param,r):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class k0{constructor(){this.map=new Map}set(t,n){return this.map.set(t,n),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}}function qP(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer}function ZP(e){return typeof Blob<"u"&&e instanceof Blob}function WP(e){return typeof FormData<"u"&&e instanceof FormData}class Iy{constructor(t,n,r,i){let o;if(this.url=n,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function bG(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,o=i):o=r,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new gc),this.context||(this.context=new k0),this.params){const c=this.params.toString();if(0===c.length)this.urlWithParams=n;else{const d=n.indexOf("?");this.urlWithParams=n+(-1===d?"?":dD.set(I,t.setHeaders[I]),p)),t.setParams&&(v=Object.keys(t.setParams).reduce((D,I)=>D.set(I,t.setParams[I]),v)),new Iy(n,r,o,{params:v,headers:p,context:C,reportProgress:d,responseType:i,withCredentials:c})}}var bi=(()=>((bi=bi||{})[bi.Sent=0]="Sent",bi[bi.UploadProgress=1]="UploadProgress",bi[bi.ResponseHeader=2]="ResponseHeader",bi[bi.DownloadProgress=3]="DownloadProgress",bi[bi.Response=4]="Response",bi[bi.User=5]="User",bi))();class fE{constructor(t,n=200,r="OK"){this.headers=t.headers||new gc,this.status=void 0!==t.status?t.status:n,this.statusText=t.statusText||r,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class pE extends fE{constructor(t={}){super(t),this.type=bi.ResponseHeader}clone(t={}){return new pE({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class P0 extends fE{constructor(t={}){super(t),this.type=bi.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new P0({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class XP extends fE{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function mE(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let YP=(()=>{class e{constructor(n){this.handler=n}request(n,r,i={}){let o;if(n instanceof Iy)o=n;else{let p,v;p=i.headers instanceof gc?i.headers:new gc(i.headers),i.params&&(v=i.params instanceof fu?i.params:new fu({fromObject:i.params})),o=new Iy(n,r,void 0!==i.body?i.body:null,{headers:p,context:i.context,params:v,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const c=Bt(o).pipe(kh(p=>this.handler.handle(p)));if(n instanceof Iy||"events"===i.observe)return c;const d=c.pipe(uu(p=>p instanceof P0));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return p.body}));case"blob":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof Blob))throw new Error("Response is not a Blob.");return p.body}));case"text":return d.pipe(Pe(p=>{if(null!==p.body&&"string"!=typeof p.body)throw new Error("Response is not a string.");return p.body}));default:return d.pipe(Pe(p=>p.body))}case"response":return d;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(n,r={}){return this.request("DELETE",n,r)}get(n,r={}){return this.request("GET",n,r)}head(n,r={}){return this.request("HEAD",n,r)}jsonp(n,r){return this.request("JSONP",n,{params:(new fu).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(n,r={}){return this.request("OPTIONS",n,r)}patch(n,r,i={}){return this.request("PATCH",n,mE(i,r))}post(n,r,i={}){return this.request("POST",n,mE(i,r))}put(n,r,i={}){return this.request("PUT",n,mE(i,r))}}return e.\u0275fac=function(n){return new(n||e)(St(jP))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();class KP{constructor(t,n){this.next=t,this.interceptor=n}handle(t){return this.interceptor.intercept(t,this.next)}}const JP=new It("HTTP_INTERCEPTORS");let wG=(()=>{class e{intercept(n,r){return r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const CG=/^\)\]\}',?\n/;let QP=(()=>{class e{constructor(n){this.xhrFactory=n}handle(n){if("JSONP"===n.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new Nn(r=>{const i=this.xhrFactory.build();if(i.open(n.method,n.urlWithParams),n.withCredentials&&(i.withCredentials=!0),n.headers.forEach((P,N)=>i.setRequestHeader(P,N.join(","))),n.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!n.headers.has("Content-Type")){const P=n.detectContentTypeHeader();null!==P&&i.setRequestHeader("Content-Type",P)}if(n.responseType){const P=n.responseType.toLowerCase();i.responseType="json"!==P?P:"text"}const o=n.serializeBody();let c=null;const d=()=>{if(null!==c)return c;const P=i.statusText||"OK",N=new gc(i.getAllResponseHeaders()),G=function EG(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||n.url;return c=new pE({headers:N,status:i.status,statusText:P,url:G}),c},p=()=>{let{headers:P,status:N,statusText:G,url:U}=d(),Z=null;204!==N&&(Z=typeof i.response>"u"?i.responseText:i.response),0===N&&(N=Z?200:0);let ne=N>=200&&N<300;if("json"===n.responseType&&"string"==typeof Z){const X=Z;Z=Z.replace(CG,"");try{Z=""!==Z?JSON.parse(Z):null}catch(re){Z=X,ne&&(ne=!1,Z={error:re,text:Z})}}ne?(r.next(new P0({body:Z,headers:P,status:N,statusText:G,url:U||void 0})),r.complete()):r.error(new XP({error:Z,headers:P,status:N,statusText:G,url:U||void 0}))},v=P=>{const{url:N}=d(),G=new XP({error:P,status:i.status||0,statusText:i.statusText||"Unknown Error",url:N||void 0});r.error(G)};let C=!1;const D=P=>{C||(r.next(d()),C=!0);let N={type:bi.DownloadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),"text"===n.responseType&&!!i.responseText&&(N.partialText=i.responseText),r.next(N)},I=P=>{let N={type:bi.UploadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),r.next(N)};return i.addEventListener("load",p),i.addEventListener("error",v),i.addEventListener("timeout",v),i.addEventListener("abort",v),n.reportProgress&&(i.addEventListener("progress",D),null!==o&&i.upload&&i.upload.addEventListener("progress",I)),i.send(o),r.next({type:bi.Sent}),()=>{i.removeEventListener("error",v),i.removeEventListener("abort",v),i.removeEventListener("load",p),i.removeEventListener("timeout",v),n.reportProgress&&(i.removeEventListener("progress",D),null!==o&&i.upload&&i.upload.removeEventListener("progress",I)),i.readyState!==i.DONE&&i.abort()}})}}return e.\u0275fac=function(n){return new(n||e)(St(rk))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})();const gE=new It("XSRF_COOKIE_NAME"),yE=new It("XSRF_HEADER_NAME");class eR{}let DG=(()=>{class e{constructor(n,r,i){this.doc=n,this.platform=r,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const n=this.doc.cookie||"";return n!==this.lastCookieString&&(this.parseCount++,this.lastToken=HA(n,this.cookieName),this.lastCookieString=n),this.lastToken}}return e.\u0275fac=function(n){return new(n||e)(St(as),St(Ww),St(gE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),_E=(()=>{class e{constructor(n,r){this.tokenService=n,this.headerName=r}intercept(n,r){const i=n.url.toLowerCase();if("GET"===n.method||"HEAD"===n.method||i.startsWith("http://")||i.startsWith("https://"))return r.handle(n);const o=this.tokenService.getToken();return null!==o&&!n.headers.has(this.headerName)&&(n=n.clone({headers:n.headers.set(this.headerName,o)})),r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(eR),St(yE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),SG=(()=>{class e{constructor(n,r){this.backend=n,this.injector=r,this.chain=null}handle(n){if(null===this.chain){const r=this.injector.get(JP,[]);this.chain=r.reduceRight((i,o)=>new KP(i,o),this.backend)}return this.chain.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(HP),St(Ys))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac}),e})(),MG=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:_E,useClass:wG}]}}static withOptions(n={}){return{ngModule:e,providers:[n.cookieName?{provide:gE,useValue:n.cookieName}:[],n.headerName?{provide:yE,useValue:n.headerName}:[]]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[_E,{provide:JP,useExisting:_E,multi:!0},{provide:eR,useClass:DG},{provide:gE,useValue:"XSRF-TOKEN"},{provide:yE,useValue:"X-XSRF-TOKEN"}]}),e})(),IG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({providers:[YP,{provide:jP,useClass:SG},QP,{provide:HP,useExisting:QP}],imports:[MG.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]}),e})();class TG{encodeKey(t){return encodeURIComponent(t)}encodeValue(t){return encodeURIComponent(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const AG=new It("basePath");class tR{constructor(t={}){this.apiKeys=t.apiKeys,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.withCredentials=t.withCredentials,this.encoder=t.encoder,this.encodeParam=t.encodeParam?t.encodeParam:n=>this.defaultEncodeParam(n),this.credentials=t.credentials?t.credentials:{}}selectHeaderContentType(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}selectHeaderAccept(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(n.test(t)||"application/json-patch+json"===t.toLowerCase())}lookupCredential(t){const n=this.credentials[t];return"function"==typeof n?n():n}defaultEncodeParam(t){const n="date-time"===t.dataFormat?t.value.toISOString():t.value;return encodeURIComponent(String(n))}}let vE=(()=>{class e{constructor(n,r,i){this.httpClient=n,this.basePath="http://localhost",this.defaultHeaders=new gc,this.configuration=new tR,i&&(this.configuration=i),"string"!=typeof this.configuration.basePath&&(Array.isArray(r)&&r.length>0&&(r=r[0]),"string"!=typeof r&&(r=this.basePath),this.configuration.basePath=r),this.encoder=this.configuration.encoder||new TG}addToHttpParams(n,r,i){return"object"!=typeof r||r instanceof Date?this.addToHttpParamsRecursive(n,r,i):this.addToHttpParamsRecursive(n,r)}addToHttpParamsRecursive(n,r,i){if(null==r)return n;if("object"==typeof r)if(Array.isArray(r))r.forEach(o=>n=this.addToHttpParamsRecursive(n,o,i));else if(r instanceof Date){if(null==i)throw Error("key may not be null if value is Date");n=n.append(i,r.toISOString().substr(0,10))}else Object.keys(r).forEach(o=>n=this.addToHttpParamsRecursive(n,r[o],null!=i?`${i}.${o}`:o));else{if(null==i)throw Error("key may not be null if value is not object or array");n=n.append(i,r)}return n}paxServiceGetDevice(n,r="body",i=!1,o){if(null==n)throw new Error("Required parameter id was null or undefined when calling paxServiceGetDevice.");let c=this.defaultHeaders,d=o&&o.httpHeaderAccept;void 0===d&&(d=this.configuration.selectHeaderAccept(["application/json"])),void 0!==d&&(c=c.set("Accept",d));let p=o&&o.context;void 0===p&&(p=new k0);let v="json";d&&(v=d.startsWith("text")?"text":this.configuration.isJsonMime(d)?"json":"blob");let C=`/api/v1/devices/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`;return this.httpClient.request("get",`${this.configuration.basePath}${C}`,{context:p,responseType:v,withCredentials:this.configuration.withCredentials,headers:c,observe:r,reportProgress:i})}paxServiceListData(n,r,i,o="body",c=!1,d){let p=new fu({encoder:this.encoder});null!=n&&(p=this.addToHttpParams(p,n,"since")),null!=r&&(p=this.addToHttpParams(p,r,"until")),null!=i&&(p=this.addToHttpParams(p,i,"limit"));let v=this.defaultHeaders,C=d&&d.httpHeaderAccept;void 0===C&&(C=this.configuration.selectHeaderAccept(["application/json"])),void 0!==C&&(v=v.set("Accept",C));let D=d&&d.context;void 0===D&&(D=new k0);let I="json";return C&&(I=C.startsWith("text")?"text":this.configuration.isJsonMime(C)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/data`,{context:D,params:p,responseType:I,withCredentials:this.configuration.withCredentials,headers:v,observe:o,reportProgress:c})}paxServiceListDevices(n="body",r=!1,i){let o=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(o=o.set("Accept",c));let d=i&&i.context;void 0===d&&(d=new k0);let p="json";return c&&(p=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/devices`,{context:d,responseType:p,withCredentials:this.configuration.withCredentials,headers:o,observe:n,reportProgress:r})}}return e.\u0275fac=function(n){return new(n||e)(St(YP),St(AG,8),St(tR,8))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class kG extends vr{constructor(t,n){super()}schedule(t,n=0){return this}}const R0={setInterval(e,t,...n){const{delegate:r}=R0;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){const{delegate:t}=R0;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},bE={now:()=>(bE.delegate||Date).now(),delegate:void 0};class Ty{constructor(t,n=Ty.now){this.schedulerActionCtor=t,this.now=n}schedule(t,n=0,r){return new this.schedulerActionCtor(this,t).schedule(r,n)}}Ty.now=bE.now;const nR=new class RG extends Ty{constructor(t,n=Ty.now){super(t,n),this.actions=[],this._active=!1}flush(t){const{actions:n}=this;if(this._active)return void n.push(t);let r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=n.shift());if(this._active=!1,r){for(;t=n.shift();)t.unsubscribe();throw r}}}(class PG extends kG{constructor(t,n){super(t,n),this.scheduler=t,this.work=n,this.pending=!1}schedule(t,n=0){var r;if(this.closed)return this;this.state=t;const i=this.id,o=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(o,this.id,n),this}requestAsyncId(t,n,r=0){return R0.setInterval(t.flush.bind(t,this),r)}recycleAsyncId(t,n,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return n;null!=n&&R0.clearInterval(n)}execute(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(t,n);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,n){let i,r=!1;try{this.work(t)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){const{id:t,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,b(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,super.unsubscribe()}}}),FG=nR;class F0 extends oi{constructor(t=1/0,n=1/0,r=bE){super(),this._bufferSize=t,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,n)}next(t){const{isStopped:n,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:c}=this;n||(r.push(t),!i&&r.push(o.now()+c)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const n=this._innerSubscribe(t),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let c=0;c{class e{constructor(n){this.paxService=n,this.errorMessage="",this.lastDataUpdate=new Date,this.dataSubject=new F0,this.activeDeviceSubject=new F0,this.allSamples=[],this.allActiveDevices=[],this.fetchData()}activeDevices(){return this.activeDeviceSubject}fetchData(){let r=""+((new Date).getTime()-864e5),i=""+(new Date).getTime();this.lastDataUpdate=new Date,this.paxService.paxServiceListData(r,i).subscribe({next:o=>{o.data&&(this.allSamples=o.data),this.allSamples.forEach(c=>{c.samples?.forEach(d=>{this.dataSubject.next({id:c.deviceId||"",name:c.deviceName||"",time:new Date(parseInt(d.timestamp)),ble:d.bluetoothCount||0,wifi:d.wifiCount||0})})}),this.allActiveDevices=this.allSamples.map(c=>({id:c.deviceId,name:c.deviceName,lat:c.lat,lon:c.lon})),this.allActiveDevices.forEach(c=>{this.activeDeviceSubject.next(c),this.allActiveDevices.push(c)})},error:o=>{this.errorMessage=o.message,this.activeDeviceSubject.error(o),this.dataSubject.complete()},complete:()=>{this.activeDeviceSubject.complete(),this.dataSubject.complete()}})}hasError(){return""!=this.errorMessage}allData(){return(new Date).getTime()-this.lastDataUpdate.getTime()>6e4&&(this.dataSubject=new F0,this.activeDeviceSubject=new F0,this.fetchData()),this.dataSubject}addMapMarkers(n){this.allActiveDevices.forEach(r=>{if(r.lat&&0!=r.lat&&r.lon&&0!=r.lon){let i=new O0.Marker({color:"#ff0000"});i.setLngLat([r.lat,r.lon]),i.addTo(n)}})}}return e.\u0275fac=function(n){return new(n||e)(St(vE))},e.\u0275prov=Ot({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function xl(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function BG(e){return 0|e.length}function VG(e){return!(e>0)}function UG(e){return"object"!=typeof e||"length"in e?e:Array.from(e)}function Ay(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function xE(e,t){let r,n=0,i=0,o=0;if(void 0===t)for(let c of e)null!=c&&(c=+c)>=c&&(r=c-i,i+=r/++n,o+=r*(c-i));else{let c=-1;for(let d of e)null!=(d=t(d,++c,e))&&(d=+d)>=d&&(r=d-i,i+=r/++n,o+=r*(d-i))}if(n>1)return o/(n-1)}function rR(e,t){const n=xE(e,t);return n&&Math.sqrt(n)}function em(e,t){let n,r;if(void 0===t)for(const i of e)null!=i&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r=o&&(n=r=o):(n>o&&(n=o),r=r.length)return n(o);const d=new N0,p=r[c++];let v=-1;for(const C of o){const D=p(C,++v,o),I=d.get(D);I?I.push(C):d.set(D,[C])}for(const[C,D]of d)d.set(C,i(D,c));return t(d)}(e,0)}function ls(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function qG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const o of e)++i,null!=o&&(n=o)&&(n=o,r=i);else for(let o of e)null!=(o=t(o,++i,e))&&(n=o)&&(n=o,r=i);return r}function ZG(e,t){let n=0,r=0;if(void 0===t)for(let i of e)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Fh(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function z0(e,...t){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&2!==n.length||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const c of t){const d=Py(c[i],c[o]);if(d)return d}})):(n=e.map(n),r.sort((i,o)=>Py(n[i],n[o]))),function WG(e,t){return Array.from(t,n=>e[n])}(e,r)}return e.sort(DE(n))}function DE(e=xl){if(e===xl)return Py;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}function Py(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function uR(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?Py:DE(i);r>n;){if(r-n>600){const p=r-n+1,v=t-n+1,C=Math.log(p),D=.5*Math.exp(2*C/3),I=.5*Math.sqrt(C*D*(p-D)/p)*(v-p/2<0?-1:1);uR(e,t,Math.max(n,Math.floor(t-v*D/p+I)),Math.min(r,Math.floor(t+(p-v)*D/p+I)),i)}const o=e[t];let c=n,d=r;for(Ry(e,n,t),i(e[r],o)>0&&Ry(e,n,r);c0;)--d}0===i(e[n],o)?Ry(e,n,d):(++d,Ry(e,d,r)),d<=t&&(n=d+1),t<=d&&(r=d-1)}return e}function Ry(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function hR(e){return null===e?NaN:+e}function B0(e,t,n){if(e=Float64Array.from(function*XG(e,t){if(void 0===t)for(let n of e)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return Fh(e);if(t>=1)return ls(e);var r,i=(r-1)*t,o=Math.floor(i),c=ls(uR(e,o).subarray(0,o+1));return c+(Fh(e.subarray(o+1))-c)*(i-o)}}function YG(e,t,n=hR){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),c=+n(e[o],o,e);return c+(+n(e[o+1],o+1,e)-c)*(i-o)}}function V0(e,t){return B0(e,.5,t)}function KG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const o of e)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(let o of e)null!=(o=t(o,++i,e))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function dR(e,t){const n=new N0;if(void 0===t)for(let o of e)null!=o&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let c of e)null!=(c=t(c,++o,e))&&c>=c&&n.set(c,(n.get(c)||0)+1)}let r,i=0;for(const[o,c]of n)c>i&&(i=c,r=o);return r}function fR(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++rt(n[d],n[p]);let o,c;return(e=Uint32Array.from(n,(d,p)=>p)).sort(t===xl?(d,p)=>Py(n[d],n[p]):DE(i)),e.forEach((d,p)=>{const v=i(d,void 0===o?d:o);v>=0?((void 0===o||v>0)&&(o=d,c=p),r[d]=c):r[d]=NaN}),r}function U0(e,t){let n=0;if(void 0===t)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}const JG=Math.sqrt(50),QG=Math.sqrt(10),eq=Math.sqrt(2);function $0(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),c=o>=JG?10:o>=QG?5:o>=eq?2:1;let d,p,v;return i<0?(v=Math.pow(10,-i)/c,d=Math.round(e*v),p=Math.round(t*v),d/vt&&--p,v=-v):(v=Math.pow(10,i)*c,d=Math.round(e/v),p=Math.round(t/v),d*vt&&--p),p0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const d=o-i+1,p=new Array(d);if(r)if(c<0)for(let v=0;v+e(t)}function oq(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function sq(){return!this.__axis}function Z0(e,t){var n=[],r=null,i=null,o=6,c=6,d=3,p=typeof window<"u"&&window.devicePixelRatio>1?0:.5,v=1===e||4===e?-1:1,C=4===e||2===e?"x":"y",D=1===e||3===e?nq:rq;function I(P){var N=r??(t.ticks?t.ticks.apply(t,n):t.domain()),G=i??(t.tickFormat?t.tickFormat.apply(t,n):tq),U=Math.max(o,0)+d,Z=t.range(),ne=+Z[0]+p,X=+Z[Z.length-1]+p,re=(t.bandwidth?oq:iq)(t.copy(),p),fe=P.selection?P.selection():P,ve=fe.selectAll(".domain").data([null]),Re=fe.selectAll(".tick").data(N,t).order(),We=Re.exit(),Ke=Re.enter().append("g").attr("class","tick"),lt=Re.select("line"),Ue=Re.select("text");ve=ve.merge(ve.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),Re=Re.merge(Ke),lt=lt.merge(Ke.append("line").attr("stroke","currentColor").attr(C+"2",v*o)),Ue=Ue.merge(Ke.append("text").attr("fill","currentColor").attr(C,v*U).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),P!==fe&&(ve=ve.transition(P),Re=Re.transition(P),lt=lt.transition(P),Ue=Ue.transition(P),We=We.transition(P).attr("opacity",1e-6).attr("transform",function(st){return isFinite(st=re(st))?D(st+p):this.getAttribute("transform")}),Ke.attr("opacity",1e-6).attr("transform",function(st){var Fe=this.parentNode.__axis;return D((Fe&&isFinite(Fe=Fe(st))?Fe:re(st))+p)})),We.remove(),ve.attr("d",4===e||2===e?c?"M"+v*c+","+ne+"H"+p+"V"+X+"H"+v*c:"M"+p+","+ne+"V"+X:c?"M"+ne+","+v*c+"V"+p+"H"+X+"V"+v*c:"M"+ne+","+p+"H"+X),Re.attr("opacity",1).attr("transform",function(st){return D(re(st)+p)}),lt.attr(C+"2",v*o),Ue.attr(C,v*U).text(G),fe.filter(sq).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),fe.each(function(){this.__axis=re})}return I.scale=function(P){return arguments.length?(t=P,I):t},I.ticks=function(){return n=Array.from(arguments),I},I.tickArguments=function(P){return arguments.length?(n=null==P?[]:Array.from(P),I):n.slice()},I.tickValues=function(P){return arguments.length?(r=null==P?null:Array.from(P),I):r&&r.slice()},I.tickFormat=function(P){return arguments.length?(i=P,I):i},I.tickSize=function(P){return arguments.length?(o=c=+P,I):o},I.tickSizeInner=function(P){return arguments.length?(o=+P,I):o},I.tickSizeOuter=function(P){return arguments.length?(c=+P,I):c},I.tickPadding=function(P){return arguments.length?(d=+P,I):d},I.offset=function(P){return arguments.length?(p=+P,I):p},I}function lq(){}function TE(e){return null==e?lq:function(){return this.querySelector(e)}}function uq(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function hq(){return[]}function gR(e){return null==e?hq:function(){return this.querySelectorAll(e)}}function yR(e){return function(){return this.matches(e)}}function _R(e){return function(t){return t.matches(e)}}var pq=Array.prototype.find;function gq(){return this.firstElementChild}var _q=Array.prototype.filter;function vq(){return Array.from(this.children)}function vR(e){return new Array(e.length)}function W0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Eq(e){return function(){return e}}function Dq(e,t,n,r,i,o){for(var d,c=0,p=t.length,v=o.length;ct?1:e>=t?0:NaN}W0.prototype={constructor:W0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var AE="http://www.w3.org/1999/xhtml";const nm={svg:"http://www.w3.org/2000/svg",xhtml:AE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function X0(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),nm.hasOwnProperty(t)?{space:nm[t],local:e}:e}function $q(e){return function(){this.removeAttribute(e)}}function jq(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hq(e,t){return function(){this.setAttribute(e,t)}}function Gq(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Zq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Xq(e){return function(){this.style.removeProperty(e)}}function Yq(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Kq(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function rm(e,t){return e.style.getPropertyValue(t)||bR(e).getComputedStyle(e,null).getPropertyValue(t)}function Qq(e){return function(){delete this[e]}}function eZ(e,t){return function(){this[e]=t}}function tZ(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function xR(e){return e.trim().split(/^|\s+/)}function kE(e){return e.classList||new wR(e)}function wR(e){this._node=e,this._names=xR(e.getAttribute("class")||"")}function CR(e,t){for(var n=kE(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function PZ(e){return function(){var t=this.__on;if(t){for(var o,n=0,r=-1,i=t.length;n=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var SR=[null];function Js(e,t){this._groups=e,this._parents=t}function MR(){return new Js([[document.documentElement]],SR)}Js.prototype=MR.prototype={constructor:Js,select:function cq(e){"function"!=typeof e&&(e=TE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=X&&(X=ne+1);!(fe=U[X])&&++X=0;)(c=r[i])&&(o&&4^c.compareDocumentPosition(o)&&o.parentNode.insertBefore(c,o),o=c);return this},sort:function Fq(e){function t(D,I){return D&&I?e(D.__data__,I.__data__):!D-!I}e||(e=Oq);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==t?Xq:"function"==typeof t?Kq:Yq)(e,t,n??"")):rm(this.node(),e)},property:function nZ(e,t){return arguments.length>1?this.each((null==t?Qq:"function"==typeof t?tZ:eZ)(e,t)):this.node()[e]},classed:function sZ(e,t){var n=xR(e+"");if(arguments.length<2){for(var r=kE(this.node()),i=-1,o=n.length;++i{}};function IR(){for(var r,e=0,t=arguments.length,n={};e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function $Z(e,t){for(var i,n=0,r=e.length;n0)for(var i,o,n=new Array(i),r=0;r=0&&e._call.call(void 0,t),e=e._next;--im}()}finally{im=0,function ZZ(){for(var e,n,t=K0,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K0=n);zy=e,FE(r)}(),pf=0}}function qZ(){var e=By.now(),t=e-J0;t>1e3&&(Q0-=t,J0=e)}function FE(e){im||(Ly&&(Ly=clearTimeout(Ly)),e-pf>24?(e<1/0&&(Ly=setTimeout(RR,e-By.now()-Q0)),Ny&&(Ny=clearInterval(Ny))):(Ny||(J0=By.now(),Ny=setInterval(qZ,1e3)),im=1,kR(RR)))}function FR(e,t,n){var r=new eb;return r.restart(i=>{r.stop(),e(i+t)},t=null==t?0:+t,n),r}eb.prototype=PR.prototype={constructor:eb,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?RE():+n)+(null==t?0:+t),!this._next&&zy!==this&&(zy?zy._next=this:K0=this,zy=this),this._call=e,this._time=n,FE()},stop:function(){this._call&&(this._call=null,this._time=1/0,FE())}};var WZ=jZ("start","end","cancel","interrupt"),XZ=[];function rb(e,t,n,r,i,o){var c=e.__transition;if(c){if(n in c)return}else e.__transition={};!function YZ(e,t,n){var i,r=e.__transition;function c(v){var C,D,I,P;if(1!==n.state)return p();for(C in r)if((P=r[C]).name===n.name){if(3===P.state)return FR(c);4===P.state?(P.state=6,P.timer.stop(),P.on.call("interrupt",e,e.__data__,P.index,P.group),delete r[C]):+C0)throw new Error("too late; already scheduled");return n}function yc(e,t){var n=wl(e,t);if(n.state>3)throw new Error("too late; already running");return n}function wl(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Uo(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var ib,zR=180/Math.PI,zE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function BR(e,t,n,r,i,o){var c,d,p;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(p=e*n+t*r)&&(n-=e*p,r-=t*p),(d=Math.sqrt(n*n+r*r))&&(n/=d,r/=d,p/=d),e*r180?C+=360:C-v>180&&(v+=360),I.push({i:D.push(i(D)+"rotate(",null,r)-2,x:Uo(v,C)})):C&&D.push(i(D)+"rotate("+C+r)}(v.rotate,C.rotate,D,I),function d(v,C,D,I){v!==C?I.push({i:D.push(i(D)+"skewX(",null,r)-2,x:Uo(v,C)}):C&&D.push(i(D)+"skewX("+C+r)}(v.skewX,C.skewX,D,I),function p(v,C,D,I,P,N){if(v!==D||C!==I){var G=P.push(i(P)+"scale(",null,",",null,")");N.push({i:G-4,x:Uo(v,D)},{i:G-2,x:Uo(C,I)})}else(1!==D||1!==I)&&P.push(i(P)+"scale("+D+","+I+")")}(v.scaleX,v.scaleY,C.scaleX,C.scaleY,D,I),v=C=null,function(P){for(var U,N=-1,G=I.length;++N>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ob(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ob(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=aW.exec(e))?new eo(t[1],t[2],t[3],1):(t=lW.exec(e))?new eo(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=cW.exec(e))?ob(t[1],t[2],t[3],t[4]):(t=uW.exec(e))?ob(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=hW.exec(e))?ZR(t[1],t[2]/100,t[3]/100,1):(t=dW.exec(e))?ZR(t[1],t[2]/100,t[3]/100,t[4]):UR.hasOwnProperty(e)?HR(UR[e]):"transparent"===e?new eo(NaN,NaN,NaN,0):null}function HR(e){return new eo(e>>16&255,e>>8&255,255&e,1)}function ob(e,t,n,r){return r<=0&&(e=t=n=NaN),new eo(e,t,n,r)}function VE(e){return e instanceof Oh||(e=Lh(e)),e?new eo((e=e.rgb()).r,e.g,e.b,e.opacity):new eo}function Nh(e,t,n,r){return 1===arguments.length?VE(e):new eo(e,t,n,r??1)}function eo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function GR(){return`#${yf(this.r)}${yf(this.g)}${yf(this.b)}`}function qR(){const e=sb(this.opacity);return`${1===e?"rgb(":"rgba("}${gf(this.r)}, ${gf(this.g)}, ${gf(this.b)}${1===e?")":`, ${e})`}`}function sb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yf(e){return((e=gf(e))<16?"0":"")+e.toString(16)}function ZR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cl(e,t,n,r)}function WR(e){if(e instanceof Cl)return new Cl(e.h,e.s,e.l,e.opacity);if(e instanceof Oh||(e=Lh(e)),!e)return new Cl;if(e instanceof Cl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),c=NaN,d=o-i,p=(o+i)/2;return d?(c=t===o?(n-r)/d+6*(n0&&p<1?0:c,new Cl(c,d,p,e.opacity)}function UE(e,t,n,r){return 1===arguments.length?WR(e):new Cl(e,t,n,r??1)}function Cl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function XR(e){return(e=(e||0)%360)<0?e+360:e}function ab(e){return Math.max(0,Math.min(1,e||0))}function $E(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function YR(e,t,n,r,i){var o=e*e,c=o*e;return((1-3*e+3*o-c)*t+(4-6*o+3*c)*n+(1+3*e+3*o-3*c)*r+c*i)/6}om(Oh,Lh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$R,formatHex:$R,formatHex8:function fW(){return this.rgb().formatHex8()},formatHsl:function pW(){return WR(this).formatHsl()},formatRgb:jR,toString:jR}),om(eo,Nh,Vy(Oh,{brighter(e){return e=null==e?sm:Math.pow(sm,e),new eo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new eo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new eo(gf(this.r),gf(this.g),gf(this.b),sb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:GR,formatHex:GR,formatHex8:function mW(){return`#${yf(this.r)}${yf(this.g)}${yf(this.b)}${yf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:qR,toString:qR})),om(Cl,UE,Vy(Oh,{brighter(e){return e=null==e?sm:Math.pow(sm,e),new Cl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Cl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new eo($E(e>=240?e-240:e+120,i,r),$E(e,i,r),$E(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Cl(XR(this.h),ab(this.s),ab(this.l),sb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=sb(this.opacity);return`${1===e?"hsl(":"hsla("}${XR(this.h)}, ${100*ab(this.s)}%, ${100*ab(this.l)}%${1===e?")":`, ${e})`}`}}));const lb=e=>()=>e;function KR(e,t){return function(n){return e+n*t}}function jE(e,t){var n=t-e;return n?KR(e,n>180||n<-180?n-360*Math.round(n/360):n):lb(isNaN(e)?t:e)}function to(e,t){var n=t-e;return n?KR(e,n):lb(isNaN(e)?t:e)}const _f=function e(t){var n=function vW(e){return 1==(e=+e)?to:function(t,n){return n-t?function _W(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):lb(isNaN(t)?n:t)}}(t);function r(i,o){var c=n((i=Nh(i)).r,(o=Nh(o)).r),d=n(i.g,o.g),p=n(i.b,o.b),v=to(i.opacity,o.opacity);return function(C){return i.r=c(C),i.g=d(C),i.b=p(C),i.opacity=v(C),i+""}}return r.gamma=e,r}(1);function JR(e){return function(t){var c,d,n=t.length,r=new Array(n),i=new Array(n),o=new Array(n);for(c=0;c=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1];return YR((n-r/t)*t,r>0?e[r-1]:2*i-o,i,o,rn&&(o=t.slice(n,o),d[c]?d[c]+=o:d[++c]=o),(r=r[0])===(i=i[0])?d[c]?d[c]+=i:d[++c]=i:(d[++c]=null,p.push({i:c,x:Uo(r,i)})),n=GE.lastIndex;return n=0&&(t=t.slice(0,n)),!t||"start"===t})}(t)?NE:yc;return function(){var c=o(this,e),d=c.on;d!==r&&(i=(r=d).copy()).on(t,n),c.on=i}}var eX=Oy.prototype.constructor;function tF(e){return function(){this.style.removeProperty(e)}}function aX(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function lX(e,t,n){var r,i;function o(){var c=t.apply(this,arguments);return c!==i&&(r=(i=c)&&aX(e,c,n)),r}return o._value=t,o}function fX(e){return function(t){this.textContent=e.call(this,t)}}function pX(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&fX(i)),t}return r._value=e,r}var _X=0;function pu(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function nF(){return++_X}var mu=Oy.prototype;pu.prototype=function vX(e){return Oy().transition(e)}.prototype={constructor:pu,select:function JW(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=TE(e));for(var r=this._groups,i=r.length,o=new Array(i),c=0;c2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[c]):o=!1;o&&delete e.__transition}}(this,e)})},Oy.prototype.transition=function CX(e){var t,n;e instanceof pu?(t=e._id,e=e._name):(t=nF(),(n=xX).time=RE(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,o=0;o1?r[0]+r.slice(2):r,+e.slice(n+1)]}function um(e){return(e=hb(Math.abs(e)))?e[1]:NaN}["w","e"].map($y),["n","s"].map($y),["n","w","e","s","nw","ne","sw","se"].map($y);var lF,FX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function jy(e){if(!(t=FX.exec(e)))throw new Error("invalid format: "+e);var t;return new YE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function YE(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function cF(e,t){var n=hb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}jy.prototype=YE.prototype,YE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const uF={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function kX(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>cF(100*e,t),r:cF,s:function LX(e,t){var n=hb(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(lF=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,c=r.length;return o===c?r:o>c?r+new Array(o-c+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+hb(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hF(e){return e}var db,hm,pF,dF=Array.prototype.map,fF=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];!function zX(e){db=function NX(e){var t=void 0===e.grouping||void 0===e.thousands?hF:function PX(e,t){return function(n,r){for(var i=n.length,o=[],c=0,d=e[0],p=0;i>0&&d>0&&(p+d+1>r&&(d=Math.max(1,r-p)),o.push(n.substring(i-=d,i+d)),!((p+=d+1)>r));)d=e[c=(c+1)%e.length];return o.reverse().join(t)}}(dF.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?hF:function RX(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}(dF.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"\u2212":e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function v(D){var I=(D=jy(D)).fill,P=D.align,N=D.sign,G=D.symbol,U=D.zero,Z=D.width,ne=D.comma,X=D.precision,re=D.trim,fe=D.type;"n"===fe?(ne=!0,fe="g"):uF[fe]||(void 0===X&&(X=12),re=!0,fe="g"),(U||"0"===I&&"="===P)&&(U=!0,I="0",P="=");var ve="$"===G?n:"#"===G&&/[boxX]/.test(fe)?"0"+fe.toLowerCase():"",Re="$"===G?r:/[%p]/.test(fe)?c:"",We=uF[fe],Ke=/[defgprs%]/.test(fe);function lt(Ue){var le,de,pe,st=ve,Fe=Re;if("c"===fe)Fe=We(Ue)+Fe,Ue="";else{var Oe=(Ue=+Ue)<0||1/Ue<0;if(Ue=isNaN(Ue)?p:We(Math.abs(Ue),X),re&&(Ue=function OX(e){e:for(var i,t=e.length,n=1,r=-1;n0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}(Ue)),Oe&&0==+Ue&&"+"!==N&&(Oe=!1),st=(Oe?"("===N?N:d:"-"===N||"("===N?"":N)+st,Fe=("s"===fe?fF[8+lF/3]:"")+Fe+(Oe&&"("===N?")":""),Ke)for(le=-1,de=Ue.length;++le(pe=Ue.charCodeAt(le))||pe>57){Fe=(46===pe?i+Ue.slice(le+1):Ue.slice(le))+Fe,Ue=Ue.slice(0,le);break}}ne&&!U&&(Ue=t(Ue,1/0));var Ye=st.length+Ue.length+Fe.length,Ze=Ye>1)+st+Ue+Fe+Ze.slice(Ye);break;default:Ue=Ze+st+Ue+Fe}return o(Ue)}return X=void 0===X?6:/[gprs]/.test(fe)?Math.max(1,Math.min(21,X)):Math.max(0,Math.min(20,X)),lt.toString=function(){return D+""},lt}return{format:v,formatPrefix:function C(D,I){var P=v(((D=jy(D)).type="f",D)),N=3*Math.max(-8,Math.min(8,Math.floor(um(I)/3))),G=Math.pow(10,-N),U=fF[8+N/3];return function(Z){return P(G*Z)+U}}}}(e),hm=db.format,pF=db.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});var hn=1e-6,Dn=Math.PI,ei=Dn/2,gF=Dn/4,Qs=2*Dn,cs=180/Dn,ti=Dn/180,mr=Math.abs,dm=Math.atan,yu=Math.atan2,xn=Math.cos,yF=(Math,Math.exp),fb=(Math,Math,Math.log),KE=Math.pow,sn=Math.sin,Sa=Math.sign||function(e){return e>0?1:e<0?-1:0},ks=Math.sqrt,JE=Math.tan;function _F(e){return e>1?0:e<-1?Dn:Math.acos(e)}function Ma(e){return e>1?ei:e<-1?-ei:Math.asin(e)}function Ia(){}function vF(){var t,e=[];return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ia,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function pb(e,t){return mr(e[0]-t[0])=0;--d)i.point((D=C[d])[0],D[1]);else r(I.x,I.p.x,-1,i);I=I.p}C=(I=I.o).z,P=!P}while(!I.v);i.lineEnd()}}}function xF(e){if(t=e.length){for(var t,i,n=0,r=e[0];++n0)do{I.point(0===P||3===P?e:n,P>1?r:t)}while((P=(P+D+4)%4)!==N);else I.point(C[0],C[1])}function c(v,C){return mr(v[0]-e)0?0:3:mr(v[0]-n)0?2:1:mr(v[1]-t)0?1:0:C>0?3:2}function d(v,C){return p(v.x,C.x)}function p(v,C){var D=c(v,1),I=c(C,1);return D!==I?D-I:0===D?C[1]-v[1]:1===D?v[0]-C[0]:2===D?v[1]-C[1]:C[0]-v[0]}return function(v){var I,P,N,G,U,Z,ne,X,re,fe,ve,C=v,D=vF(),Re={point:We,lineStart:function st(){Re.point=le,P&&P.push(N=[]),fe=!0,re=!1,ne=X=NaN},lineEnd:function Fe(){I&&(le(G,U),Z&&re&&D.rejoin(),I.push(D.result())),Re.point=We,re&&C.lineEnd()},polygonStart:function lt(){C=D,I=[],P=[],ve=!0},polygonEnd:function Ue(){var de=function Ke(){for(var de=0,pe=0,Oe=P.length;per&&(jn-Ft)*(r-or)>(gr-or)*(e-Ft)&&++de:gr<=r&&(jn-Ft)*(r-or)<(gr-or)*(e-Ft)&&--de;return de}(),pe=ve&&de,Oe=(I=wF(I)).length;(pe||Oe)&&(v.polygonStart(),pe&&(v.lineStart(),o(null,null,1,v),v.lineEnd()),Oe&&bF(I,d,de,o,v),v.polygonEnd()),C=v,I=P=N=null}};function We(de,pe){i(de,pe)&&C.point(de,pe)}function le(de,pe){var Oe=i(de,pe);if(P&&N.push([de,pe]),fe)G=de,U=pe,Z=Oe,fe=!1,Oe&&(C.lineStart(),C.point(de,pe));else if(Oe&&re)C.point(de,pe);else{var Ye=[ne=Math.max(gb,Math.min(Hy,ne)),X=Math.max(gb,Math.min(Hy,X))],Ze=[de=Math.max(gb,Math.min(Hy,de)),pe=Math.max(gb,Math.min(Hy,pe))];!function BX(e,t,n,r,i,o){var N,c=e[0],d=e[1],C=0,D=1,I=t[0]-c,P=t[1]-d;if(N=n-c,I||!(N>0)){if(N/=I,I<0){if(N0){if(N>D)return;N>C&&(C=N)}if(N=i-c,I||!(N<0)){if(N/=I,I<0){if(N>D)return;N>C&&(C=N)}else if(I>0){if(N0)){if(N/=P,P<0){if(N0){if(N>D)return;N>C&&(C=N)}if(N=o-d,P||!(N<0)){if(N/=P,P<0){if(N>D)return;N>C&&(C=N)}else if(P>0){if(N0&&(e[0]=c+C*I,e[1]=d+C*P),D<1&&(t[0]=c+D*I,t[1]=d+D*P),!0}}}}}(Ye,Ze,e,t,n,r)?Oe&&(C.lineStart(),C.point(de,pe),ve=!1):(re||(C.lineStart(),C.point(Ye[0],Ye[1])),C.point(Ze[0],Ze[1]),Oe||C.lineEnd(),ve=!1)}ne=de,X=pe,re=Oe}return Re}}const QE=e=>e;function yb(e,t){e&&DF.hasOwnProperty(e.type)&&DF[e.type](e,t)}var EF={Feature:function(e,t){yb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(c=t[--n];n>0&&(r=c,i=t[--n],c=r+i,o=i-(c-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=2*o,r=c+i,i==r-c&&(c=r))}return c}}var MF,IF,rD,iD,tD=new _u,nD=new _u,zh={point:Ia,lineStart:Ia,lineEnd:Ia,polygonStart:function(){zh.lineStart=UX,zh.lineEnd=jX},polygonEnd:function(){zh.lineStart=zh.lineEnd=zh.point=Ia,tD.add(mr(nD)),nD=new _u},result:function(){var e=tD/2;return tD=new _u,e}};function UX(){zh.point=$X}function $X(e,t){zh.point=TF,MF=rD=e,IF=iD=t}function TF(e,t){nD.add(iD*e-rD*t),rD=e,iD=t}function jX(){TF(MF,IF)}const AF=zh;var pm=1/0,_b=pm,Gy=-pm,vb=Gy;const bb={point:function GX(e,t){eGy&&(Gy=e),t<_b&&(_b=t),t>vb&&(vb=t)},lineStart:Ia,lineEnd:Ia,polygonStart:Ia,polygonEnd:Ia,result:function(){var e=[[pm,_b],[Gy,vb]];return Gy=vb=-(_b=pm=1/0),e}};var kF,PF,vc,bc,oD=0,sD=0,qy=0,xb=0,wb=0,mm=0,aD=0,lD=0,Zy=0,El={point:vf,lineStart:RF,lineEnd:FF,polygonStart:function(){El.lineStart=WX,El.lineEnd=XX},polygonEnd:function(){El.point=vf,El.lineStart=RF,El.lineEnd=FF},result:function(){var e=Zy?[aD/Zy,lD/Zy]:mm?[xb/mm,wb/mm]:qy?[oD/qy,sD/qy]:[NaN,NaN];return oD=sD=qy=xb=wb=mm=aD=lD=Zy=0,e}};function vf(e,t){oD+=e,sD+=t,++qy}function RF(){El.point=qX}function qX(e,t){El.point=ZX,vf(vc=e,bc=t)}function ZX(e,t){var n=e-vc,r=t-bc,i=ks(n*n+r*r);xb+=i*(vc+e)/2,wb+=i*(bc+t)/2,mm+=i,vf(vc=e,bc=t)}function FF(){El.point=vf}function WX(){El.point=YX}function XX(){OF(kF,PF)}function YX(e,t){El.point=OF,vf(kF=vc=e,PF=bc=t)}function OF(e,t){var n=e-vc,r=t-bc,i=ks(n*n+r*r);xb+=i*(vc+e)/2,wb+=i*(bc+t)/2,mm+=i,aD+=(i=bc*e-vc*t)*(vc+e),lD+=i*(bc+t),Zy+=3*i,vf(vc=e,bc=t)}const LF=El;function NF(e){this._context=e}NF.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Qs)}},result:Ia};var uD,zF,BF,Wy,Xy,cD=new _u,Cb={point:Ia,lineStart:function(){Cb.point=KX},lineEnd:function(){uD&&VF(zF,BF),Cb.point=Ia},polygonStart:function(){uD=!0},polygonEnd:function(){uD=null},result:function(){var e=+cD;return cD=new _u,e}};function KX(e,t){Cb.point=VF,zF=Wy=e,BF=Xy=t}function VF(e,t){cD.add(ks((Wy-=e)*Wy+(Xy-=t)*Xy)),Wy=e,Xy=t}const UF=Cb;let $F,Eb,jF,HF;class GF{constructor(t){this._append=null==t?qF:function JX(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return qF;if(t!==$F){const n=10**t;$F=t,Eb=function(i){let o=1;this._+=i[0];for(const c=i.length;o=0))throw new RangeError(`invalid digits: ${d}`);n=p}return null===t&&(o=new GF(n)),c},c.projection(e).digits(n).context(t)}function dD(e){return[yu(e[1],e[0]),Ma(e[2])]}function gm(e){var t=e[0],n=e[1],r=xn(n);return[r*xn(t),r*sn(t),sn(n)]}function Db(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Sb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function fD(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Mb(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function pD(e){var t=ks(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function mD(e){return mr(e[0])<=Dn?e[0]:Sa(e[0])*((mr(e[0])+Dn)%Qs-Dn)}function ZF(e,t,n,r){return function(i){var v,C,D,o=t(i),c=vF(),d=t(c),p=!1,I={point:P,lineStart:G,lineEnd:U,polygonStart:function(){I.point=Z,I.lineStart=ne,I.lineEnd=X,C=[],v=[]},polygonEnd:function(){I.point=P,I.lineStart=G,I.lineEnd=U,C=wF(C);var re=function QX(e,t){var n=mD(t),r=t[1],i=sn(r),o=[sn(n),-xn(n),0],c=0,d=0,p=new _u;1===i?r=ei+hn:-1===i&&(r=-ei-hn);for(var v=0,C=e.length;v=0?1:-1,lt=Ke*We,Ue=lt>Dn,st=U*ve;if(p.add(yu(st*Ke*sn(lt),Z*Re+st*xn(lt))),c+=Ue?We+Ke*Qs:We,Ue^N>=n^re>=n){var Fe=Sb(gm(P),gm(X));pD(Fe);var le=Sb(o,Fe);pD(le);var de=(Ue^We>=0?-1:1)*Ma(le[2]);(r>de||r===de&&(Fe[0]||Fe[1]))&&(d+=Ue^We>=0?1:-1)}}return(c<-hn||c0){for(p||(i.polygonStart(),p=!0),i.lineStart(),ve=0;ve1&&2&re&&fe.push(fe.pop().concat(fe.shift())),C.push(fe.filter(eY))}}return I}}function eY(e){return e.length>1}function tY(e,t){return((e=e.x)[0]<0?e[1]-ei-hn:ei-e[1])-((t=t.x)[0]<0?t[1]-ei-hn:ei-t[1])}const WF=ZF(function(){return!0},function nY(e){var i,t=NaN,n=NaN,r=NaN;return{lineStart:function(){e.lineStart(),i=1},point:function(o,c){var d=o>0?Dn:-Dn,p=mr(o-t);mr(p-Dn)0?ei:-ei),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),e.point(o,n),i=0):r!==d&&p>=Dn&&(mr(t-r)hn?dm((sn(t)*(o=xn(r))*sn(n)-sn(r)*(i=xn(t))*sn(e))/(i*o*c)):(t+r)/2}(t,n,o,c),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),i=0),e.point(t=o,n=c),r=d},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}},function iY(e,t,n,r){var i;if(null==e)r.point(-Dn,i=n*ei),r.point(0,i),r.point(Dn,i),r.point(Dn,0),r.point(Dn,-i),r.point(0,-i),r.point(-Dn,-i),r.point(-Dn,0),r.point(-Dn,i);else if(mr(e[0]-t[0])>hn){var o=e[0]0,i=mr(t)>hn;function c(C,D){return xn(C)*xn(D)>t}function p(C,D,I){var G=[1,0,0],U=Sb(gm(C),gm(D)),Z=Db(U,U),ne=U[0],X=Z-ne*ne;if(!X)return!I&&C;var re=t*Z/X,fe=-t*ne/X,ve=Sb(G,U),Re=Mb(G,re);fD(Re,Mb(U,fe));var Ke=ve,lt=Db(Re,Ke),Ue=Db(Ke,Ke),st=lt*lt-Ue*(Db(Re,Re)-1);if(!(st<0)){var Fe=ks(st),le=Mb(Ke,(-lt-Fe)/Ue);if(fD(le,Re),le=dD(le),!I)return le;var Ze,de=C[0],pe=D[0],Oe=C[1],Ye=D[1];pe0^le[1]<(mr(le[0]-de)Dn^(de<=le[0]&&le[0]<=pe)){var or=Mb(Ke,(-lt+Fe)/Ue);return fD(or,Re),[le,dD(or)]}}}function v(C,D){var I=r?e:Dn-e,P=0;return C<-I?P|=1:C>I&&(P|=2),D<-I?P|=4:D>I&&(P|=8),P}return ZF(c,function d(C){var D,I,P,N,G;return{lineStart:function(){N=P=!1,G=1},point:function(U,Z){var X,ne=[U,Z],re=c(U,Z),fe=r?re?0:v(U,Z):re?v(U+(U<0?Dn:-Dn),Z):0;if(!D&&(N=P=re)&&C.lineStart(),re!==P&&(!(X=p(D,ne))||pb(D,X)||pb(ne,X))&&(ne[2]=1),re!==P)G=0,re?(C.lineStart(),X=p(ne,D),C.point(X[0],X[1])):(X=p(D,ne),C.point(X[0],X[1],2),C.lineEnd()),D=X;else if(i&&D&&r^re){var ve;!(fe&I)&&(ve=p(ne,D,!0))&&(G=0,r?(C.lineStart(),C.point(ve[0][0],ve[0][1]),C.point(ve[1][0],ve[1][1]),C.lineEnd()):(C.point(ve[1][0],ve[1][1]),C.lineEnd(),C.lineStart(),C.point(ve[0][0],ve[0][1],3)))}re&&(!D||!pb(D,ne))&&C.point(ne[0],ne[1]),D=ne,P=re,I=fe},lineEnd:function(){P&&C.lineEnd(),D=null},clean:function(){return G|(N&&P)<<1}}},function o(C,D,I,P){!function XF(e,t,n,r,i,o){if(n){var c=xn(t),d=sn(t),p=r*n;null==i?(i=t+r*Qs,o=t-p/2):(i=YF(c,i),o=YF(c,o),(r>0?io)&&(i+=r*Qs));for(var v,C=i;r>0?C>o:CDn&&(e-=Math.round(e/Qs)*Qs),[e,t]}function KF(e,t,n){return(e%=Qs)?t||n?gD(QF(e),eO(t,n)):QF(e):t||n?eO(t,n):yD}function JF(e){return function(t,n){return mr(t+=e)>Dn&&(t-=Math.round(t/Qs)*Qs),[t,n]}}function QF(e){var t=JF(e);return t.invert=JF(-e),t}function eO(e,t){var n=xn(e),r=sn(e),i=xn(t),o=sn(t);function c(d,p){var v=xn(p),C=xn(d)*v,D=sn(d)*v,I=sn(p),P=I*n+C*r;return[yu(D*i-P*o,C*n-I*r),Ma(P*i+D*o)]}return c.invert=function(d,p){var v=xn(p),C=xn(d)*v,D=sn(d)*v,I=sn(p),P=I*i-D*o;return[yu(D*i+I*o,C*n+P*r),Ma(P*n-C*r)]},c}function _D(e){return{stream:Ib(e)}}function Ib(e){return function(t){var n=new vD;for(var r in e)n[r]=e[r];return n.stream=t,n}}function vD(){}function bD(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),fm(n,e.stream(bb)),t(bb.result()),null!=r&&e.clipExtent(r),e}function xD(e,t,n){return bD(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],c=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),d=+t[0][0]+(i-c*(r[1][0]+r[0][0]))/2,p=+t[0][1]+(o-c*(r[1][1]+r[0][1]))/2;e.scale(150*c).translate([d,p])},n)}function tO(e,t,n){return xD(e,[[0,0],t],n)}function nO(e,t,n){return bD(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),c=(i-o*(r[1][0]+r[0][0]))/2,d=-o*r[0][1];e.scale(150*o).translate([c,d])},n)}function rO(e,t,n){return bD(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),c=-o*r[0][0],d=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([c,d])},n)}yD.invert=yD,vD.prototype={constructor:vD,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var aY=xn(30*ti);function oO(e,t){return+t?function cY(e,t){function n(r,i,o,c,d,p,v,C,D,I,P,N,G,U){var Z=v-r,ne=C-i,X=Z*Z+ne*ne;if(X>4*t&&G--){var re=c+I,fe=d+P,ve=p+N,Re=ks(re*re+fe*fe+ve*ve),We=Ma(ve/=Re),Ke=mr(mr(ve)-1)t||mr((Z*Fe+ne*le)/X-.5)>.3||c*I+d*P+p*N2?de[2]%360*ti:0,Fe()):[d*cs,p*cs,v*cs]},Ue.angle=function(de){return arguments.length?(D=de%360*ti,Fe()):D*cs},Ue.reflectX=function(de){return arguments.length?(I=de?-1:1,Fe()):I<0},Ue.reflectY=function(de){return arguments.length?(P=de?-1:1,Fe()):P<0},Ue.precision=function(de){return arguments.length?(ve=oO(Re,fe=de*de),le()):ks(fe)},Ue.fitExtent=function(de,pe){return xD(Ue,de,pe)},Ue.fitSize=function(de,pe){return tO(Ue,de,pe)},Ue.fitWidth=function(de,pe){return nO(Ue,de,pe)},Ue.fitHeight=function(de,pe){return rO(Ue,de,pe)},function(){return t=e.apply(this,arguments),Ue.invert=t.invert&&st,Fe()}}function wD(e){var t=0,n=Dn/3,r=aO(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ti,n=o[1]*ti):[t*cs,n*cs]},i}function pY(e,t){var n=sn(e),r=(n+sn(t))/2;if(mr(r)=.12&&U<.234&&G>=-.425&&G<-.214?i:U>=.166&&U<.234&&G>=-.214&&G<-.115?c:n).invert(I)},C.stream=function(I){return e&&t===I?e:e=function mY(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i2?e[2]*ti:0),t.invert=function(n){return(n=e.invert(n[0]*ti,n[1]*ti))[0]*=cs,n[1]*=cs,n},t}(t.rotate()).invert([0,0]));return o(null==c?[[I[0]-D,I[1]-D],[I[0]+D,I[1]+D]]:e===Ab?[[Math.max(I[0]-D,c),d],[Math.min(I[0]+D,p),v]]:[[c,Math.max(I[1]-D,d)],[p,Math.min(I[1]+D,v)]])}return t.scale=function(D){return arguments.length?(r(D),C()):r()},t.translate=function(D){return arguments.length?(i(D),C()):i()},t.center=function(D){return arguments.length?(n(D),C()):n()},t.clipExtent=function(D){return arguments.length?(null==D?c=d=p=v=null:(c=+D[0][0],d=+D[0][1],p=+D[1][0],v=+D[1][1]),C()):null==c?null:[[c,d],[p,v]]},C()}function kb(e){return JE((ei+e)/2)}function bY(e,t){var n=xn(e),r=e===t?sn(e):fb(n/xn(t))/fb(kb(t)/kb(e)),i=n*KE(kb(e),r)/r;if(!r)return Ab;function o(c,d){i>0?d<-ei+hn&&(d=-ei+hn):d>ei-hn&&(d=ei-hn);var p=i/KE(kb(d),r);return[p*sn(r*c),i-p*xn(r*c)]}return o.invert=function(c,d){var p=i-d,v=Sa(r)*ks(c*c+p*p),C=yu(c,mr(p))*Sa(p);return p*r<0&&(C-=Dn*Sa(c)*Sa(p)),[C/r,2*dm(KE(i/v,1/r))-ei]},o}function xY(){return wD(bY).scale(109.5).parallels([30,30])}function Pb(e,t){return[e,t]}function wY(){return Bh(Pb).scale(152.63)}function CY(e,t){var n=xn(e),r=e===t?sn(e):(n-xn(t))/(t-e),i=n/r+e;if(mr(r)2?r[2]+90:90]):[(r=n())[0],r[1],r[2]-90]},n([0,0,90]).scale(159.155)}function CD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function _O(e){return function(t,n){var r=e((t=UE(t)).h,(n=UE(n)).h),i=to(t.s,n.s),o=to(t.l,n.l),c=to(t.opacity,n.opacity);return function(d){return t.h=r(d),t.s=i(d),t.l=o(d),t.opacity=c(d),t+""}}}fO.invert=function(e,t){for(var c,n=t,r=n*n,i=r*r*r,o=0;o<12&&(i=(r=(n-=c=(n*(Ky+Jy*r+i*(Qy+e_*r))-t)/(Ky+3*Jy*r+i*(7*Qy+9*e_*r)))*n)*r*r,!(mr(c)<1e-12));++o);return[Rb*e*(Ky+3*Jy*r+i*(7*Qy+9*e_*r))/xn(n),Ma(sn(n)/Rb)]},pO.invert=Yy(dm),mO.invert=Yy(Ma),gO.invert=Yy(function(e){return 2*dm(e)}),yO.invert=function(e,t){return[-t,2*dm(yF(e))-ei]};const kY=_O(jE);_O(to);const vO=Math.PI/180,bO=180/Math.PI,EO=4/29,ym=6/29,DO=3*ym*ym;function SO(e){if(e instanceof Dl)return new Dl(e.l,e.a,e.b,e.opacity);if(e instanceof xc)return IO(e);e instanceof eo||(e=VE(e));var o,c,t=ID(e.r),n=ID(e.g),r=ID(e.b),i=DD((.2225045*t+.7168786*n+.0606169*r)/1);return t===n&&n===r?o=c=i:(o=DD((.4360747*t+.3850649*n+.1430804*r)/.96422),c=DD((.0139322*t+.0971045*n+.7141733*r)/.82521)),new Dl(116*i-16,500*(o-i),200*(i-c),e.opacity)}function ED(e,t,n,r){return 1===arguments.length?SO(e):new Dl(e,t,n,r??1)}function Dl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function DD(e){return e>.008856451679035631?Math.pow(e,1/3):e/DO+EO}function SD(e){return e>ym?e*e*e:DO*(e-EO)}function MD(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ID(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function MO(e){if(e instanceof xc)return new xc(e.h,e.c,e.l,e.opacity);if(e instanceof Dl||(e=SO(e)),0===e.a&&0===e.b)return new xc(NaN,0=0))throw new Error(`invalid digits: ${e}`);if(t>15)return kO;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;ibf)if(Math.abs(D*p-v*C)>bf&&o){let P=r-c,N=i-d,G=p*p+v*v,U=P*P+N*N,Z=Math.sqrt(G),ne=Math.sqrt(I),X=o*Math.tan((kD-Math.acos((G+I-U)/(2*Z*ne)))/2),re=X/ne,fe=X/Z;Math.abs(re-1)>bf&&this._append`L${t+re*C},${n+re*D}`,this._append`A${o},${o},0,0,${+(D*P>C*N)},${this._x1=t+fe*p},${this._y1=n+fe*v}`}else this._append`L${this._x1=t},${this._y1=n}`}arc(t,n,r,i,o,c){if(t=+t,n=+n,c=!!c,(r=+r)<0)throw new Error(`negative radius: ${r}`);let d=r*Math.cos(i),p=r*Math.sin(i),v=t+d,C=n+p,D=1^c,I=c?i-o:o-i;null===this._x1?this._append`M${v},${C}`:(Math.abs(this._x1-v)>bf||Math.abs(this._y1-C)>bf)&&this._append`L${v},${C}`,r&&(I<0&&(I=I%PD+PD),I>BY?this._append`A${r},${r},0,1,${D},${t-d},${n-p}A${r},${r},0,1,${D},${this._x1=v},${this._y1=C}`:I>bf&&this._append`A${r},${r},0,${+(I>=kD)},${D},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function xf(e=3){return new Ob(+e)}function wc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Lb(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const RD=Symbol("implicit");function FD(){var e=new N0,t=[],n=[],r=RD;function i(o){let c=e.get(o);if(void 0===c){if(r!==RD)return r;e.set(o,c=t.push(o)-1)}return n[c%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new N0;for(const c of o)e.has(c)||e.set(c,t.push(c)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return FD(t,n).unknown(r)},wc.apply(i,arguments),i}function Nb(){var o,c,e=FD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,d=!1,p=0,v=0,C=.5;function D(){var I=t().length,P=i>>1;n(d[D],p)<0?v=D+1:C=D}while(vxl(e(d),p),r=(d,p)=>e(d)-p):(t=e===xl||e===Ay?e:jY,n=e,r=e),{left:i,center:function c(d,p,v=0,C=d.length){const D=i(d,p,v,C-1);return D>v&&r(d[D-1],p)>-r(d[D],p)?D-1:D},right:function o(d,p,v=0,C=d.length){if(v>>1;n(d[D],p)<=0?v=D+1:C=D}while(vt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}(e[0],e[I-1])),d=I>2?WY:ZY,p=v=null,D}function D(I){return null==I||isNaN(I=+I)?o:(p||(p=d(e.map(r),t,n)))(r(c(I)))}return D.invert=function(I){return c(i((v||(v=d(t,e.map(r),Uo)))(I)))},D.domain=function(I){return arguments.length?(e=Array.from(I,ND),C()):e.slice()},D.range=function(I){return arguments.length?(t=Array.from(I),C()):t.slice()},D.rangeRound=function(I){return t=Array.from(I),n=CD,C()},D.clamp=function(I){return arguments.length?(c=!!I||Ta,C()):c!==Ta},D.interpolate=function(I){return arguments.length?(n=I,C()):n},D.unknown=function(I){return arguments.length?(o=I,D):o},function(I,P){return r=I,i=P,C()}}function OO(){return zb()(Ta,Ta)}function r_(e){var t=e.domain;return e.ticks=function(n){var r=t();return j0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return function JY(e,t,n,r){var o,i=ME(e,t,n);switch((r=jy(r??",f")).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null==r.precision&&!isNaN(o=function XY(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(um(t)/3)))-um(Math.abs(e)))}(i,c))&&(r.precision=o),pF(r,c);case"":case"e":case"g":case"p":case"r":null==r.precision&&!isNaN(o=function YY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,um(t)-um(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-("e"===r.type));break;case"f":case"%":null==r.precision&&!isNaN(o=function KY(e){return Math.max(0,-um(Math.abs(e)))}(i))&&(r.precision=o-2*("%"===r.type))}return hm(r)}(i[0],i[i.length-1],n??10,r)},e.nice=function(n){null==n&&(n=10);var p,v,r=t(),i=0,o=r.length-1,c=r[i],d=r[o],C=10;for(d0;){if((v=SE(c,d,n))===p)return r[i]=c,r[o]=d,t(r);if(v>0)c=Math.floor(c/v)*v,d=Math.ceil(d/v)*v;else{if(!(v<0))break;c=Math.ceil(c*v)/v,d=Math.floor(d*v)/v}p=v}return e},e}function BD(){var e=OO();return e.copy=function(){return n_(e,BD())},wc.apply(e,arguments),r_(e)}function LO(e){var t;function n(r){return null==r||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,ND),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return LO(e).unknown(t)},e=arguments.length?Array.from(e,ND):[0,1],r_(n)}function NO(e,t){var c,n=0,r=(e=e.slice()).length-1,i=e[n],o=e[r];return o-e(-t,n)}function UO(e){const t=e(zO,BO),n=t.domain;let i,o,r=10;function c(){return i=function rK(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(r),o=function nK(e){return 10===e?tK:e===Math.E?Math.exp:t=>Math.pow(e,t)}(r),n()[0]<0?(i=VO(i),o=VO(o),e(QY,eK)):e(zO,BO),t}return t.base=function(d){return arguments.length?(r=+d,c()):r},t.domain=function(d){return arguments.length?(n(d),c()):n()},t.ticks=d=>{const p=n();let v=p[0],C=p[p.length-1];const D=C0){for(;I<=P;++I)for(N=1;NC)break;Z.push(G)}}else for(;I<=P;++I)for(N=r-1;N>=1;--N)if(G=I>0?N/o(-I):N*o(I),!(GC)break;Z.push(G)}2*Z.length{if(null==d&&(d=10),null==p&&(p=10===r?"s":","),"function"!=typeof p&&(!(r%1)&&null==(p=jy(p)).precision&&(p.trim=!0),p=hm(p)),d===1/0)return p;const v=Math.max(1,r*d/t.ticks().length);return C=>{let D=C/o(Math.round(i(C)));return D*rn(NO(n(),{floor:d=>o(Math.floor(i(d))),ceil:d=>o(Math.ceil(i(d)))})),t}function $O(){const e=UO(zb()).domain([1,10]);return e.copy=()=>n_(e,$O()).base(e.base()),wc.apply(e,arguments),e}function jO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function HO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function GO(e){var t=1,n=e(jO(t),HO(t));return n.constant=function(r){return arguments.length?e(jO(t=+r),HO(t)):t},r_(n)}function qO(){var e=GO(zb());return e.copy=function(){return n_(e,qO()).constant(e.constant())},wc.apply(e,arguments)}function ZO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oK(e){return e<0?-e*e:e*e}function WO(e){var t=e(Ta,Ta),n=1;function r(){return 1===n?e(Ta,Ta):.5===n?e(iK,oK):e(ZO(n),ZO(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},r_(t)}function VD(){var e=WO(zb());return e.copy=function(){return n_(e,VD()).exponent(e.exponent())},wc.apply(e,arguments),e}function XO(){var r,e=[],t=[],n=[];function i(){var c=0,d=Math.max(1,t.length);for(n=new Array(d-1);++c0?n[d-1]:e[0],d(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const c=i(o),d=i.ceil(o);return o-c(t(o=new Date(+o),null==c?1:Math.floor(c)),o),i.range=(o,c,d)=>{const p=[];if(o=i.ceil(o),d=null==d?1:Math.floor(d),!(o0))return p;let v;do{p.push(v=new Date(+o)),t(o,d),e(o)}while(vLi(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,d)=>{if(c>=c)if(d<0)for(;++d<=0;)for(;t(c,-1),!o(c););else for(;--d>=0;)for(;t(c,1),!o(c););}),n&&(i.count=(o,c)=>(jD.setTime(+o),HD.setTime(+c),e(jD),e(HD),Math.floor(n(jD,HD))),i.every=o=>(o=Math.floor(o),isFinite(o)&&o>0?o>1?i.filter(r?c=>r(c)%o==0:c=>i.count(0,c)%o==0):i:null)),i}const Bb=Li(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Bb.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Li(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Bb:null);const wu=Li(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vu)},(e,t)=>(t-e)/vu,e=>e.getUTCSeconds()),Vb=Li(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu)},(e,t)=>{e.setTime(+e+t*Aa)},(e,t)=>(t-e)/Aa,e=>e.getMinutes()),Ub=Li(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Aa)},(e,t)=>(t-e)/Aa,e=>e.getUTCMinutes()),$b=Li(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu-e.getMinutes()*Aa)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getHours()),jb=Li(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getUTCHours()),_m=Li(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Aa)/xu,e=>e.getDate()-1),i_=Li(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>e.getUTCDate()-1),JO=Li(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>Math.floor(e/xu));function wf(e){return Li(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+7*n)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Aa)/UD)}const vm=wf(0),o_=wf(1),QO=wf(2),eL=wf(3),Cf=wf(4),tL=wf(5),nL=wf(6);function Ef(e){return Li(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)},(t,n)=>(n-t)/UD)}const bm=Ef(0),s_=Ef(1),rL=Ef(2),iL=Ef(3),Df=Ef(4),oL=Ef(5),sL=Ef(6),xm=Li(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth()),wm=Li(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth()),Cc=Li(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Cc.every=e=>isFinite(e=Math.floor(e))&&e>0?Li(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;const Ec=Li(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function aL(e,t,n,r,i,o){const c=[[wu,1,vu],[wu,5,5e3],[wu,15,15e3],[wu,30,3e4],[o,1,Aa],[o,5,5*Aa],[o,15,15*Aa],[o,30,30*Aa],[i,1,bu],[i,3,3*bu],[i,6,6*bu],[i,12,12*bu],[r,1,xu],[r,2,2*xu],[n,1,UD],[t,1,KO],[t,3,3*KO],[e,1,$D]];function p(v,C,D){const I=Math.abs(C-v)/D,P=OD(([,,U])=>U).right(c,I);if(P===c.length)return e.every(ME(v/$D,C/$D,D));if(0===P)return Bb.every(Math.max(ME(v,C,D),1));const[N,G]=c[I/c[P-1][2]isFinite(e=Math.floor(e))&&e>0?Li(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;const[sK,aK]=aL(Ec,wm,bm,JO,jb,Ub),[lK,cK]=aL(Cc,xm,vm,_m,$b,Vb);function GD(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function qD(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function a_(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var Cm,Em,Hb,lL={"-":"",_:" ",0:"0"},no=/^\s*\d+/,hK=/^%/,dK=/[\\^$*+?|[\]().{}]/g;function Zn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function pK(e,t,n){var r=no.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mK(e,t,n){var r=no.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _K(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function cL(e,t,n){var r=no.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function uL(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function vK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function bK(e,t,n){var r=no.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function xK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function hL(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function wK(e,t,n){var r=no.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function dL(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function CK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function EK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function DK(e,t,n){var r=no.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function SK(e,t,n){var r=no.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function MK(e,t,n){var r=hK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function IK(e,t,n){var r=no.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function TK(e,t,n){var r=no.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function fL(e,t){return Zn(e.getDate(),t,2)}function AK(e,t){return Zn(e.getHours(),t,2)}function kK(e,t){return Zn(e.getHours()%12||12,t,2)}function PK(e,t){return Zn(1+_m.count(Cc(e),e),t,3)}function pL(e,t){return Zn(e.getMilliseconds(),t,3)}function RK(e,t){return pL(e,t)+"000"}function FK(e,t){return Zn(e.getMonth()+1,t,2)}function OK(e,t){return Zn(e.getMinutes(),t,2)}function LK(e,t){return Zn(e.getSeconds(),t,2)}function NK(e){var t=e.getDay();return 0===t?7:t}function zK(e,t){return Zn(vm.count(Cc(e)-1,e),t,2)}function mL(e){var t=e.getDay();return t>=4||0===t?Cf(e):Cf.ceil(e)}function BK(e,t){return e=mL(e),Zn(Cf.count(Cc(e),e)+(4===Cc(e).getDay()),t,2)}function VK(e){return e.getDay()}function UK(e,t){return Zn(o_.count(Cc(e)-1,e),t,2)}function $K(e,t){return Zn(e.getFullYear()%100,t,2)}function jK(e,t){return Zn((e=mL(e)).getFullYear()%100,t,2)}function HK(e,t){return Zn(e.getFullYear()%1e4,t,4)}function GK(e,t){var n=e.getDay();return Zn((e=n>=4||0===n?Cf(e):Cf.ceil(e)).getFullYear()%1e4,t,4)}function qK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Zn(t/60|0,"0",2)+Zn(t%60,"0",2)}function gL(e,t){return Zn(e.getUTCDate(),t,2)}function ZK(e,t){return Zn(e.getUTCHours(),t,2)}function WK(e,t){return Zn(e.getUTCHours()%12||12,t,2)}function XK(e,t){return Zn(1+i_.count(Ec(e),e),t,3)}function yL(e,t){return Zn(e.getUTCMilliseconds(),t,3)}function YK(e,t){return yL(e,t)+"000"}function KK(e,t){return Zn(e.getUTCMonth()+1,t,2)}function JK(e,t){return Zn(e.getUTCMinutes(),t,2)}function QK(e,t){return Zn(e.getUTCSeconds(),t,2)}function eJ(e){var t=e.getUTCDay();return 0===t?7:t}function tJ(e,t){return Zn(bm.count(Ec(e)-1,e),t,2)}function _L(e){var t=e.getUTCDay();return t>=4||0===t?Df(e):Df.ceil(e)}function nJ(e,t){return e=_L(e),Zn(Df.count(Ec(e),e)+(4===Ec(e).getUTCDay()),t,2)}function rJ(e){return e.getUTCDay()}function iJ(e,t){return Zn(s_.count(Ec(e)-1,e),t,2)}function oJ(e,t){return Zn(e.getUTCFullYear()%100,t,2)}function sJ(e,t){return Zn((e=_L(e)).getUTCFullYear()%100,t,2)}function aJ(e,t){return Zn(e.getUTCFullYear()%1e4,t,4)}function lJ(e,t){var n=e.getUTCDay();return Zn((e=n>=4||0===n?Df(e):Df.ceil(e)).getUTCFullYear()%1e4,t,4)}function cJ(){return"+0000"}function vL(){return"%"}function bL(e){return+e}function xL(e){return Math.floor(+e/1e3)}function fJ(e){return new Date(e)}function pJ(e){return e instanceof Date?+e:+new Date(+e)}function ZD(e,t,n,r,i,o,c,d,p,v){var C=OO(),D=C.invert,I=C.domain,P=v(".%L"),N=v(":%S"),G=v("%I:%M"),U=v("%I %p"),Z=v("%a %d"),ne=v("%b %d"),X=v("%B"),re=v("%Y");function fe(ve){return(p(ve)=12)]},q:function Ft(bt){return 1+~~(bt.getMonth()/3)},Q:bL,s:xL,S:LK,u:NK,U:zK,V:BK,w:VK,W:UK,x:null,X:null,y:$K,Y:HK,Z:qK,"%":vL},re={a:function or(bt){return c[bt.getUTCDay()]},A:function jn(bt){return o[bt.getUTCDay()]},b:function gr(bt){return p[bt.getUTCMonth()]},B:function xi(bt){return d[bt.getUTCMonth()]},c:null,d:gL,e:gL,f:YK,g:sJ,G:lJ,H:ZK,I:WK,j:XK,L:yL,m:KK,M:JK,p:function Wn(bt){return i[+(bt.getUTCHours()>=12)]},q:function zr(bt){return 1+~~(bt.getUTCMonth()/3)},Q:bL,s:xL,S:QK,u:eJ,U:tJ,V:nJ,w:rJ,W:iJ,x:null,X:null,y:oJ,Y:aJ,Z:cJ,"%":vL},fe={a:function lt(bt,Kt,Pn){var Je=P.exec(Kt.slice(Pn));return Je?(bt.w=N.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},A:function Ue(bt,Kt,Pn){var Je=D.exec(Kt.slice(Pn));return Je?(bt.w=I.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},b:function st(bt,Kt,Pn){var Je=Z.exec(Kt.slice(Pn));return Je?(bt.m=ne.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},B:function Fe(bt,Kt,Pn){var Je=G.exec(Kt.slice(Pn));return Je?(bt.m=U.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},c:function le(bt,Kt,Pn){return We(bt,t,Kt,Pn)},d:hL,e:hL,f:SK,g:uL,G:cL,H:dL,I:dL,j:wK,L:DK,m:xK,M:CK,p:function Ke(bt,Kt,Pn){var Je=v.exec(Kt.slice(Pn));return Je?(bt.p=C.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},q:bK,Q:IK,s:TK,S:EK,u:mK,U:gK,V:yK,w:pK,W:_K,x:function de(bt,Kt,Pn){return We(bt,n,Kt,Pn)},X:function pe(bt,Kt,Pn){return We(bt,r,Kt,Pn)},y:uL,Y:cL,Z:vK,"%":MK};function ve(bt,Kt){return function(Pn){var So,qt,ri,Je=[],Br=-1,Jn=0,Gr=bt.length;for(Pn instanceof Date||(Pn=new Date(+Pn));++Br53)return null;"w"in Je||(Je.w=1),"Z"in Je?(Gr=(Jn=qD(a_(Je.y,0,1))).getUTCDay(),Jn=Gr>4||0===Gr?s_.ceil(Jn):s_(Jn),Jn=i_.offset(Jn,7*(Je.V-1)),Je.y=Jn.getUTCFullYear(),Je.m=Jn.getUTCMonth(),Je.d=Jn.getUTCDate()+(Je.w+6)%7):(Gr=(Jn=GD(a_(Je.y,0,1))).getDay(),Jn=Gr>4||0===Gr?o_.ceil(Jn):o_(Jn),Jn=_m.offset(Jn,7*(Je.V-1)),Je.y=Jn.getFullYear(),Je.m=Jn.getMonth(),Je.d=Jn.getDate()+(Je.w+6)%7)}else("W"in Je||"U"in Je)&&("w"in Je||(Je.w="u"in Je?Je.u%7:"W"in Je?1:0),Gr="Z"in Je?qD(a_(Je.y,0,1)).getUTCDay():GD(a_(Je.y,0,1)).getDay(),Je.m=0,Je.d="W"in Je?(Je.w+6)%7+7*Je.W-(Gr+5)%7:Je.w+7*Je.U-(Gr+6)%7);return"Z"in Je?(Je.H+=Je.Z/100|0,Je.M+=Je.Z%100,qD(Je)):GD(Je)}}function We(bt,Kt,Pn,Je){for(var So,qt,Br=0,Jn=Kt.length,Gr=Pn.length;Br=Gr)return-1;if(37===(So=Kt.charCodeAt(Br++))){if(So=Kt.charAt(Br++),!(qt=fe[So in lL?Kt.charAt(Br++):So])||(Je=qt(bt,Pn,Je))<0)return-1}else if(So!=Pn.charCodeAt(Je++))return-1}return Je}return X.x=ve(n,X),X.X=ve(r,X),X.c=ve(t,X),re.x=ve(n,re),re.X=ve(r,re),re.c=ve(t,re),{format:function(bt){var Kt=ve(bt+="",X);return Kt.toString=function(){return bt},Kt},parse:function(bt){var Kt=Re(bt+="",!1);return Kt.toString=function(){return bt},Kt},utcFormat:function(bt){var Kt=ve(bt+="",re);return Kt.toString=function(){return bt},Kt},utcParse:function(bt){var Kt=Re(bt+="",!0);return Kt.toString=function(){return bt},Kt}}}(e),Em=Cm.format,Hb=Cm.utcFormat}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const bJ=dn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),xJ=dn("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),wJ=dn("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),CJ=dn("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),EJ=dn("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),DJ=dn("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),SJ=dn("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),MJ=dn("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),IJ=dn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),TJ=dn("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),wr=e=>bW(e[e.length-1]);var SL=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(dn);const ML=wr(SL);var IL=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(dn);const TL=wr(IL);var AL=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(dn);const kL=wr(AL);var PL=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(dn);const RL=wr(PL);var XD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(dn);const Zb=wr(XD);var FL=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(dn);const OL=wr(FL);var YD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(dn);const Wb=wr(YD);var LL=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(dn);const NL=wr(LL);var zL=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(dn);const BL=wr(zL);var VL=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(dn);const UL=wr(VL);var $L=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(dn);const jL=wr($L);var HL=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(dn);const GL=wr(HL);var qL=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(dn);const ZL=wr(qL);var WL=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(dn);const XL=wr(WL);var YL=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(dn);const KL=wr(YL);var JL=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(dn);const QL=wr(JL);var e3=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(dn);const t3=wr(e3);var n3=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(dn);const r3=wr(n3);var i3=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(dn);const o3=wr(i3);var s3=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(dn);const a3=wr(s3);var l3=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(dn);const c3=wr(l3);var u3=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(dn);const h3=wr(u3);var d3=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(dn);const f3=wr(d3);var p3=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(dn);const m3=wr(p3);var g3=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(dn);const y3=wr(g3);var _3=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(dn);const v3=wr(_3);var b3=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(dn);const x3=wr(b3);function w3(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-2710.57*e)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-67.37*e)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-2475.67*e)))))))+")"}var KD=1.78277,JD=-.29227,Xb=-.90649,u_=1.97294,E3=u_*Xb,D3=u_*KD,S3=KD*JD- -.14861*Xb;function AJ(e){if(e instanceof Sf)return new Sf(e.h,e.s,e.l,e.opacity);e instanceof eo||(e=VE(e));var n=e.g/255,r=e.b/255,i=(S3*r+E3*(e.r/255)-D3*n)/(S3+E3-D3),o=r-i,c=(u_*(n-i)-JD*o)/Xb,d=Math.sqrt(c*c+o*o)/(u_*i*(1-i)),p=d?Math.atan2(c,o)*bO-120:NaN;return new Sf(p<0?p+360:p,d,i,e.opacity)}function Dc(e,t,n,r){return 1===arguments.length?AJ(e):new Sf(e,t,n,r??1)}function Sf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function M3(e){return function t(n){function r(i,o){var c=e((i=Dc(i)).h,(o=Dc(o)).h),d=to(i.s,o.s),p=to(i.l,o.l),v=to(i.opacity,o.opacity);return function(C){return i.h=c(C),i.s=d(C),i.l=p(Math.pow(C,n)),i.opacity=v(C),i+""}}return n=+n,r.gamma=t,r}(1)}om(Sf,Dc,Vy(Oh,{brighter(e){return e=null==e?sm:Math.pow(sm,e),new Sf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Sf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*vO,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new eo(255*(t+n*(-.14861*r+KD*i)),255*(t+n*(JD*r+Xb*i)),255*(t+n*(u_*r)),this.opacity)}})),M3(jE);var QD=M3(to);const I3=QD(Dc(300,.5,0),Dc(-240,.5,1));var T3=QD(Dc(-100,.75,.35),Dc(80,1.5,.8)),A3=QD(Dc(260,.75,.35),Dc(80,1.5,.8)),Yb=Dc();function k3(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Yb.h=360*e-100,Yb.s=1.5-1.5*t,Yb.l=.8-.9*t,Yb+""}var Kb=Nh(),kJ=Math.PI/3,PJ=2*Math.PI/3;function P3(e){var t;return e=(.5-e)*Math.PI,Kb.r=255*(t=Math.sin(e))*t,Kb.g=255*(t=Math.sin(e+kJ))*t,Kb.b=255*(t=Math.sin(e+PJ))*t,Kb+""}function R3(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}function Jb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const F3=Jb(dn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var O3=Jb(dn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),L3=Jb(dn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),N3=Jb(dn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function eS(e){return"string"==typeof e?new Js([[document.querySelector(e)]],[document.documentElement]):new Js([[e]],SR)}function Dm(e){return function(){return e}}function z3(e){this._context=e}function Qb(e){return new z3(e)}function OJ(e){return e[0]}function LJ(e){return e[1]}z3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},Math,Math;const B3=Math.cos,tS=(Math,Math.min),ex=Math.sin,Ni=Math.sqrt,Sm=Math.PI,tx=2*Sm,zJ=Ni(3),$3={draw(e,t){const n=.59436*Ni(t+tS(t/28,.75)),r=n/2,i=r*zJ;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},h_={draw(e,t){const n=Ni(t/Sm);e.moveTo(n,0),e.arc(0,0,n,0,tx)}},j3={draw(e,t){const n=Ni(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},H3=Ni(1/3),BJ=2*H3,G3={draw(e,t){const n=Ni(t/BJ),r=n*H3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},q3={draw(e,t){const n=.62625*Ni(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},Z3={draw(e,t){const n=.87559*Ni(t-tS(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},W3={draw(e,t){const n=Ni(t),r=-n/2;e.rect(r,r,n,n)}},X3={draw(e,t){const n=.4431*Ni(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},Y3=ex(Sm/10)/ex(7*Sm/10),UJ=ex(tx/10)*Y3,$J=-B3(tx/10)*Y3,K3={draw(e,t){const n=Ni(.8908130915292852*t),r=UJ*n,i=$J*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const c=tx*o/5,d=B3(c),p=ex(c);e.lineTo(p*n,-d*n),e.lineTo(d*r-p*i,p*r+d*i)}e.closePath()}},nS=Ni(3),J3={draw(e,t){const n=-Ni(t/(3*nS));e.moveTo(0,2*n),e.lineTo(-nS*n,-n),e.lineTo(nS*n,-n),e.closePath()}},jJ=Ni(3),Q3={draw(e,t){const n=.6824*Ni(t),r=n/2,i=n*jJ/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},ka=-.5,Pa=Ni(3)/2,rS=1/Ni(12),HJ=3*(rS/2+1),eN={draw(e,t){const n=Ni(t/HJ),r=n/2,i=n*rS,o=r,c=n*rS+n,d=-o,p=c;e.moveTo(r,i),e.lineTo(o,c),e.lineTo(d,p),e.lineTo(ka*r-Pa*i,Pa*r+ka*i),e.lineTo(ka*o-Pa*c,Pa*o+ka*c),e.lineTo(ka*d-Pa*p,Pa*d+ka*p),e.lineTo(ka*r+Pa*i,ka*i-Pa*r),e.lineTo(ka*o+Pa*c,ka*c-Pa*o),e.lineTo(ka*d+Pa*p,ka*p-Pa*d),e.closePath()}},tN={draw(e,t){const n=.6189*Ni(t-tS(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},GJ=[h_,j3,G3,W3,K3,J3,eN],qJ=[h_,Z3,tN,Q3,$3,X3,q3];function Uh(){}function nx(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function rx(e){this._context=e}function nN(e){this._context=e}function rN(e){this._context=e}rx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},nN.prototype={areaStart:Uh,areaEnd:Uh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:nx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},rN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:nx(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class iN{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function oN(e,t){this._basis=new rx(e),this._beta=t}oN.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var p,r=e[0],i=t[0],o=e[n]-r,c=t[n]-i,d=-1;++d<=n;)this._basis.point(this._beta*e[d]+(1-this._beta)*(r+(p=d/n)*o),this._beta*t[d]+(1-this._beta)*(i+p*c));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const QJ=function e(t){function n(r){return 1===t?new rx(r):new oN(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function ix(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function iS(e,t){this._context=e,this._k=(1-t)/6}iS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ix(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ix(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eQ=function e(t){function n(r){return new iS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function oS(e,t){this._context=e,this._k=(1-t)/6}oS.prototype={areaStart:Uh,areaEnd:Uh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ix(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tQ=function e(t){function n(r){return new oS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function sS(e,t){this._context=e,this._k=(1-t)/6}sS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ix(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nQ=function e(t){function n(r){return new sS(r,t)}return n.tension=function(r){return e(+r)},n}(0);function aS(e,t,n){var r=e._x1,i=e._y1,o=e._x2,c=e._y2;if(e._l01_a>1e-12){var d=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,p=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*d-e._x0*e._l12_2a+e._x2*e._l01_2a)/p,i=(i*d-e._y0*e._l12_2a+e._y2*e._l01_2a)/p}if(e._l23_a>1e-12){var v=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,C=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*v+e._x1*e._l23_2a-t*e._l12_2a)/C,c=(c*v+e._y1*e._l23_2a-n*e._l12_2a)/C}e._context.bezierCurveTo(r,i,o,c,e._x2,e._y2)}function sN(e,t){this._context=e,this._alpha=t}sN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:aS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rQ=function e(t){function n(r){return t?new sN(r,t):new iS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function aN(e,t){this._context=e,this._alpha=t}aN.prototype={areaStart:Uh,areaEnd:Uh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:aS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iQ=function e(t){function n(r){return t?new aN(r,t):new oS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lN(e,t){this._context=e,this._alpha=t}lN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:aS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const oQ=function e(t){function n(r){return t?new lN(r,t):new sS(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cN(e){this._context=e}function uN(e){return e<0?-1:1}function hN(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),c=(n-e._y1)/(i||r<0&&-0),d=(o*i+c*r)/(r+i);return(uN(o)+uN(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(d))||0}function dN(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function lS(e,t,n){var r=e._x0,o=e._x1,c=e._y1,d=(o-r)/3;e._context.bezierCurveTo(r+d,e._y0+d*t,o-d,c-d*n,o,c)}function ox(e){this._context=e}function fN(e){this._context=new pN(e)}function pN(e){this._context=e}function mN(e){this._context=e}function gN(e){var t,r,n=e.length-1,i=new Array(n),o=new Array(n),c=new Array(n);for(i[0]=0,o[0]=2,c[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(c[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t0&&isFinite(e)?e:NaN}function uS(e){return e<0&&isFinite(e)?e:NaN}cN.prototype={areaStart:Uh,areaEnd:Uh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},ox.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:lS(this,this._t0,dN(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,lS(this,dN(this,n=hN(this,e,t)),n);break;default:lS(this,this._t0,n=hN(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(fN.prototype=Object.create(ox.prototype)).point=function(e,t){ox.prototype.point.call(this,t,e)},pN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},mN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=gN(e),i=gN(t),o=0,c=1;c=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}},Mm.prototype={constructor:Mm,scale:function(e){return 1===e?this:new Mm(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Mm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Mm(1,0,0);const bQ=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function bN(e,t){return bQ.test(e+="")?new Date(e):"function"==typeof t?t(e):t}const xQ=new Map([["second",wu],["minute",Vb],["hour",$b],["day",_m],["week",vm],["month",xm],["quarter",xm.every(3)],["half",xm.every(6)],["year",Cc],["monday",o_],["tuesday",QO],["wednesday",eL],["thursday",Cf],["friday",tL],["saturday",nL],["sunday",vm]]),wQ=new Map([["second",wu],["minute",Ub],["hour",jb],["day",i_],["week",bm],["month",wm],["quarter",wm.every(3)],["half",wm.every(6)],["year",Ec],["monday",s_],["tuesday",rL],["wednesday",iL],["thursday",Df],["friday",oL],["saturday",sL],["sunday",bm]]);function CQ(e){const t=xQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}function EQ(e){const t=wQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}const d_=Object.getPrototypeOf(Uint8Array),DQ=Object.prototype.toString;function Sc(e,t,n){const r=typeof t;return"string"===r?xN(e,MQ(t),n):"function"===r?xN(e,t,n):"number"===r||t instanceof Date||"boolean"===r?Ho(e,Tm(t),n):function wN(e,t){return void 0===t?Mc(e):e instanceof t?e:t.prototype instanceof d_&&!(e instanceof d_)?t.from(e,dS):t.from(e)}("function"==typeof t?.transform?t.transform(e):t,n)}function xN(e,t,n){return Ho(e,n?.prototype instanceof d_?function SQ(e){return(t,n)=>dS(e(t,n))}(t):t,n)}const MQ=e=>t=>t[e],IQ=(e,t)=>t,Cu={transform:e=>e},TQ=()=>!0,Il=e=>null==e?e:`${e}`,fi=e=>null==e?e:+e,CN=e=>e?e[0]:void 0,hS=e=>e?e[1]:void 0,Tm=e=>()=>e;function EN(e){const t=+`${e}`.slice(1)/100;return(n,r)=>B0(n,t,r)}function lx(e){return e instanceof d_?e:Ho(e,dS,Float64Array)}function dS(e){return null==e?NaN:Number(e)}function AQ(e){return Ho(e,kQ)}function kQ(e){return e instanceof Date&&!isNaN(e)?e:"string"==typeof e?bN(e):null==e||isNaN(e=+e)?void 0:new Date(e)}function Am(e,t){return void 0===e&&(e=t),null===e?[void 0,"none"]:hx(e)?[void 0,e]:[e,void 0]}function Ps(e,t){return void 0===e&&(e=t),null===e||"number"==typeof e?[void 0,e]:[e,void 0]}function DN(e,t,n){if(null!=e)return Eu(e,t,n)}function Eu(e,t,n){const r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Mc(e){return null==e||e instanceof Array||e instanceof d_?e:Array.from(e)}function Ho(e,t,n=Array){return null==e?e:e instanceof n?e.map(t):n.from(e,t)}function fS(e,t=Array){return e instanceof t?e.slice():t.from(e)}function km(e){return e?.toString===DQ}function Pm(e){return km(e)&&(void 0!==e.type||void 0!==e.domain)}function cx(e){return km(e)&&"function"!=typeof e.transform}function Rm(e){return cx(e)&&void 0===e.value&&void 0===e.channel}function ux(e,t){return void 0===e&&void 0===t?[CN,hS]:[e,t]}function SN({z:e,fill:t,stroke:n}={}){return void 0===e&&([e]=Am(t)),void 0===e&&([e]=Am(n)),e}function f_(e){const t=e.length,n=new Uint32Array(t);for(let r=0;re[n])}function pS(e){return null!==e&&"object"==typeof e?e.valueOf():e}function p_(e,t){return"string"==typeof e?e:e&&void 0!==e.label?e.label:t}function mS(e,t){if(null!=e){if("number"==typeof e){const n=e;return{floor:r=>n*Math.floor(r/n),offset:r=>r+n,range:(r,i)=>fR(Math.ceil(r/n),i/n).map(o=>n*o)}}if("string"==typeof e)return("time"===t?CQ:EQ)(e);if("function"!=typeof e.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof e.offset)throw new Error("invalid interval; missing offset method");return e}}function m_(e,t){if((e=mS(e,t))&&"function"!=typeof e.range)throw new Error("invalid interval: missing range method");return e}function gS(e){return void 0===e||cx(e)?e:{value:e}}function $h(e){return e&&"function"==typeof e[Symbol.iterator]}function OQ(e){for(const t of e)if(null!=t)return"object"!=typeof t||t instanceof Date}function IN(e){for(const t of e){if(null==t)continue;const n=typeof t;return"string"===n||"boolean"===n}}function Tl(e){for(const t of e)if(null!=t)return t instanceof Date}function LQ(e){for(const t of e)if(null!=t)return"string"==typeof t&&isNaN(t)&&bN(t)}function NQ(e){for(const t of e)if(null!=t){if("string"!=typeof t)return!1;if(t.trim())return!isNaN(t)}}function yS(e,t){let n;for(const r of e)if(null!=r){if(!t(r))return!1;n=!0}return n}function hx(e){return"string"==typeof e&&("none"===(e=e.toLowerCase().trim())||"currentcolor"===e||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||null!==Lh(e))}function BQ(e){return"number"==typeof e&&(0<=e&&e<=1||isNaN(e))}function ea(e){return null==e||g_(e)}function g_(e){return/^\s*none\s*$/i.test(e)}function _S(e="middle"){return Eu(e,"frameAnchor",["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function y_(e){if(null!=e)return Ay(e[0],e[e.length-1])}function TN(e){return $h(e)?function $Q(e){console.warn("named iterables are deprecated; please use an object instead");const t=new Set;return Object.fromEntries(Array.from(e,n=>{const{name:r}=n;if(null==r)throw new Error("missing name");const i=`${r}`;if("__proto__"===i)throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}(e):e}const Ic=Symbol("position"),Tc=Symbol("color"),dx=Symbol("radius"),fx=Symbol("length"),px=Symbol("opacity"),mx=Symbol("symbol"),ni=new Map([["x",Ic],["y",Ic],["fx",Ic],["fy",Ic],["r",dx],["color",Tc],["opacity",px],["symbol",mx],["length",fx]]),HQ=2/Math.sqrt(3),vS=new Map([["asterisk",$3],["circle",h_],["cross",j3],["diamond",G3],["diamond2",q3],["hexagon",{draw(e,t){const n=Math.sqrt(t/Math.PI),r=n*HQ,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}}],["plus",Z3],["square",W3],["square2",X3],["star",K3],["times",tN],["triangle",J3],["triangle2",Q3],["wye",eN]]);function bS(e){return e&&"function"==typeof e.draw}function qQ(e){return!!bS(e)||"string"==typeof e&&vS.has(e.toLowerCase())}function xS(e){if(null==e||bS(e))return e;const t=vS.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function CS(e,t,n=YQ){if(null==e)return n(e);if("function"==typeof e.reduceIndex)return e;if("function"==typeof e.reduce&&km(e))return function QQ(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}(e);if("function"==typeof e)return function eee(e){return{reduceIndex:(t,n,r)=>e(Fm(n,t),r)}}(e);if(/^p\d{2}$/i.test(e))return Du(EN(e));switch(`${e}`.toLowerCase()){case"first":return ON;case"last":return nee;case"identity":return FN;case"count":return ES;case"distinct":return ree;case"sum":return null==t?ES:iee;case"proportion":return LN(t,"data");case"proportion-facet":return LN(t,"facet");case"deviation":return Du(rR);case"min":return Du(Fh);case"min-index":return Du(KG);case"max":return Du(ls);case"max-index":return Du(qG);case"mean":return RN(ZG);case"median":return RN(V0);case"variance":return Du(xE);case"mode":return Du(dR)}return n(e)}function YQ(e){throw new Error(`invalid reduce: ${e}`)}function Du(e){return{reduceIndex:(t,n)=>e(t,r=>n[r])}}function RN(e){return{reduceIndex(t,n){const r=e(t,i=>n[i]);return Tl(n)?new Date(r):r}}}const FN={reduceIndex:(e,t)=>Fm(t,e)},ON={reduceIndex:(e,t)=>t[e[0]]},nee={reduceIndex:(e,t)=>t[e[e.length-1]]},ES={label:"Frequency",reduceIndex:e=>e.length},ree={label:"Distinct",reduceIndex(e,t){const n=new wE;for(const r of e)n.add(t[r]);return n.size}},iee=Du(U0);function LN(e,t){return null==e?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>U0(n,o=>r[o])/i}}function __(e,{scale:t,type:n,value:r,filter:i,hint:o},c){return NN(c,{scale:t,type:n,value:Sc(e,r),label:p_(r),filter:i,hint:o})}function NN(e,t){const{scale:n,value:r}=t;if(!0===n||"auto"===n)switch(e){case"fill":case"stroke":case"color":t.scale=!0!==n&&yS(r,hx)?null:"color";break;case"fillOpacity":case"strokeOpacity":t.scale=!0!==n&&yS(r,BQ)?null:"opacity";break;case"symbol":!0!==n&&yS(r,qQ)?(t.scale=null,t.value=Ho(r,xS)):t.scale="symbol";break;default:t.scale=ni.has(e)?e:null}else if(!1===n)t.scale=null;else if(null!=n&&!ni.has(n))throw new Error(`unknown scale: ${n}`);return t}function lee(e,t){for(const n in e){const r=e[n];if(r.scale===t)return r}}function cee(e,t){const n=e.original;if(n===e)return t;const r=t.value,i=t.value=[];for(let o=0;oMath.abs(o-r[c]),Float64Array)}function DS(e,t,n){let r=e[t];if(!r&&void 0!==n&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function uee([e,t],[n,r]){return Im(t,r)||Im(e,n)}function hee([e,t],[n,r]){return _N(t,r)||Im(e,n)}let SS=0;function Mf(e){console.warn(e),++SS}const BN=Math.PI,Su=2*BN;function fee({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:o=t}={},c){if(null==e)return;if("function"==typeof e.stream)return e;let d,p,v="frame";if(km(e)){let fe;if(({type:e,domain:p,inset:fe,insetTop:n=(void 0!==fe?fe:n),insetRight:r=(void 0!==fe?fe:r),insetBottom:i=(void 0!==fe?fe:i),insetLeft:o=(void 0!==fe?fe:o),clip:v=v,...d}=e),null==e)return}"function"!=typeof e&&({type:e}=VN(e));const{width:C,height:D,marginLeft:I,marginRight:P,marginTop:N,marginBottom:G}=c,U=C-I-P-o-r,Z=D-N-G-n-i;if(e=e?.({width:U,height:Z,clip:v,...d}),null==e)return;v=function pee(e,t,n,r,i){if(!1===e||null==e||"number"==typeof e)return o=>o;if("frame"===(!0===e&&(e="frame"),`${e}`.toLowerCase()))return CF(t,n,r,i);throw new Error(`unknown projection clip type: ${e}`)}(v,I,N,C-P,D-G);let re,ne=I+o,X=N+n;if(null!=p){const[[fe,ve],[Re,We]]=hD(e).bounds(p),Ke=Math.min(U/(Re-fe),Z/(We-ve));Ke>0?(ne-=(Ke*(fe+Re)-U)/2,X-=(Ke*(ve+We)-Z)/2,re=_D({point(lt,Ue){this.stream.point(lt*Ke+ne,Ue*Ke+X)}})):Mf("Warning: the projection could not be fit to the specified domain; using the default scale.")}return re??(re=0===ne&&0===X?UN():_D({point(fe,ve){this.stream.point(fe+ne,ve+X)}})),{stream:fe=>e.stream(re.stream(v(fe)))}}function VN(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Al(gY,.7463,.4673);case"albers":return yx(lO,.7463,.4673);case"azimuthal-equal-area":return Al(yY,4,4);case"azimuthal-equidistant":return Al(_Y,Su,Su);case"conic-conformal":return yx(xY,Su,Su);case"conic-equal-area":return yx(Tb,6.1702,2.9781);case"conic-equidistant":return yx(EY,7.312,3.6282);case"equal-earth":return Al(SY,5.4133,2.6347);case"equirectangular":return Al(wY,Su,BN);case"gnomonic":return Al(MY,3.4641,3.4641);case"identity":return{type:UN};case"reflect-y":return{type:mee};case"mercator":return Al(vY,Su,Su);case"orthographic":return Al(IY,2,2);case"stereographic":return Al(TY,2,2);case"transverse-mercator":return Al(AY,Su,Su);default:throw new Error(`unknown projection type: ${e}`)}}function Al(e,t,n){return{type:({width:r,height:i,rotate:o,precision:c=.15,clip:d})=>{const p=e();return null!=c&&p.precision?.(c),null!=o&&p.rotate?.(o),"number"==typeof d&&p.clipAngle?.(d),p.scale(Math.min(r/t,i/n)),p.translate([r/2,i/2]),p},aspectRatio:n/t}}function yx(e,t,n){const{type:r,aspectRatio:i}=Al(e,t,n);return{type:o=>{const{parallels:c,domain:d,width:p,height:v}=o,C=r(o);return null!=c&&(C.parallels(c),void 0===d&&C.fitSize([p,v],{type:"Sphere"})),C},aspectRatio:i}}const UN=Tm({stream:e=>e}),mee=Tm(_D({point(e,t){this.stream.point(e,-t)}}));function _x(e,t,n,r,i){const o=n[e]&&"x"===n[e].scale,c=n[t]&&"y"===n[t].scale;if(o&&c)!function gee(e,t,n,r){const i=n[e],o=n[t],c=i.length,d=n[e]=new Float64Array(c).fill(NaN),p=n[t]=new Float64Array(c).fill(NaN);let v;const C=r.stream({point(D,I){d[v]=D,p[v]=I}});for(v=0;v1===n?[e[3][1]]:2===n?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)))>9?Sl(t,n):e[n]}function Mu(e,t){return({length:n})=>2===n?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)))>11?Sl(t,n):e[n]}function jN(e,t){return({length:n})=>2===n?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)))>11?Sl(r=>t(1-r),n):e[n].slice().reverse()}function Iu(e){return({length:t})=>Sl(e,Math.max(2,Math.floor(t)))}function HN(e){return({length:t})=>Sl(e,Math.floor(t)+1).slice(0,-1)}function GN(e){const t=`${e}`.toLowerCase();if(!$N.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return $N.get(t)}function bx(e,t){const n=GN(e),r="function"==typeof n?n({length:t}):n;return r.length!==t?r.slice(0,t):r}const qN=new Map([["brbg",ML],["prgn",TL],["piyg",kL],["puor",RL],["rdbu",Zb],["rdgy",OL],["rdylbu",Wb],["rdylgn",NL],["spectral",BL],["burd",e=>Zb(1-e)],["buylrd",e=>Wb(1-e)],["blues",h3],["greens",f3],["greys",m3],["purples",y3],["reds",v3],["oranges",x3],["turbo",R3],["viridis",F3],["magma",O3],["inferno",L3],["plasma",N3],["cividis",w3],["cubehelix",I3],["warm",T3],["cool",A3],["bugn",UL],["bupu",jL],["gnbu",GL],["orrd",ZL],["pubugn",XL],["pubu",KL],["purd",QL],["rdpu",t3],["ylgnbu",r3],["ylgn",o3],["ylorbr",a3],["ylorrd",c3],["rainbow",k3],["sinebow",P3]]);function IS(e){const t=`${e}`.toLowerCase();if(!qN.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return qN.get(t)}const bee=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function ZN(e){return null!=e&&bee.has(`${e}`.toLowerCase())}const WN=e=>t=>e(1-t),TS=[0,1],XN=new Map([["number",Uo],["rgb",_f],["hsl",kY],["hcl",FY],["lab",function RY(e,t){var n=to((e=ED(e)).l,(t=ED(t)).l),r=to(e.a,t.a),i=to(e.b,t.b),o=to(e.opacity,t.opacity);return function(c){return e.l=n(c),e.a=r(c),e.b=i(c),e.opacity=o(c),e+""}}]]);function YN(e){const t=`${e}`.toLowerCase();if(!XN.has(t))throw new Error(`unknown interpolator: ${t}`);return XN.get(t)}function v_(e,t,n,{type:r,nice:i,clamp:o,zero:c,domain:d=JN(e,n),unknown:p,round:v,scheme:C,interval:D,range:I=(ni.get(e)===dx?kee(n,d):ni.get(e)===fx?Pee(n,d):ni.get(e)===px?TS:void 0),interpolate:P=(ni.get(e)===Tc?null==C&&void 0!==I?_f:IS(void 0!==C?C:"cyclical"===r?"rainbow":"turbo"):v?CD:Uo),reverse:N}){if(D=m_(D,r),("cyclical"===r||"sequential"===r)&&(r="linear"),N=!!N,"function"!=typeof P&&(P=YN(P)),1===P.length?(N&&(P=WN(P),N=!1),void 0===I&&2===(I=Float64Array.from(d,(G,U)=>U/(d.length-1))).length&&(I=TS),t.interpolate((I===TS?Tm:kS)(P))):t.interpolate(P),c){const[G,U]=em(d);(G>0||U<0)&&(y_(d=fS(d))!==Math.sign(G)?d[d.length-1]=0:d[0]=0)}return N&&(d=H0(d)),t.domain(d).unknown(p),i&&(t.nice(function xee(e,t){return!0===e?void 0:"number"==typeof e?e:function RQ(e,t){if((e=m_(e,t))&&"function"!=typeof e.ceil)throw new Error("invalid interval: missing ceil method");return e}(e,t)}(i,r)),d=t.domain()),void 0!==I&&t.range(I),o&&t.clamp(o),{type:r,domain:d,range:I,scale:t,interpolate:P,interval:D}}function KN(e,t,{exponent:n=1,...r}){return v_(e,VD().exponent(n),t,{...r,type:"pow"})}function Eee(e,t,{base:n=10,domain:r=Ree(t),...i}){return v_(e,$O().base(n),t,{...i,domain:r})}function Dee(e,t,{constant:n=1,...r}){return v_(e,qO().constant(n),t,r)}function See(e,t,{range:n,quantiles:r=(void 0===n?5:(n=[...n]).length),n:i=r,scheme:o="rdylbu",domain:c=Fee(t),unknown:d,interpolate:p,reverse:v}){return void 0===n&&(n=void 0!==p?Sl(p,i):ni.get(e)===Tc?bx(o,i):void 0),c.length>0&&(c=XO(c,void 0===n?{length:i}:n).quantiles()),AS(e,0,{domain:c,range:n,reverse:v,unknown:d})}function AS(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:c=(void 0!==o?Sl(o,n.length+1):ni.get(e)===Tc?bx(i,n.length+1):void 0),reverse:d}){const p=y_(n=Mc(n));if(!isNaN(p)&&!function Iee(e,t){for(let n=1,r=e.length,i=e[0];nvoid 0===n?n:Fh(n,t)),ls(e,({value:n})=>void 0===n?n:ls(n,t))]:[0,1]}function JN(e,t){const n=ni.get(e);return(n===dx||n===px||n===fx?Aee:b_)(t)}function Aee(e){return[0,e.length?ls(e,({value:t})=>void 0===t?t:ls(t,vN)):1]}function kee(e,t){const n=e.find(({radius:c})=>void 0!==c);if(void 0!==n)return[0,n.radius];const r=B0(e,.5,({value:c})=>void 0===c?NaN:B0(c,.25,ax)),i=t.map(c=>3*Math.sqrt(c/r)),o=30/ls(i);return o<1?i.map(c=>c*o):i}function Pee(e,t){const n=V0(e,({value:o})=>void 0===o?NaN:V0(o,Math.abs)),r=t.map(o=>12*o/n),i=60/ls(r);return i<1?r.map(o=>o*i):r}function Ree(e){for(const{value:t}of e)if(void 0!==t)for(let n of t){if(n>0)return b_(e,ax);if(n<0)return b_(e,uS)}return[1,10]}function Fee(e){const t=[];for(const{value:n}of e)if(void 0!==n)for(const r of n)t.push(r);return t}function kS(e){return(t,n)=>r=>e(t+r*(n-t))}function xx(e,t,n,r,{type:i,nice:o,clamp:c,domain:d=b_(r),unknown:p,pivot:v=0,scheme:C,range:D,symmetric:I=!0,interpolate:P=(ni.get(e)===Tc?null==C&&void 0!==D?_f:IS(void 0!==C?C:"rdbu"):Uo),reverse:N}){v=+v;let[G,U]=d;if(Ay(G,U)<0&&([G,U]=[U,G],N=!N),G=Math.min(G,v),U=Math.max(U,v),"function"!=typeof P&&(P=YN(P)),void 0!==D&&(P=1===P.length?kS(P)(...D):AD(P,D)),N&&(P=WN(P)),I){const Z=n.apply(v),ne=Z-n.apply(G),X=n.apply(U)-Z;neX&&(U=n.invert(Z+ne))}return t.domain([G,v,U]).unknown(p).interpolator(P),c&&t.clamp(c),o&&t.nice(o),{type:i,domain:[G,U],pivot:v,interpolate:P,scale:t}}function Oee(e,t,n){return xx(e,CL(),Bee,t,n)}function QN(e,t,{exponent:n=1,...r}){return xx(e,WD().exponent(n=+n),function $ee(e){return.5===e?Uee:{apply:t=>Math.sign(t)*Math.pow(Math.abs(t),e),invert:t=>Math.sign(t)*Math.pow(Math.abs(t),1/e)}}(n),t,{...r,type:"diverging-pow"})}function Nee(e,t,{base:n=10,pivot:r=1,domain:i=b_(t,r<0?uS:ax),...o}){return xx(e,EL().base(n=+n),Vee,t,{domain:i,pivot:r,...o})}function zee(e,t,{constant:n=1,...r}){return xx(e,DL().constant(n=+n),function jee(e){return{apply:t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),invert:t=>Math.sign(t)*Math.expm1(Math.abs(t))*e}}(n),t,r)}const Bee={apply:e=>e,invert:e=>e},Vee={apply:Math.log,invert:Math.exp},Uee={apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*(e*e)};function e5(e,t,n,r){return v_(e,t,n,r)}const x_=Symbol("ordinal");function t5(e,t,n,{type:r,interval:i,domain:o,range:c,reverse:d,hint:p}){return i=m_(i,r),void 0===o&&(o=r5(n,i,e)),("categorical"===r||r===x_)&&(r="ordinal"),d&&(o=H0(o)),t.domain(o),void 0!==c&&("function"==typeof c&&(c=c(o)),t.range(c)),{type:r,domain:o,range:c,scale:t,hint:p,interval:i}}function n5(e,t,n,r){let{round:i}=n;return void 0!==i&&e.round(i=!!i),(e=t5(r,e,t,n)).round=i,e}function r5(e,t,n){const r=new wE;for(const{value:i,domain:o}of e){if(void 0!==o)return o();if(void 0!==i)for(const c of i)r.add(c)}if(void 0!==t){const[i,o]=em(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&ni.get(n)===Ic)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return z0(r,Im)}function i5(e,t){let n;for(const{hint:r}of e){const i=r?.[t];if(void 0!==i)if(void 0===n)n=i;else if(n!==i)return}return n}function PS(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:c=n,round:d,nice:p,clamp:v,zero:C,align:D,padding:I,projection:P,facet:{label:N=t}={},...G}={}){const U={};for(const[Z,ne]of e){const X=G[Z],re=h5(Z,ne,{round:ni.get(Z)===Ic?d:void 0,nice:p,clamp:v,zero:C,align:D,padding:I,projection:P,...X});if(re){let{label:fe=("fx"===Z||"fy"===Z?N:t),percent:ve,transform:Re,inset:We,insetTop:Ke=(void 0!==We?We:"y"===Z?r:0),insetRight:lt=(void 0!==We?We:"x"===Z?i:0),insetBottom:Ue=(void 0!==We?We:"y"===Z?o:0),insetLeft:st=(void 0!==We?We:"x"===Z?c:0)}=X||{};if(null==Re)Re=void 0;else if("function"!=typeof Re)throw new Error("invalid scale transform; not a function");re.percent=!!ve,re.label=void 0===fe?Jee(ne,re):fe,re.transform=Re,"x"===Z||"fx"===Z?(re.insetLeft=+st,re.insetRight=+lt):("y"===Z||"fy"===Z)&&(re.insetTop=+Ke,re.insetBottom=+Ue),U[Z]=re}}return U}function o5(e){return Object.fromEntries(Object.entries(e).filter(([,{scale:t}])=>t).map(([t,{scale:n,type:r,interval:i,label:o}])=>(n.type=r,null!=i&&(n.interval=i),null!=o&&(n.label=o),[t,n])))}function Jee(e=[],t){let n;for(const{label:r}of e)if(void 0!==r)if(void 0===n)n=r;else if(n!==r)return;if(!(void 0===n||f5(t)&&/^(date|time|year)$/i.test(n)))return!If(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function RS(e){const{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:o,height:c,facet:{marginTop:d,marginRight:p,marginBottom:v,marginLeft:C}}=e;return{marginTop:Math.max(t,d),marginRight:Math.max(n,p),marginBottom:Math.max(r,v),marginLeft:Math.max(i,C),width:o,height:c}}function s5({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:d,height:p}=RS(n);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:e?e.scale.bandwidth()+c+i:d,height:t?t.scale.bandwidth()+r+o:p}}function a5(e,t){if(void 0===e.range){const{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:o=0,marginRight:c=0}=t,d=o+n;e.range=[d,Math.max(d,i-c-r)],If(e)||(e.range=u5(e)),e.scale.range(e.range)}c5(e)}function l5(e,t){if(void 0===e.range){const{insetTop:n,insetBottom:r}=e,{height:i,marginTop:o=0,marginBottom:c=0}=t,d=o+n;e.range=[Math.max(d,i-c-r),d],If(e)?e.range.reverse():e.range=u5(e),e.scale.range(e.range)}c5(e)}function c5(e){void 0===e.round&&function tte({type:e}){return"point"===e||"band"===e}(e)&&function Qee({scale:e}){const t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),c=t-i,d=Math.abs(r-n)/Math.max(1,c+2*o);return(d-Math.floor(d))*c}(e)<=30&&e.scale.round(!0)}function u5(e){const t=e.scale.domain().length+p5(e);if(!(t>2))return e.range;const[n,r]=e.range;return Array.from({length:t},(i,o)=>n+o/(t-1)*(r-n))}function FS(e,t,n){return h5(e,void 0===n?void 0:[{hint:n}],{...t})}function h5(e,t=[],n={}){const r=function ete(e,t,{type:n,domain:r,range:i,scheme:o,pivot:c,projection:d}){if("fx"===e||"fy"===e)return"band";("x"===e||"y"===e)&&null!=d&&(n=d5);for(const{type:C}of t)if(void 0!==C)if(void 0===n)n=C;else if(n!==C)throw new Error(`scale incompatible with channel: ${n} !== ${C}`);if(n===d5)return;if(void 0!==n)return n;if(void 0===r&&!t.some(({value:C})=>void 0!==C))return;const p=ni.get(e);if(p===dx)return"sqrt";if(p===px||p===fx)return"linear";if(p===mx)return"ordinal";if((r||i||[]).length>2)return OS(p);if(void 0!==r)return IN(r)?OS(p):Tl(r)?"utc":p!==Tc||null==c&&!ZN(o)?"linear":"diverging";const v=t.map(({value:C})=>C).filter(C=>void 0!==C);return v.some(IN)?OS(p):v.some(Tl)?"utc":p!==Tc||null==c&&!ZN(o)?"linear":"diverging"}(e,t,n);if(void 0===n.type&&void 0===n.domain&&void 0===n.range&&null==n.interval&&"fx"!==e&&"fy"!==e&&If({type:r})){const i=t.map(({value:o})=>o).filter(o=>void 0!==o);i.some(Tl)?Mf(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Om(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${Om(r)}".`):i.some(LQ)?Mf(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Om(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${Om(r)}".`):i.some(NQ)&&Mf(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Om(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${Om(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=Cx(t,n,lx);break;case"identity":switch(ni.get(e)){case Ic:n=Cx(t,n,lx);break;case mx:n=Cx(t,n,nte)}break;case"utc":case"time":n=Cx(t,n,AQ)}switch(r){case"diverging":return Oee(e,t,n);case"diverging-sqrt":return function Lee(e,t,n){return QN(e,t,{...n,exponent:.5})}(e,t,n);case"diverging-pow":return QN(e,t,n);case"diverging-log":return Nee(e,t,n);case"diverging-symlog":return zee(e,t,n);case"categorical":case"ordinal":case x_:return function qee(e,t,{type:n,interval:r,domain:i,range:o,scheme:c,unknown:d,...p}){let v;if(r=m_(r,n),void 0===i&&(i=r5(t,r,e)),ni.get(e)===mx)v=function Xee(e){return{fill:i5(e,"fill"),stroke:i5(e,"stroke")}}(t),o=void 0===o?function Yee(e){return ea(e.fill)?qJ:GJ}(v):Ho(o,xS);else if(ni.get(e)===Tc&&(void 0===o&&("ordinal"===n||n===x_)&&(o=function vee(e,t="greys"){const n=new Set,[r,i]=bx(t,2);for(const o of e)if(null!=o)if(!0===o)n.add(i);else{if(!1!==o)return;n.add(r)}return[...n]}(i,c),void 0!==o&&(c=void 0)),void 0===c&&void 0===o&&(c="ordinal"===n?"turbo":"tableau10"),void 0!==c))if(void 0!==o){const C=IS(c),D=o[0],I=o[1]-o[0];o=({length:P})=>Sl(N=>C(D+I*N),P)}else o=GN(c);if(d===RD)throw new Error(`implicit unknown on ${e} scale is not supported`);return t5(e,FD().unknown(d),t,{...p,type:n,domain:i,range:o,hint:v})}(e,t,n);case"cyclical":case"sequential":case"linear":return function wee(e,t,n){return v_(e,BD(),t,n)}(e,t,n);case"sqrt":return function Cee(e,t,n){return KN(e,t,{...n,exponent:.5})}(e,t,n);case"threshold":return AS(e,0,n);case"quantile":return See(e,t,n);case"quantize":return function Mee(e,t,{range:n,n:r=(void 0===n?5:(n=[...n]).length),scheme:i="rdylbu",domain:o=JN(e,t),unknown:c,interpolate:d,reverse:p}){const[v,C]=em(o);let D;return void 0===n?(D=j0(v,C,r),D[0]<=v&&D.splice(0,1),D[D.length-1]>=C&&D.pop(),r=D.length+1,n=void 0!==d?Sl(d,r):ni.get(e)===Tc?bx(i,r):void 0):(D=Sl(Uo(v,C),r+1).slice(1,-1),v instanceof Date&&(D=D.map(I=>new Date(I)))),y_(Mc(o))<0&&D.reverse(),AS(e,0,{domain:D,range:n,reverse:p,unknown:c})}(e,t,n);case"pow":return KN(e,t,n);case"log":return Eee(e,t,n);case"symlog":return Dee(e,t,n);case"utc":return function Gee(e,t,n){return e5(e,function gJ(){return wc.apply(ZD(sK,aK,Ec,wm,bm,i_,jb,Ub,wu,Hb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"time":return function Hee(e,t,n){return e5(e,function mJ(){return wc.apply(ZD(lK,cK,Cc,xm,vm,_m,$b,Vb,wu,Em).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"point":return function Zee(e,t,{align:n=.5,padding:r=.5,...i}){return n5(function $Y(){return PO(Nb.apply(null,arguments).paddingInner(1))}().align(n).padding(r),t,i,e)}(e,t,n);case"band":return function Wee(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=("fx"===e||"fy"===e?0:r),...c}){return n5(Nb().align(n).paddingInner(i).paddingOuter(o),t,c,e)}(e,t,n);case"identity":return ni.get(e)===Ic?function Tee(){return{type:"identity",scale:LO()}}():{type:"identity"};case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Om(e){return"symbol"==typeof e?e.description:e}const d5={toString:()=>"projection"};function OS(e){switch(e){case Ic:return"point";case Tc:return x_;default:return"ordinal"}}function f5({type:e}){return"time"===e||"utc"===e}function If({type:e}){return"ordinal"===e||"point"===e||"band"===e||e===x_}function p5({type:e}){return"threshold"===e}function wx(e){if(void 0===e)return!0;const t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}const ste=LS(e=>new Intl.NumberFormat(e));function g5(e){return function ite(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${function ote(e){return e<0?`-${Tu(-e,6)}`:e>9999?`+${Tu(e,6)}`:Tu(e,4)}(e.getUTCFullYear())}-${Tu(e.getUTCMonth()+1,2)}-${Tu(e.getUTCDate(),2)}${n||r||i||o?`T${Tu(n,2)}:${Tu(r,2)}${i||o?`:${Tu(i,2)}${o?`.${Tu(o,3)}`:""}`:""}Z`:""}`}(e,"Invalid Date")}LS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),LS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));const Ex=function ute(e="en-US"){const t=function cte(e="en-US"){const t=ste(e);return n=>null==n||isNaN(n)?void 0:t.format(n)}(e);return n=>(n instanceof Date?g5:"number"==typeof n?t:Il)(n)}(),ta=typeof window<"u"&&window.devicePixelRatio>1?0:.5;let hte=0;function y5(){return"plot-clip-"+ ++hte}function dte(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:c,fill:d,fillOpacity:p,stroke:v,strokeWidth:C,strokeOpacity:D,strokeLinejoin:I,strokeLinecap:P,strokeMiterlimit:N,strokeDasharray:G,strokeDashoffset:U,opacity:Z,mixBlendMode:ne,paintOrder:X,pointerEvents:re,shapeRendering:fe},{ariaLabel:ve,fill:Re="currentColor",fillOpacity:We,stroke:Ke="none",strokeOpacity:lt,strokeWidth:Ue,strokeLinecap:st,strokeLinejoin:Fe,strokeMiterlimit:le,paintOrder:de}){null===Re&&(d=null,p=null),null===Ke&&(v=null,D=null),ea(Re)?!ea(Ke)&&!ea(d)&&(Ke="none"):ea(Ke)&&!ea(v)&&(Re="none");const[pe,Oe]=Am(d,Re),[Ye,Ze]=Ps(p,We),[et,_t]=Am(v,Ke),[Ft,or]=Ps(D,lt),[jn,gr]=Ps(Z);g_(_t)||(void 0===C&&(C=Ue),void 0===P&&(P=st),void 0===I&&(I=Fe),void 0===N&&!function VQ(e){return/^\s*round\s*$/i.test(e)}(I)&&(N=le),!g_(Oe)&&void 0===X&&(X=de));const[xi,Wn]=Ps(C);return null!==Re&&(e.fill=us(Oe,"currentColor"),e.fillOpacity=w_(Ze,1)),null!==Ke&&(e.stroke=us(_t,"none"),e.strokeWidth=w_(Wn,1),e.strokeOpacity=w_(or,1),e.strokeLinejoin=us(I,"miter"),e.strokeLinecap=us(P,"butt"),e.strokeMiterlimit=w_(N,4),e.strokeDasharray=us(G,"none"),e.strokeDashoffset=us(U,"0")),e.target=Il(c),e.ariaLabel=Il(ve),e.ariaDescription=Il(i),e.ariaHidden=Il(o),e.opacity=w_(gr,1),e.mixBlendMode=us(ne,"normal"),e.paintOrder=us(X,"normal"),e.pointerEvents=us(re,"auto"),e.shapeRendering=us(fe,"auto"),{title:{value:t,optional:!0},href:{value:n,optional:!0},ariaLabel:{value:r,optional:!0},fill:{value:pe,scale:"auto",optional:!0},fillOpacity:{value:Ye,scale:"auto",optional:!0},stroke:{value:et,scale:"auto",optional:!0},strokeOpacity:{value:Ft,scale:"auto",optional:!0},strokeWidth:{value:xi,optional:!0},opacity:{value:jn,scale:"auto",optional:!0}}}function mte(e,t){t&&e.text(n=>Ex(t[n]))}function gte(e,t){t&&e.text(([n])=>Ex(t[n]))}function Lm(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:o,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:C}){n&&fn(e,"aria-label",D=>n[D]),i&&fn(e,"fill",D=>i[D]),o&&fn(e,"fill-opacity",D=>o[D]),c&&fn(e,"stroke",D=>c[D]),d&&fn(e,"stroke-opacity",D=>d[D]),p&&fn(e,"stroke-width",D=>p[D]),v&&fn(e,"opacity",D=>v[D]),C&&_5(e,D=>C[D],t),function fte(e,t){t&&e.filter(n=>cS(t[n])).append("title").call(mte,t)}(e,r)}function yte(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:o,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:C}){n&&fn(e,"aria-label",([D])=>n[D]),i&&fn(e,"fill",([D])=>i[D]),o&&fn(e,"fill-opacity",([D])=>o[D]),c&&fn(e,"stroke",([D])=>c[D]),d&&fn(e,"stroke-opacity",([D])=>d[D]),p&&fn(e,"stroke-width",([D])=>p[D]),v&&fn(e,"opacity",([D])=>v[D]),C&&_5(e,([D])=>C[D],t),function pte(e,t){t&&e.filter(([n])=>cS(t[n])).append("title").call(gte,t)}(e,r)}function jh(e,t,n,r){(function wte(e,t,n,r){let i;switch(t.clip){case"frame":{const{width:o,height:c,marginLeft:d,marginRight:p,marginTop:v,marginBottom:C}=n,D=y5();i=`url(#${D})`,e=Go("svg:g",r).call(I=>I.append("svg:clipPath").attr("id",D).append("rect").attr("x",d).attr("y",v).attr("width",o-p-d).attr("height",c-v-C)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{const{projection:o}=r;if(!o)throw new Error('the "sphere" clip option requires a projection');const c=y5();i=`url(#${c})`,e.append("clipPath").attr("id",c).append("path").attr("d",hD(o)({type:"Sphere"}));break}}fn(e,"aria-label",t.ariaLabel),fn(e,"aria-description",t.ariaDescription),fn(e,"aria-hidden",t.ariaHidden),fn(e,"clip-path",i)})(e,t,n,r),fn(e,"fill",t.fill),fn(e,"fill-opacity",t.fillOpacity),fn(e,"stroke",t.stroke),fn(e,"stroke-width",t.strokeWidth),fn(e,"stroke-opacity",t.strokeOpacity),fn(e,"stroke-linejoin",t.strokeLinejoin),fn(e,"stroke-linecap",t.strokeLinecap),fn(e,"stroke-miterlimit",t.strokeMiterlimit),fn(e,"stroke-dasharray",t.strokeDasharray),fn(e,"stroke-dashoffset",t.strokeDashoffset),fn(e,"shape-rendering",t.shapeRendering),fn(e,"paint-order",t.paintOrder),fn(e,"pointer-events",t.pointerEvents)}function Hh(e,t){(function Cte(e,t,n){null!=n&&e.style(t,n)})(e,"mix-blend-mode",t.mixBlendMode),fn(e,"opacity",t.opacity)}function _5(e,t,n){e.each(function(r){const i=t(r);if(null!=i){const o=this.ownerDocument.createElementNS(nm.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(nm.xlink,"href",i),null!=n&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function fn(e,t,n){null!=n&&e.attr(t,n)}function Gh(e,t,{x:n,y:r},i=ta,o=ta){i+=t.dx,o+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function us(e,t){if((e=Il(e))!==t)return e}function w_(e,t){if((e=fi(e))!==t)return e}const Ete=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function NS(e){if(void 0===e)return`plot-${Math.random().toString(16).slice(2)}`;if(!Ete.test(e=`${e}`))throw new Error(`invalid class name: ${e}`);return e}function zS(e,t){if("string"==typeof t)e.property("style",t);else if(null!=t)for(const n of e)Object.assign(n.style,t)}function BS({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:o,marginLeft:c}){return[/left$/.test(e)?c:/right$/.test(e)?t-i:(c+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-o:(r+n-o)/2]}function Ste({x:e,y:t,fy:n,fx:r},i,{projection:o,aspectRatio:c},{width:d,marginTopDefault:p,marginRightDefault:v,marginBottomDefault:C,marginLeftDefault:D}){const I=n?n.scale.domain().length:1,P=function yee(e,t){if("function"==typeof e?.stream)return.618;if(km(e)&&(e=e.type),null==e)return function _ee(e){for(const t of e)if(t.channels.geometry)return!0;return!1}(t)?.618:void 0;if("function"!=typeof e){const{aspectRatio:n}=VN(e);if(n)return n}return.618}(o,i);if(P){const G=r?r.scale.domain().length:1,Z=Math.max(.1,Math.min(10,(1.1*I-.1)/(1.1*G-.1)*P));return Math.round((d-D-v)*Z+p+C)}const N=t?If(t)?t.scale.domain().length:Math.max(7,17/I):1;if(null!=c){if(c=+c,!(isFinite(c)&&c>0))throw new Error(`invalid aspectRatio: ${c}`);const G=v5("y",t)/(v5("x",e)*c),U=r?r.scale.bandwidth():1,Z=n?n.scale.bandwidth():1;return(G*(U*(d-D-v)-e.insetLeft-e.insetRight)+t.insetTop+t.insetBottom)/Z+p+C}return!(!t&&!n)*Math.max(1,Math.min(60,N*I))*20+30*!!r+60}function v5(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);const{type:n,domain:r}=t;let i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{const d=t.scale.exponent();i=p=>Math.pow(p,d);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}const[o,c]=em(r);return Math.abs(i(c)-i(o))}function VS(e,{fx:t,fy:n}){const r=f_(e),i=t?.value,o=n?.value;return t&&n?ky(r,c=>(c.fx=i[c[0]],c.fy=o[c[0]],c),c=>i[c],c=>o[c]):t?ky(r,c=>(c.fx=i[c[0]],c),c=>i[c]):ky(r,c=>(c.fy=o[c[0]],c),c=>o[c])}function Ate(e){const t=[],n=new Uint32Array(U0(e,r=>r.length));for(const r of e){let i=0;for(const o of e)r!==o&&(n.set(o,i),i+=o.length);t.push(n.slice(0,i))}return t}const kte=new Map([["top",US],["right",HS],["bottom",$S],["left",jS],["top-left",Dx(US,jS)],["top-right",Dx(US,HS)],["bottom-left",Dx($S,jS)],["bottom-right",Dx($S,HS)],["top-empty",function Rte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(r);if(o>0){const c=t[o-1];return e.find(d=>d.x===n&&d.y===c)?.empty}}],["right-empty",function Lte(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(n);if(od.x===c&&d.y===r)?.empty}}],["bottom-empty",function Fte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(r);if(od.x===n&&d.y===c)?.empty}}],["left-empty",function Ote(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const o=t?.indexOf(n);if(o>0){const c=t[o-1];return e.find(d=>d.x===c&&d.y===r)?.empty}}],["empty",function Nte(e,t,{empty:n}){return n}]]);function US(e,{y:t},{y:n}){return!t||0===t.indexOf(n)}function $S(e,{y:t},{y:n}){return!t||t.indexOf(n)===t.length-1}function jS(e,{x:t},{x:n}){return!t||0===t.indexOf(n)}function HS(e,{x:t},{x:n}){return!t||t.indexOf(n)===t.length-1}function Dx(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function GS(e,{channels:{fx:t,fy:n},groups:r}){return e.map(t&&n?({x:i,y:o})=>r.get(i)?.get(o)??[]:t?({x:i})=>r.get(i)??[]:({y:i})=>r.get(i)??[])}function b5(e){return If(e)&&void 0===e.interval?void 0:"tabular-nums"}function x5(e,t){if(null==t)return t;const n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function w5(e,t={},n,r){let{columns:i,tickFormat:o,fontVariant:c=b5(e),swatchSize:d=15,swatchWidth:p=d,swatchHeight:v=d,marginLeft:C=0,className:D,style:I,width:P}=t;const N=vx(t);D=NS(D),o=function zte(e,t){return void 0===e?Tl(t)?g5:Il:"function"==typeof e?e:("string"==typeof e?Tl(t)?Hb:hm:Tm)(e)}(o,e.domain);const G=Go("div",N).attr("class",D).attr("style",`\n --swatchWidth: ${+p}px;\n --swatchHeight: ${+v}px;\n `);let U;return null!=i?(U=`\n .${D}-swatch {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n }\n .${D}-swatch::before {\n flex-shrink: 0;\n }\n .${D}-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n `,G.style("columns",i).selectAll().data(e.domain).enter().append("div").attr("class",`${D}-swatch`).call(n,e).call(Z=>Z.append("div").attr("class",`${D}-label`).attr("title",o).text(o))):(U=`\n .${D} {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n }\n .${D}-swatch {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n }\n `,G.selectAll().data(e.domain).enter().append("span").attr("class",`${D}-swatch`).call(n,e).append(function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))})),G.call(Z=>Z.insert("style","*").text(`\n .${D} {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;${void 0===C?"":`\n margin-left: ${+C}px;`}${void 0===P?"":`\n width: ${P}px;`}\n }\n ${r(D)}\n ${U}\n `)).style("font-variant",us(c,"normal")).call(zS,I).node()}const Sx=new Map([["symbol",function Ute(e,{fill:t=(void 0!==e.hint?.fill?e.hint.fill:"none"),fillOpacity:n=1,stroke:r=(void 0!==e.hint?.stroke?e.hint.stroke:ea(t)?"currentColor":"none"),strokeOpacity:i=1,strokeWidth:o=1.5,r:c=4.5,...d}={},p){const[v,C]=Am(t),[D,I]=Am(r),P=x5(p,v),N=x5(p,D),G=c*c*Math.PI;return n=Ps(n)[1],i=Ps(i)[1],o=Ps(o)[1],w5(e,d,U=>U.append("svg").attr("viewBox","-8 -8 16 16").attr("fill","color"===v?Z=>P.scale(Z):null).attr("stroke","color"===D?Z=>N.scale(Z):null).append("path").attr("d",Z=>{const ne=xf();return e.scale(Z).draw(ne,G),ne}),U=>`.${U}-swatch > svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n overflow: visible;\n fill: ${C};\n fill-opacity: ${n};\n stroke: ${I};\n stroke-width: ${o}px;\n stroke-opacity: ${i};\n }`)}],["color",C5],["opacity",function Hte({type:e,interpolate:t,...n},{legend:r=!0,color:i=Nh(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(!0===r&&(r="ramp"),"ramp"!==`${r}`.toLowerCase())throw new Error(`${r} opacity legends are not supported`);return C5({type:e,...n,interpolate:Gte(i)},{legend:r,...o})}]]);function qS(e,{label:t,ticks:n,tickFormat:r}={},i){return function UQ(e={},...t){let n=e;for(const r of t)for(const i in r)if(void 0===n[i]){const o=r[i];n===e?n={...n,[i]:o}:n[i]=o}return n}(i,e,{label:t,ticks:n,tickFormat:r})}function C5(e,{legend:t=!0,...n}){if(!0===t&&(t="ordinal"===e.type?"swatches":"ramp"),void 0!==e.domain)switch(`${t}`.toLowerCase()){case"swatches":return function Vte(e,{opacity:t,...n}={}){if(!If(e)&&!p5(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return w5(e,n,(r,i)=>r.append("svg").attr("fill",i.scale).attr("fill-opacity",Ps(t)[1]).append("rect").attr("width","100%").attr("height","100%"),r=>`.${r}-swatch svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n }`)}(e,n);case"ramp":return function Bte(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:c=18,marginRight:d=0,marginBottom:p=16+r,marginLeft:v=0,style:C,ticks:D=(i-v-d)/64,tickFormat:I,fontVariant:P=b5(e),round:N=!0,opacity:G,className:U}=t;const Z=vx(t);U=NS(U),G=Ps(G)[1],null===I&&(I=()=>null);const ne=Go("svg",Z).attr("class",U).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(st=>st.append("style").text(`\n .${U} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n }\n .${U} text {\n white-space: pre;\n }\n `)).call(zS,C);let re,X=st=>st.selectAll(".tick line").attr("y1",c+p-o);const fe=N?(st,Fe)=>st.rangeRound(Fe):(st,Fe)=>st.range(Fe),{type:ve,domain:Re,range:We,interpolate:Ke,scale:lt,pivot:Ue}=e;if(Ke){const st=void 0===We?Ke:AD(1===Ke.length?kS(Ke):Ke,We);re=fe(lt.copy(),Sl(Uo(v,i-d),Math.min(Re.length+(void 0!==Ue),void 0===We?1/0:We.length)));const Fe=256,le=Z.document.createElement("canvas");le.width=Fe,le.height=1;const de=le.getContext("2d");for(let pe=0,Oe=Fe-1;pele:"string"==typeof I?hm(I):I;re=fe(BD().domain([-1,We.length-1]),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(We).enter().append("rect").attr("x",(le,de)=>re(de-1)).attr("y",c).attr("width",(le,de)=>re(de)-re(de-1)).attr("height",o-c-p).attr("fill",le=>le),D=Ho(st,(le,de)=>de),I=le=>Fe(st[le],le)}else re=fe(Nb().domain(Re),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(Re).enter().append("rect").attr("x",re).attr("y",c).attr("width",Math.max(0,re.bandwidth()-1)).attr("height",o-c-p).attr("fill",lt),X=()=>{};return ne.append("g").attr("transform",`translate(0,${o-p})`).call(function aq(e){return Z0(3,e)}(re).ticks(Array.isArray(D)?null:D,"string"==typeof I?I:void 0).tickFormat("function"==typeof I?I:void 0).tickSize(r).tickValues(Array.isArray(D)?D:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",us(P,"normal")).call(X).call(st=>st.select(".domain").remove()),void 0!==n&&ne.append("text").attr("x",v).attr("y",c-6).attr("fill","currentColor").attr("font-weight","bold").text(n),ne.node()}(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function Gte(e){const{r:t,g:n,b:r}=Nh(e)||Nh(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function ZS({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},c){if(void 0===r&&(null!=e&&(r=YS(e)),null!=t&&!Rm(t)&&(r=WS(r,JS(t))),n&&(r=WS(r,KS))),null!=c&&null!=i)throw new Error("transforms cannot be applied after initializers");return{...o,...(null===t||Rm(t))&&{sort:t},transform:WS(r,c)}}function Mx({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return void 0===r&&(null!=e&&(r=YS(e)),null!=t&&!Rm(t)&&(r=XS(r,JS(t))),n&&(r=XS(r,KS))),{...i,...(null===t||Rm(t))&&{sort:t},initializer:XS(r,o)}}function WS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r){return({data:n,facets:r}=e.call(this,n,r)),t.call(this,Mc(n),r)}}function XS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r,i,...o){let c,d,p,v,C,D;return({data:d=n,facets:p=r,channels:c}=e.call(this,n,r,i,...o)),({data:C=d,facets:D=p,channels:v}=t.call(this,d,p,{...i,...c},...o)),{data:C,facets:D,channels:{...c,...v}}}}function Ix(e,t){return(null!=e.initializer?Mx:ZS)(e,t)}function YS(e){return(t,n)=>{const r=Sc(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function KS(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function JS(e){return("function"==typeof e&&1!==e.length?Wte:E5)(e)}function Wte(e){return(t,n)=>{const r=(i,o)=>e(t[i],t[o]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function E5(e){let t,n;if(({channel:t,value:e,order:n=Im}={...gS(e)}),"function"!=typeof n)switch(`${n}`.toLowerCase()){case"ascending":n=Im;break;case"descending":n=_N;break;default:throw new Error(`invalid order: ${n}`)}return(r,i,o)=>{let c;if(void 0===t)c=Sc(r,e);else{if(void 0===o)throw new Error("channel sort requires an initializer");if(c=o[t],!c)return{};c=c.value}const d=(p,v)=>n(c[p],c[v]);return{data:r,facets:i.map(p=>p.slice().sort(d))}}}class kl{constructor(t,n={},r={},i){const{facet:o="auto",facetAnchor:c,fx:d,fy:p,sort:v,dx:C=0,dy:D=0,margin:I=0,marginTop:P=I,marginRight:N=I,marginBottom:G=I,marginLeft:U=I,clip:Z,channels:ne}=r;if(this.data=t,this.sort=Rm(v)?v:null,this.initializer=Mx(r).initializer,this.transform=this.initializer?r.transform:ZS(r).transform,null===o||!1===o?this.facet=null:(this.facet=Eu(!0===o?"include":o,"facet",["auto","include","exclude","super"]),this.fx=d,this.fy=p),this.facetAnchor=function Pte(e){if(null==e)return null;const t=kte.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}(c),n=TN(n),void 0!==ne&&(n={...TN(ne),...n}),void 0!==i&&(n={...dte(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([X,re])=>{const{value:fe}=re;return cx(fe)&&(re={...re,value:fe.value},void 0!==fe.scale&&(re.scale=fe.scale)),[X,re]}).filter(([X,{value:re,optional:fe}])=>{if(null!=re)return!0;if(fe)return!1;throw new Error(`missing channel value: ${X}`)})),this.dx=+C,this.dy=+D,this.marginTop=+P,this.marginRight=+N,this.marginBottom=+G,this.marginLeft=+U,this.clip=function xte(e){return!0===e?e="frame":!1===e&&(e=null),DN(e,"clip",["frame","sphere"])}(Z),"super"===this.facet){if(d||p)throw new Error("super-faceting cannot use fx or fy");for(const X in this.channels){const{scale:re}=n[X];if("x"===re||"y"===re)throw new Error("super-faceting cannot use x or y")}}}initialize(t,n){let r=Mc(this.data);void 0===t&&null!=r&&(t=[f_(r)]);const i=t;null!=this.transform&&(({facets:t,data:r}=this.transform(r,t)),r=Mc(r)),void 0!==t&&(t.original=i);const o=function oee(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,__(t,r,n)]))}(this.channels,r);return null!=this.sort&&function aee(e,t,n,r,i){const{reverse:o,reduce:c=!0,limit:d}=i;for(const p in i){if(!ni.has(p))continue;let{value:v,reverse:C=o,reduce:D=c,limit:I=d}=gS(i[p]);if(void 0===C&&(C="width"===v||"height"===v),null==D||!1===D)continue;const P="fx"===p||"fy"===p?cee(t,r[p]):lee(n,p);if(!P)throw new Error(`missing channel for scale: ${p}`);const N=P.value,[G=0,U=1/0]=$h(I)?I:I<0?[I]:[0,I];if(null==v)P.domain=()=>{let Z=Array.from(new wE(N));return C&&(Z=Z.reverse()),(0!==G||U!==1/0)&&(Z=Z.slice(G,U)),Z};else{const Z="data"===v?e:"height"===v?zN(n,"y1","y2"):"width"===v?zN(n,"x1","x2"):DS(n,v,"y"===v?"y2":"x"===v?"x2":void 0),ne=CS(!0===D?"max":D,Z);P.domain=()=>{let X=ky(f_(N),re=>ne.reduceIndex(re,Z),re=>N[re]);return X=z0(X,C?hee:uee),(0!==G||U!==1/0)&&(X=X.slice(G,U)),X.map(CN)}}}}(r,t,o,n,this.sort),{data:r,facets:t,channels:o}}filter(t,n,r){for(const i in n){const{filter:o=Ml}=n[i];if(null!==o){const c=r[i];t=t.filter(d=>o(c[d]))}}return t}project(t,n,r){_x("x","y",t,n,r),_x("x1","y1",t,n,r),_x("x2","y2",t,n,r)}scale(t,n,r){const i=function see(e,t){const n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:o}])=>{const c=null==i?null:t[i];return[r,null==c?o:Ho(o,c)]}));return n.channels=e,n}(t,n);return r.projection&&this.project(t,i,r),i}}function D5(...e){return e.plot=kl.prototype.plot,e}const S5=Math.PI/180;function M5({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=T5(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function I5({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=T5(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function T5(e,t,n){return void 0===e&&void 0===t&&void 0===n?ta?[1,0]:[.5,.5]:[t,n]}function A5(e,{interval:t}){return(e={...gS(e)}).interval=mS(void 0===e.interval?t:e.interval),e}function Tx(e,t,n,r){const{[e]:i,[`${e}1`]:o,[`${e}2`]:c}=n,{value:d,interval:p}=A5(i,n);if(null==d||null==p&&!r)return n;const v=p_(i);if(null==p){let P;const N={transform:G=>P||(P=Sc(G,d)),label:v};return{...n,[e]:void 0,[`${e}1`]:void 0===o?N:o,[`${e}2`]:void 0===c?N:c}}let C,D;function I(P){return void 0!==D&&P===C?D:D=Ho(Sc(C=P,d),N=>p.floor(N))}return t({...n,[e]:void 0,[`${e}1`]:void 0===o?{transform:I,label:v}:o,[`${e}2`]:void 0===c?{transform:P=>I(P).map(N=>p.offset(N)),label:v}:c})}function k5(e,t,n){const{[e]:r}=n,{value:i,interval:o}=A5(r,n);return null==i||null==o?n:t({...n,[e]:{label:p_(r),transform:c=>{const d=Ho(Sc(c,i),v=>o.floor(v)),p=d.map(v=>o.offset(v));return d.map(Tl(d)?(v,C)=>null==v||isNaN(v=+v)||null==(C=p[C])||isNaN(C=+C)?void 0:new Date((v+C)/2):(v,C)=>null==v||null==(C=p[C])?NaN:(+v+ +C)/2)}}})}const P5={ariaLabel:"rule",fill:null,stroke:"currentColor"};class Qte extends kl{constructor(t,n={}){const{x:r,y1:i,y2:o,inset:c=0,insetTop:d=c,insetBottom:p=c}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},n,P5),this.insetTop=fi(d),this.insetBottom=fi(p)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y1:v,y2:C}=r,{width:D,height:I,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetTop:Z,insetBottom:ne}=this;return Go("svg:g",o).call(jh,this,i).call(Gh,this,{x:p&&c},ta,0).call(X=>X.selectAll().data(t).enter().append("line").call(Hh,this).attr("x1",p?re=>p[re]:(G+D-N)/2).attr("x2",p?re=>p[re]:(G+D-N)/2).attr("y1",v&&!wx(d)?re=>v[re]+Z:P+Z).attr("y2",C&&!wx(d)?d.bandwidth?re=>C[re]+d.bandwidth()-ne:re=>C[re]-ne:I-U-ne).call(Lm,this,r)).node()}}class ene extends kl{constructor(t,n={}){const{x1:r,x2:i,y:o,inset:c=0,insetRight:d=c,insetLeft:p=c}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},n,P5),this.insetRight=fi(d),this.insetLeft=fi(p)}render(t,n,r,i,o){const{x:c,y:d}=n,{y:p,x1:v,x2:C}=r,{width:D,height:I,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetLeft:Z,insetRight:ne}=this;return Go("svg:g",o).call(jh,this,i,o).call(Gh,this,{y:p&&d},0,ta).call(X=>X.selectAll().data(t).enter().append("line").call(Hh,this).attr("x1",v&&!wx(c)?re=>v[re]+Z:G+Z).attr("x2",C&&!wx(c)?c.bandwidth?re=>C[re]+c.bandwidth()-ne:re=>C[re]-ne:D-N-ne).attr("y1",p?re=>p[re]:(P+I-U)/2).attr("y2",p?re=>p[re]:(P+I-U)/2).call(Lm,this,r)).node()}}function tne(e,t){let{x:n=Cu,y:r,y1:i,y2:o,...c}=function Yte(e={}){return Tx("y",I5,e)}(t);return[i,o]=R5(r,i,o),new Qte(e,{...c,x:n,y1:i,y2:o})}function nne(e,t){let{y:n=Cu,x:r,x1:i,x2:o,...c}=function Xte(e={}){return Tx("x",M5,e)}(t);return[i,o]=R5(r,i,o),new ene(e,{...c,y:n,x1:i,x2:o})}function R5(e,t,n){if(void 0===e){if(void 0===t){if(void 0!==n)return[0,n]}else if(void 0===n)return[0,t]}else{if(void 0===t)return void 0===n?[0,e]:[e,n];if(void 0===n)return[e,t]}return[t,n]}function QS(e,...t){let n=t.length;for(let r=0,i=!0;r{let i=e[0];for(let o=0;oSc(t,e,Float64Array),label:p_(e)}),optional:!0},text:{value:o,filter:cS,optional:!0}},n,rne),this.rotate=re,this.textAnchor=us(d,"middle"),this.lineAnchor=Eu(p,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+v,this.lineWidth=+C,this.textOverflow=function ine(e){return null==e?null:Eu(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}(D),this.monospace=!!I,this.fontFamily=Il(P),this.fontSize=ve,this.fontStyle=Il(G),this.fontVariant=Il(U),this.fontWeight=Il(Z),this.frameAnchor=_S(c),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${C}`);var e;this.splitLines=function pne({monospace:e,lineWidth:t,textOverflow:n}){if(null!=n||t==1/0)return o=>o.split(/\r\n?|\n/g);const r=e?z5:N5,i=100*t;return o=>function dne(e,t,n){const r=[];let i,o=0;for(const[c,d,p]of function*fne(e){let t=0,n=0;const r=e.length;for(;ni&&n(e,i,d)>t&&(r.push(e.slice(i,o)+("\xad"===e[o-1]?"-":"")),i=c),p?(r.push(e.slice(i,d)),i=void 0):o=d;return r}(o,i,r)}(this),this.clipLine=function mne({monospace:e,lineWidth:t,textOverflow:n}){if(null==n||t==1/0)return o=>o;const r=e?z5:N5,i=100*t;switch(n){case"clip-start":return o=>V5(o,i,r,"");case"clip-end":return o=>B5(o,i,r,"");case"ellipsis-start":return o=>V5(o,i,r,"\u2026");case"ellipsis-middle":return o=>function gne(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const o=n(r)/2,[c,d]=Ax(e,t/2,n,o),[p]=Ax(e,i-t/2-d+o,n,-o);return p<0?r:e.slice(0,c).trimEnd()+r+e.slice(Nm(e,p)).trimStart()}(o,i,r,"\u2026");case"ellipsis-end":return o=>B5(o,i,r,"\u2026")}}(this)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y:v,rotate:C,text:D,title:I,fontSize:P}=r,{rotate:N}=this,[G,U]=BS(this,i);return Go("svg:g",o).call(jh,this,i,o).call(lne,this,D,i).call(Gh,this,{x:p&&c,y:v&&d}).call(Z=>Z.selectAll().data(t).enter().append("text").call(Hh,this).call(one,this,D,I).attr("transform",QS`translate(${p?ne=>p[ne]:G},${v?ne=>v[ne]:U})${C?ne=>` rotate(${C[ne]})`:N?` rotate(${N})`:""}`).call(fn,"font-size",P&&(ne=>P[ne])).call(Lm,this,r)).node()}}function one(e,t,n,r){if(!n)return;const{lineAnchor:i,lineHeight:o,textOverflow:c,splitLines:d,clipLine:p}=t;e.each(function(v){const C=d(Ex(n[v])??"").map(p),D=C.length,I="top"===i?.71:"bottom"===i?1-D:(164-100*D)/200;if(D>1)for(let P=0;Pt){for(o+=r;o>t&&c>0;)d=c,c=i.pop(),o-=n(e,c,d);return[c,t-o]}o+=v,i.push(c)}return[-1,0]}function B5(e,t,n,r){e=e.trim();const i=n(r),[o]=Ax(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function V5(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const o=n(r),[c]=Ax(e,i-t+o,n,-o);return c<0?r:r+e.slice(Nm(e,c)).trimStart()}const t2=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,U5=/\p{Extended_Pictographic}/uy;function Nm(e,t){return t+=function yne(e,t){const n=e.charCodeAt(t);if(n>=55296&&n<56320){const r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}(e,t)?2:1,function vne(e,t){return!$5(e,t)&&(t2.lastIndex=t,t2.test(e))}(e,t)&&(t=t2.lastIndex),function _ne(e,t){return 8205===e.charCodeAt(t)}(e,t)?Nm(e,t+1):t}function $5(e,t){return e.charCodeAt(t)<128}function j5(e,t){return!$5(e,t)&&(U5.lastIndex=t,U5.test(e))}const H5={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},G5=3.5,bne=5*G5,q5={draw(e,t,n){const r=t*n/bne;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},xne=new Map([["arrow",q5],["spike",{draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}}]]);class n2 extends kl{constructor(t,n={}){const{x:r,y:i,r:o=G5,length:c,rotate:d,shape:p=q5,anchor:v="middle",frameAnchor:C}=n,[D,I]=Ps(c,12),[P,N]=Ps(d,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:D,scale:"length",optional:!0},rotate:{value:P,optional:!0}},n,H5),this.r=+o,this.length=I,this.rotate=N,this.shape=function Cne(e){if(function wne(e){return e&&"function"==typeof e.draw}(e))return e;const t=xne.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}(p),this.anchor=Eu(v,"anchor",["start","middle","end"]),this.frameAnchor=_S(C)}render(t,n,r,i,o){const{x:c,y:d}=n,{x:p,y:v,length:C,rotate:D}=r,{length:I,rotate:P,anchor:N,shape:G,r:U}=this,[Z,ne]=BS(this,i);return Go("svg:g",o).call(jh,this,i,o).call(Gh,this,{x:p&&c,y:v&&d}).call(X=>X.selectAll().data(t).enter().append("path").call(Hh,this).attr("transform",QS`translate(${p?re=>p[re]:Z},${v?re=>v[re]:ne})${D?re=>` rotate(${D[re]})`:P?` rotate(${P})`:""}${"start"===N?"":"end"===N?C?re=>` translate(0,${C[re]})`:` translate(0,${I})`:C?re=>` translate(0,${C[re]/2})`:` translate(0,${I/2})`}`).attr("d",C?re=>{const fe=xf();return G.draw(fe,C[re],U),fe}:(()=>{const re=xf();return G.draw(re,I,U),re})()).call(Lm,this,r)).node()}}function Dne(e,t={}){const{x:n=Cu,...r}=t;return new n2(e,{...r,x:n})}function Sne(e,t={}){const{y:n=Cu,...r}=t;return new n2(e,{...r,y:n})}function qh(e,t){return arguments.length<2&&!$h(e)&&(t=e,e=null),void 0===t&&(t={}),[e,t]}function kx({anchor:e}={},t){return void 0===e?t[0]:Eu(e,"anchor",t)}function W5(e){return kx(e,["left","right"])}function X5(e){return kx(e,["right","left"])}function Y5(e){return kx(e,["bottom","top"])}function K5(e){return kx(e,["top","bottom"])}function J5(){const[e,t]=qh(...arguments);return e4("y",W5(t),e,t)}function Mne(){const[e,t]=qh(...arguments);return e4("fy",X5(t),e,t)}function Q5(){const[e,t]=qh(...arguments);return t4("x",Y5(t),e,t)}function Ine(){const[e,t]=qh(...arguments);return t4("fx",K5(t),e,t)}function e4(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:C,textStroke:D,textStrokeOpacity:I,textStrokeWidth:P,tickSize:N=("y"===e?6:0),tickPadding:G,tickRotate:U,x:Z,marginTop:ne=20,marginRight:X=("right"===t?40:0),marginBottom:re=20,marginLeft:fe=("left"===t?40:0),label:ve,labelOffset:Re,labelAnchor:We,...Ke}){return N=fi(N),G=fi(G),U=fi(U),void 0!==We&&(We=Eu(We,"labelAnchor",["center","top","bottom"])),D5(N&&!ea(o)?function Tne(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:c=t+("y"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetLeft:C=v,insetRight:D=v,dx:I=0,y:P=("y"===e?void 0:null),...N}){return zm(Sne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:c,frameAnchor:d,y:P,...N,dx:"left"===t?+I-ta+ +C:+I+ta-D,anchor:"start",length:p,shape:"left"===t?Vne:Une})}(e,t,n,{stroke:o,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,x:Z,...Ke}):null,ea(p)?null:function kne(e,t,n,{facetAnchor:r=t+("y"===e?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:c=0,tickPadding:d=Math.max(3,9-o)+(Math.abs(c)>60?4*Math.cos(c*S5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:C=(Math.abs(c)>60?"middle":"left"===t?"end":"start"),lineAnchor:D=(c>60?"top":c<-60?"bottom":"middle"),fontVariant:I,inset:P=0,insetLeft:N=P,insetRight:G=P,dx:U=0,y:Z=("y"===e?void 0:null),...ne}){return zm(ane,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:C,lineAnchor:D,fontVariant:I,rotate:c,y:Z,...ne,dx:"left"===t?+U-o-d+ +N:+U+ +o+ +d-G},function(X,re,fe){void 0===I&&(this.fontVariant=s4(X)),void 0===v&&(fe.text=o4(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:I,strokeWidth:P,textAnchor:C,tickSize:N,tickPadding:G,tickRotate:U,x:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),ea(p)||null===ve?null:O5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="y"===e&&le.inset||le,et=We??(de.bandwidth?"center":"top"),_t=Re??("right"===t?Oe:Ze)-3;return"center"===et?(this.textAnchor=void 0,this.lineAnchor="right"===t?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor="right"===t?"end":"start",this.lineAnchor=et,this.frameAnchor=`${et}-${t}`,this.rotate=0),this.dy="top"===et?3-pe:"bottom"===et?Ye-3:0,this.dx="right"===t?_t:-_t,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?a4(e,de,et):ve]}}}}}))}function t4(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:C,textStroke:D,textStrokeOpacity:I,textStrokeWidth:P,tickSize:N=("x"===e?6:0),tickPadding:G,tickRotate:U,y:Z,marginTop:ne=("top"===t?30:0),marginRight:X=20,marginBottom:re=("bottom"===t?30:0),marginLeft:fe=20,label:ve,labelAnchor:Re,labelOffset:We,...Ke}){return N=fi(N),G=fi(G),U=fi(U),void 0!==Re&&(Re=Eu(Re,"labelAnchor",["center","left","right"])),D5(N&&!ea(o)?function Ane(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:c=t+("x"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetTop:C=v,insetBottom:D=v,dy:I=0,x:P=("x"===e?void 0:null),...N}){return zm(Dne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:c,frameAnchor:d,x:P,...N,dy:"bottom"===t?+I-ta-D:+I+ta+ +C,anchor:"start",length:p,shape:"bottom"===t?zne:Bne})}(e,t,n,{stroke:o,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,y:Z,...Ke}):null,ea(p)?null:function Pne(e,t,n,{facetAnchor:r=t+("x"===e?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:c=0,tickPadding:d=Math.max(3,9-o)+(Math.abs(c)>=10?4*Math.cos(c*S5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:C=(Math.abs(c)>=10?c<0^"bottom"===t?"start":"end":"middle"),lineAnchor:D=(Math.abs(c)>=10?"middle":"bottom"===t?"top":"bottom"),fontVariant:I,inset:P=0,insetTop:N=P,insetBottom:G=P,dy:U=0,x:Z=("x"===e?void 0:null),...ne}){return zm(sne,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:C,lineAnchor:D,fontVariant:I,rotate:c,x:Z,...ne,dy:"bottom"===t?+U+ +o+ +d-G:+U-o-d+ +N},function(X,re,fe){void 0===I&&(this.fontVariant=s4(X)),void 0===v&&(fe.text=o4(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:I,strokeWidth:P,textAnchor:C,tickSize:N,tickPadding:G,tickRotate:U,y:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),ea(p)||null===ve?null:O5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="x"===e&&le.inset||le,et=Re??(de.bandwidth?"center":"right"),_t=We??("top"===t?pe:Ye)-3;return"center"===et?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${et}`,this.textAnchor="right"===et?"end":"start"),this.lineAnchor=t,this.dy="top"===t?-_t:_t,this.dx="right"===et?Oe-3:"left"===et?3-Ze:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?a4(e,de,et):ve]}}}}}))}function Rne(){const[e,t]=qh(...arguments);return n4("y",W5(t),e,t)}function Fne(){const[e,t]=qh(...arguments);return n4("fy",X5(t),e,t)}function One(){const[e,t]=qh(...arguments);return r4("x",Y5(t),e,t)}function Lne(){const[e,t]=qh(...arguments);return r4("fx",K5(t),e,t)}function n4(e,t,n,{y:r=("y"===e?void 0:null),x:i=null,x1:o=("left"===t?i:null),x2:c=("right"===t?i:null),...d}){return zm(nne,e,`${e}-grid`,n,{y:r,x1:o,x2:c,...i4(d)})}function r4(e,t,n,{x:r=("x"===e?void 0:null),y:i=null,y1:o=("top"===t?i:null),y2:c=("bottom"===t?i:null),...d}){return zm(tne,e,`${e}-grid`,n,{x:r,y1:o,y2:c,...i4(d)})}function i4({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...o}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...o}}function zm(e,t,n,r,i,o){let c;const d=e(r,Mx(i,function(p,v,C,D){const{[t]:I}=D;if(!I)throw new Error(`missing scale: ${t}`);let{ticks:P,tickSpacing:N,interval:G}=i;if(f5(I)&&"string"==typeof P&&(G=P,P=void 0),null==p){if($h(P))p=Mc(P);else if(I.ticks)if(void 0!==P)p=I.ticks(P);else if(G=m_(void 0===G?I.interval:G,I.type),void 0!==G){const[U,Z]=em(I.domain());p=G.range(U,G.offset(G.floor(Z)))}else{const[U,Z]=em(I.range());P=(Z-U)/(void 0===N?"x"===t?80:35:N),p=I.ticks(P)}else p=I.domain();"y"===t||"x"===t?v=[f_(p)]:(c[t]={scale:t,value:Cu},v=void 0)}return o?.call(this,I,P,c),{data:p,facets:v,channels:Object.fromEntries(Object.entries(c).map(([U,Z])=>[U,{...Z,value:Sc(p,Z.value)}]))}}));return null==r?(c=d.channels,d.channels={}):c={},d.ariaLabel=n,d}function o4(e,t,n){return{value:Nne(e,t,n)}}function Nne(e,t,n){return e.tickFormat?e.tickFormat($h(t)?null:t,n):void 0===n?Ex:"string"==typeof n?(Tl(e.domain())?Hb:hm)(n):Tm(n)}const zne={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},Bne={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},Vne={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},Une={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function s4(e){return e.bandwidth&&void 0===e.interval?void 0:"tabular-nums"}function a4(e,t,n){const r=t.label;if(t.bandwidth||!r?.inferred)return r;const i=function $ne(e){return Math.sign(y_(e.domain()))*Math.sign(y_(e.range()))}(t);return i?"x"===e||"center"===n?"x"===e==i<0?`\u2190 ${r}`:`${r} \u2192`:`${i<0?"\u2191 ":"\u2193 "}${r}`:r}const jne={ariaLabel:"frame",fill:"none",stroke:"currentColor"},Hne={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square"};class Gne extends kl{constructor(t={}){const{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:o=r,insetBottom:c=r,insetLeft:d=r,rx:p,ry:v}=t;super(void 0,void 0,t,null==n?jne:Hne),this.anchor=DN(n,"anchor",["top","right","bottom","left"]),this.insetTop=fi(i),this.insetRight=fi(o),this.insetBottom=fi(c),this.insetLeft=fi(d),this.rx=fi(p),this.ry=fi(v)}render(t,n,r,i,o){const{marginTop:c,marginRight:d,marginBottom:p,marginLeft:v,width:C,height:D}=i,{anchor:I,insetTop:P,insetRight:N,insetBottom:G,insetLeft:U,rx:Z,ry:ne}=this,X=v+U,re=C-d-N,fe=c+P,ve=D-p-G;return Go(I?"svg:line":"svg:rect",o).call(jh,this,i,o).call(Hh,this).call(Gh,this,{}).call("left"===I?Re=>Re.attr("x1",X).attr("x2",X).attr("y1",fe).attr("y2",ve):"right"===I?Re=>Re.attr("x1",re).attr("x2",re).attr("y1",fe).attr("y2",ve):"top"===I?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",fe).attr("y2",fe):"bottom"===I?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",ve).attr("y2",ve):Re=>Re.attr("x",X).attr("y",fe).attr("width",re-X).attr("height",ve-fe).attr("rx",Z).attr("ry",ne)).node()}}function Px(e){return new Gne(e)}function Rx(e={}){const{facet:t,style:n,caption:r,ariaLabel:i,ariaDescription:o}=e,c=NS(e.className),d=void 0===e.marks?[]:l4(e.marks),p=function Yne(e,t){if(null==e)return;const{x:n,y:r}=e;if(null==n&&null==r)return;const i=Mc(e.data??n??r);if(void 0===i)throw new Error("missing facet data");const o={};null!=n&&(o.fx=__(i,{value:n,scale:"fx"})),null!=r&&(o.fy=__(i,{value:r,scale:"fy"})),r2(o,t);return{channels:o,groups:VS(i,o),data:e.data}}(t,e),v=new Map;for(const Fe of d){const le=u4(Fe,p,e);le&&v.set(Fe,le)}const C=new Map;p&&C_(C,[p]),C_(C,v);const D=l4(function Kne(e,t,n){let{projection:r,x:i={},y:o={},fx:c={},fy:d={},axis:p,grid:v,facet:C={},facet:{axis:D=p,grid:I}=C,x:{axis:P=p,grid:N=(null===P?null:v)}=i,y:{axis:G=p,grid:U=(null===G?null:v)}=o,fx:{axis:Z=D,grid:ne=(null===Z?null:I)}=c,fy:{axis:X=D,grid:re=(null===X?null:I)}=d}=n;(r||!Pm(i)&&!h4("x",e))&&(P=N=null),(r||!Pm(o)&&!h4("y",e))&&(G=U=null),t.has("fx")||(Z=ne=null),t.has("fy")||(X=re=null),void 0===P&&(P=!Lx(e,"x")),void 0===G&&(G=!Lx(e,"y")),void 0===Z&&(Z=!Lx(e,"fx")),void 0===X&&(X=!Lx(e,"fy")),!0===P&&(P="bottom"),!0===G&&(G="left"),!0===Z&&(Z="top"===P||null===P?"bottom":"top"),!0===X&&(X="right"===G||null===G?"left":"right");const fe=[];return Ox(fe,re,Fne,d),Fx(fe,X,Mne,"right","left",C,d),Ox(fe,ne,Lne,c),Fx(fe,Z,Ine,"top","bottom",C,c),Ox(fe,U,Rne,o),Fx(fe,G,J5,"left","right",n,o),Ox(fe,N,One,i),Fx(fe,P,Q5,"bottom","top",n,i),fe}(d,C,e));for(const Fe of D){const le=u4(Fe,p,e);le&&v.set(Fe,le)}d.unshift(...D);const I=function Mte(e,t){const{fx:n,fy:r}=PS(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?function jG(...e){const t="function"==typeof e[e.length-1]&&function $G(e){return t=>e(...t)}(e.pop()),n=(e=e.map(UG)).map(BG),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(VG))return o;for(;;){o.push(i.map((d,p)=>e[p][d]));let c=r;for(;++i[c]===n[c];){if(0===c)return t?o.map(t):o;i[c--]=0}}}(i,o).map(([c,d],p)=>({x:c,y:d,i:p})):i?i.map((c,d)=>({x:c,i:d})):o?o.map((c,d)=>({y:c,i:d})):void 0}(C,e);if(void 0!==I){const Fe=p?GS(I,p):void 0;for(const de of d){if(null===de.facet||"super"===de.facet)continue;const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=null!=de.fx||null!=de.fy?GS(I,pe):Fe)}const le=new Set;for(const{facetsIndex:de}of v.values())de?.forEach((pe,Oe)=>{pe?.length>0&&le.add(Oe)});I.forEach(0de.empty=!le.has(pe):de=>de.empty=!1);for(const de of d)if("exclude"===de.facet){const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=Ate(pe.facetsIndex))}}for(const Fe of ni.keys())Pm(e[Fe])&&"fx"!==Fe&&"fy"!==Fe&&C.set(Fe,[]);const P=new Map;for(const Fe of d){if(P.has(Fe))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:le,channels:de}=v.get(Fe)??{},{data:pe,facets:Oe,channels:Ye}=Fe.initialize(le,de);r2(Ye,e),P.set(Fe,{data:pe,facets:Oe,channels:Ye})}const N=PS(C_(C,P),e),G=o5(N),U=function Dte(e,t,n={}){let r=.5-ta,i=.5+ta,o=.5+ta,c=.5-ta;for(const{marginTop:G,marginRight:U,marginBottom:Z,marginLeft:ne}of t)G>r&&(r=G),U>i&&(i=U),Z>o&&(o=Z),ne>c&&(c=ne);let{margin:d,marginTop:p=(void 0!==d?d:r),marginRight:v=(void 0!==d?d:i),marginBottom:C=(void 0!==d?d:o),marginLeft:D=(void 0!==d?d:c)}=n;p=+p,v=+v,C=+C,D=+D;let{width:I=640,height:P=Ste(e,t,n,{width:I,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:c})+Math.max(0,p-r+C-o)}=n;I=+I,P=+P;const N={width:I,height:P,marginTop:p,marginRight:v,marginBottom:C,marginLeft:D};if(e.fx||e.fy){let{margin:G,marginTop:U=(void 0!==G?G:p),marginRight:Z=(void 0!==G?G:v),marginBottom:ne=(void 0!==G?G:C),marginLeft:X=(void 0!==G?G:D)}=n.facet??{};U=+U,Z=+Z,ne=+ne,X=+X,N.facet={marginTop:U,marginRight:Z,marginBottom:ne,marginLeft:X}}return N}(N,d,e);!function Kee(e,t){const{x:n,y:r,fx:i,fy:o}=e,c=i||o?RS(t):t;i&&a5(i,c),o&&l5(o,c);const d=i||o?s5(e,t):t;n&&a5(n,d),r&&l5(r,d)}(N,U);const{fx:Z,fy:ne}=G,X=Z||ne?s5(N,U):U,re=Z||ne?function ire({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:c,width:d,height:p}=RS(n),v=e&&d4(e),C=t&&d4(t);return{marginTop:t?C[0]:r,marginRight:e?d-v[1]:i,marginBottom:t?p-C[1]:o,marginLeft:e?v[0]:c,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:d,height:p}}(G,U):U,fe=vx(e,X),ve=new Set;for(const[Fe,le]of P)if(null!=Fe.initializer){const pe=Fe.initializer(le.data,le.facets,le.channels,G,"super"===Fe.facet?re:X,fe);if(void 0!==pe.data&&(le.data=pe.data),void 0!==pe.facets&&(le.facets=pe.facets),void 0!==pe.channels){Xne(pe.channels),Object.assign(le.channels,pe.channels);for(const Ze of Object.values(pe.channels)){const{scale:et}=Ze;null!=et&&ni.get(et)!==Ic&&(c4(Ze,e),ve.add(et))}const{fx:Oe,fy:Ye}=pe.channels;if(null!=Oe||null!=Ye){const Ze=v.get(Fe)??{channels:{}};null!=Oe&&(Ze.channels.fx=Oe),null!=Ye&&(Ze.channels.fy=Ye),Ze.groups=VS(le.data,Ze.channels),Ze.facetsIndex=le.facets=GS(I,Ze),v.set(Fe,Ze)}}}if(ve.size){const Fe=new Map;C_(Fe,P,pe=>ve.has(pe)),C_(C,P,pe=>ve.has(pe));const le=function rre(e,t){for(const n in e){const r=e[n],i=t[n];void 0===r.label&&i&&(r.label=i.label)}return e}(PS(Fe,e),N),de=o5(le);Object.assign(N,le),Object.assign(G,de)}for(const[Fe,le]of P)le.values=Fe.scale(le.channels,G,fe);const{width:Re,height:We}=U,Ke=Go("svg",fe).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",Re).attr("height",We).attr("viewBox",`0 0 ${Re} ${We}`).attr("aria-label",i).attr("aria-description",o).call(Fe=>Fe.append("style").text(`\n .${c} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n }\n .${c} text,\n .${c} tspan {\n white-space: pre;\n }\n `)).call(zS,n).node();if(void 0!==I){const Fe={x:Z?.domain(),y:ne?.domain()};I.sort(function Ite({x:e,y:t}){const n=e&&new Map(e.map((i,o)=>[i,o])),r=t&&new Map(t.map((i,o)=>[i,o]));return e&&t?(i,o)=>n.get(i.x)-n.get(o.x)||r.get(i.y)-r.get(o.y):e?(i,o)=>n.get(i.x)-n.get(o.x):(i,o)=>r.get(i.y)-r.get(o.y)}(Fe)),eS(Ke).selectAll().data(I).enter().append("g").attr("aria-label","facet").attr("transform",function Tte(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:o})=>`translate(${e(i)-r},${t(o)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}(Z,ne,U)).each(function(le){let de=!0;for(const pe of d){if("super"===pe.facet)continue;const{channels:Oe,values:Ye,facets:Ze}=P.get(pe);if(!(pe.facetAnchor?.(I,Fe,le)??!le.empty))continue;let et=null;if(Ze){if(et=Ze[v.has(pe)?le.i:0],et=pe.filter(et,Oe,Ye),0===et.length)continue;et.fi=le.i}const _t=pe.render(et,G,Ye,X,fe);null!=_t&&(de=!1,this.appendChild(_t))}de&&this.remove()})}for(const Fe of d){if(void 0!==I&&"super"!==Fe.facet)continue;const{channels:le,values:de,facets:pe}=P.get(Fe);let Oe=null;if(pe&&(Oe=pe[0],Oe=Fe.filter(Oe,le,de),0===Oe.length))continue;const Ye=Fe.render(Oe,G,de,re,fe);null!=Ye&&Ke.appendChild(Ye)}let lt=Ke;const Ue=function qte(e,t,n){const r=[];for(const[i,o]of Sx){const c=n[i];if(c?.legend&&i in e){const d=o(e[i],qS(t,e[i],c),p=>e[p]);null!=d&&r.push(d)}}return r}(N,fe,e);if(null!=r||Ue.length>0){const{document:Fe}=fe;lt=Fe.createElement("figure"),lt.style.maxWidth="initial";for(const le of Ue)lt.appendChild(le);if(lt.appendChild(Ke),null!=r){const le=Fe.createElement("figcaption");le.appendChild(r instanceof Node?r:Fe.createTextNode(r)),lt.appendChild(le)}}lt.scale=function rte(e){return t=>{if(!ni.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return t in e?function m5({scale:e,type:t,domain:n,range:r,interpolate:i,interval:o,transform:c,percent:d,pivot:p}){if("identity"===t)return{type:"identity",apply:C=>C,invert:C=>C};const v=e.unknown?e.unknown():void 0;return{type:t,domain:fS(n),...void 0!==r&&{range:fS(r)},...void 0!==c&&{transform:c},...d&&{percent:d},...void 0!==v&&{unknown:v},...void 0!==o&&{interval:o},...void 0!==i&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...void 0!==p&&{pivot:p,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:C=>e(C),...e.invert&&{invert:C=>e.invert(C)}}}(e[t]):void 0}}(N),lt.legend=function jte(e,t,n={}){return(r,i)=>{if(!Sx.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return Sx.get(r)(e[r],qS(t,n[r],i),o=>e[o])}}(N,fe,e);const st=function dee(){const e=SS;return SS=0,e}();return st>0&&eS(Ke).append("text").attr("x",Re).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26a0\ufe0f").append("title").text(`${st.toLocaleString("en-US")} warning${1===st?"":"s"}. Please check the console.`),lt}function l4(e){return e.flat(1/0).filter(t=>null!=t).map(Zne)}function Zne(e){return"function"==typeof e.render?e:new Wne(e)}kl.prototype.plot=function qne({marks:e=[],...t}={}){return Rx({...t,marks:[...e,this]})};class Wne extends kl{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function r2(e,t){for(const n in e)c4(e[n],t);return e}function c4(e,t){const{scale:n}=e;if(null==n)return;const{type:r,percent:i,interval:o,transform:c=(i?d=>100*d:mS(o,r)?.floor)}=t[n]??{};null!=c&&(e.value=Ho(e.value,c))}function Xne(e){for(const t in e)NN(t,e[t])}function C_(e,t,n=TQ){for(const{channels:r}of t.values())for(const i in r){const o=r[i],{scale:c}=o;if(null!=c&&n(c)){const d=e.get(c);void 0!==d?d.push(o):e.set(c,[o])}}return e}function u4(e,t,n){if(null===e.facet||"super"===e.facet)return;const{fx:r,fy:i}=e;if(null!=r||null!=i){const p=Mc(e.data??r??i);if(void 0===p)throw new Error(`missing facet data in ${e.ariaLabel}`);if(null===p)return;const v={};return null!=r&&(v.fx=__(p,{value:r,scale:"fx"})),null!=i&&(v.fy=__(p,{value:i,scale:"fy"})),r2(v,n),{channels:v,groups:VS(p,v)}}if(void 0===t)return;const{channels:o,groups:c,data:d}=t;if("auto"!==e.facet||e.data===d)return{channels:o,groups:c};(c.size>1||1===c.size&&o.fx&&o.fy&&[...c][0][1].size>1)&&Mc(e.data)?.length===d.length&&Mf(`Warning: the ${e.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function Fx(e,t,n,r,i,o,c){if(!t)return;const d=function Jne(e){return/^\s*both\s*$/i.test(e)}(t);c=function Qne(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:C,ariaDescription:D,label:I=t.label,labelAnchor:P,labelOffset:N}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:C,ariaDescription:D,label:I,labelAnchor:P,labelOffset:N}}(d?r:t,o,c);const{line:p}=c;(n===J5||n===Q5)&&p&&!g_(p)&&e.push(Px(function ere(e){const{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:!0===n?void 0:n}}(c))),e.push(n(c)),d&&e.push(n({...c,anchor:i,label:null}))}function Ox(e,t,n,r){!t||g_(t)||e.push(n(function tre(e,{stroke:t=(hx(e)?e:void 0),ticks:n=(nre(e)?e:void 0),tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}(t,r)))}function nre(e){switch(typeof e){case"number":return!0;case"string":return!hx(e)}return $h(e)||"function"==typeof e?.range}function Lx(e,t){const n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function h4(e,t){for(const n of t)for(const r in n.channels)if(n.channels[r].scale===e)return!0;return!1}function d4(e){const t=e.domain();let n=e(t[0]),r=e(t[t.length-1]);return rre.selectAll().data(t).enter().append(ne?"circle":"path").call(Hh,this).call(ne?fe=>{fe.attr("cx",p?ve=>p[ve]:U).attr("cy",v?ve=>v[ve]:Z).attr("r",C?ve=>C[ve]:P)}:fe=>{fe.attr("transform",QS`translate(${p?ve=>p[ve]:U},${v?ve=>v[ve]:Z})${D?ve=>` rotate(${D[ve]})`:N?` rotate(${N})`:""}`).attr("d",C&&I?ve=>{const Re=xf();return I[ve].draw(Re,C[ve]*C[ve]*Math.PI),Re}:C?ve=>{const Re=xf();return G.draw(Re,C[ve]*C[ve]*Math.PI),Re}:I?ve=>{const Re=xf();return I[ve].draw(Re,X),Re}:(()=>{const ve=xf();return G.draw(ve,X),ve})())}).call(Lm,this,r)).node()}}function Nx(e,t={}){let{x:n,y:r,...i}=t;return void 0===t.frameAnchor&&([n,r]=ux(n,r)),new o2(e,{...i,x:n,y:r})}const are=new Map([["basis",function ZJ(e){return new rx(e)}],["basis-closed",function WJ(e){return new nN(e)}],["basis-open",function XJ(e){return new rN(e)}],["bundle",QJ],["bump-x",function KJ(e){return new iN(e,!0)}],["bump-y",function JJ(e){return new iN(e,!1)}],["cardinal",eQ],["cardinal-closed",tQ],["cardinal-open",nQ],["catmull-rom",rQ],["catmull-rom-closed",iQ],["catmull-rom-open",oQ],["linear",Qb],["linear-closed",function sQ(e){return new cN(e)}],["monotone-x",function aQ(e){return new ox(e)}],["monotone-y",function lQ(e){return new fN(e)}],["natural",function cQ(e){return new mN(e)}],["step",function uQ(e){return new sx(e,.5)}],["step-after",function dQ(e){return new sx(e,1)}],["step-before",function hQ(e){return new sx(e,0)}]]);function zx(e){return Qb(e)}function s2(e){if(null==e||!1===e)return null;if(!0===e)return f4;if("function"==typeof e)return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return hre;case"dot":return dre;case"circle":case"circle-fill":return f4;case"circle-stroke":return fre}throw new Error(`invalid marker: ${e}`)}function hre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient","auto").attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(n=>n.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function dre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function f4(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","white").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function fre(e,t){return Go("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","white").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}let pre=0;function mre(e,t,{stroke:n},r){return function p4(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=(()=>i),c){const d=new Map;function p(v){return function(C){const D=o(C);let I=d.get(v);I||d.set(v,I=new Map);let P=I.get(D);if(!P){const N=this.parentNode.insertBefore(v(D,c),this),G="plot-marker-"+ ++pre;N.setAttribute("id",G),I.set(D,P=`url(#${G})`)}return P}}t&&e.attr("marker-start",p(t)),n&&e.attr("marker-mid",p(n)),r&&e.attr("marker-end",p(r))}(e,t,n&&(([i])=>n[i]),r)}const gre={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class a2 extends kl{constructor(t,n={}){const{x:r,y:i,z:o,curve:c,tension:d}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:SN(n),optional:!0}},n,gre),this.z=o,this.curve=function cre(e=zx,t){return"function"!=typeof e&&"auto"===`${e}`.toLowerCase()?zx:function lre(e=Qb,t){if("function"==typeof e)return e;const n=are.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(void 0!==t){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}(e,t)}(c,d),function ure(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=s2(n),e.markerMid=s2(r),e.markerEnd=s2(i)}(this,n)}filter(t){return t}project(t,n,r){this.curve!==zx&&super.project(t,n,r)}render(t,n,r,i,o){const{x:c,y:d}=r,{curve:p}=this;return Go("svg:g",o).call(jh,this,i,o).call(Gh,this,n).call(v=>v.selectAll().data(function*bte(e,t,{z:n},r){const{z:i}=r,o=function _te({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:c,opacity:d,href:p}){return[e,t,n,r,i,o,c,d,p].filter(v=>void 0!==v)}(r),c=[...t,...o];for(const d of i?function vte(e,t,n){const r=aR(e,i=>t[i]);return void 0===n&&r.size>e.length>>1&&Mf("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}(e,i,n):[e]){let p,v;e:for(const C of d){for(const D of c)if(!Ml(D[C])){v&&v.push(-1);continue e}if(void 0!==p){v.push(C);for(let D=0;DpS(P[C])),v=[C];continue e}}else v&&(yield v),p=o.map(D=>pS(D[C])),v=[C]}v&&(yield v)}}(t,[c,d],this,r)).enter().append("path").call(Hh,this).call(yte,this,r).call(mre,this,r,o).attr("d",p===zx&&o.projection?function yre(e,t,n){const r=hD(e);return t=lx(t),n=lx(n),i=>{let o=[];const c=[o];for(const d of i)-1===d?(o=[],c.push(o)):o.push([t[d],n[d]]);return r({type:"MultiLineString",coordinates:c})}}(o.projection,c,d):function NJ(e,t){var n=Dm(!0),r=null,i=Qb,o=null,c=function FJ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Ob(t)}(d);function d(p){var v,D,P,C=(p=function RJ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(p)).length,I=!1;for(null==r&&(o=i(P=c())),v=0;v<=C;++v)!(vC>=0).x(C=>c[C]).y(C=>d[C]))).node()}}function l2(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=ux(n,r),new a2(e,{...i,x:n,y:r})}function _re(e,t={}){return m4(Object.fromEntries(["y","y1","y2"].filter(n=>null!=t[n]).map(n=>[n,e])),t)}const m4=function vre(e={},t={}){const n=SN(t),r=Object.entries(e).map(([i,o])=>{const c=function PQ(e,t){if(void 0!==t[e])return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y"}return t[e]}(i,t);if(null==c)throw new Error(`missing channel: ${i}`);const[d,p]=function MN(e){let t;return[{transform:()=>t,label:p_(e)},n=>t=n]}(c);return{key:i,input:c,output:d,setOutput:p,map:bre(o)}});return{...ZS(t,(i,o)=>{const c=Sc(i,n),d=r.map(({input:v})=>Sc(i,v)),p=r.map(({setOutput:v})=>v(new Array(i.length)));for(const v of o)for(const C of c?aR(v,D=>c[D]).values():[v])r.forEach(({map:D},I)=>D.mapIndex(C,d[I],p[I]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}};function bre(e){if(null==e)throw new Error("missing map");if("function"==typeof e.mapIndex)return e;if("function"==typeof e.map&&km(e))return function xre(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}(e);if("function"==typeof e)return c2(e);switch(`${e}`.toLowerCase()){case"cumsum":return Cre;case"rank":return c2(pR);case"quantile":return c2(wre)}throw new Error(`invalid map: ${e}`)}function wre(e){const t=function zG(e,t){let n=0;if(void 0===t)for(let r of e)null!=r&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(i=+i)>=i&&++n}return n}(e)-1;return pR(e).map(n=>n/t)}function c2(e){return{mapIndex(t,n,r){const i=e(Fm(n,t));if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,c=t.length;o0))throw new Error(`invalid k: ${t}`);return function Sre(e="mean"){if("string"==typeof e){if(/^p\d{2}$/i.test(e))return Bx(EN(e));switch(e.toLowerCase()){case"deviation":return Bx(rR);case"max":return Vx(ls);case"mean":return Mre;case"median":return Bx(V0);case"min":return Vx(Fh);case"mode":return Vx(dR);case"sum":return y4;case"variance":return Bx(xE);case"difference":return Are;case"ratio":return kre;case"first":return Pre;case"last":return Rre}}if("function"!=typeof e)throw new Error(`invalid reduce: ${e}`);return Vx(e)}(n)(t,function Ere(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}(i,t),o)}function h2(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Bx(e){return(t,n,r)=>r?{mapIndex(i,o,c){const d=Float64Array.from(i,v=>null===o[v]?NaN:o[v]);let p=0;for(let v=0;vnull===o[p]?NaN:o[p]);for(let p=-n;p<0;++p)c[i[p+n]]=e(d.subarray(0,p+t));for(let p=0,v=i.length-n;pr?{mapIndex(i,o,c){let d=0;for(let p=0;p=n;--i){const o=e[t[i]];if(Ml(o))return o}}function _4(e,t,n,r){for(let i=n+r;n=n;--i){let o=e[t[i]];if(null!==o&&!isNaN(o=+o))return o}}function Are(e,t,n){return n?{mapIndex(r,i,o){for(let c=0,d=r.length-e;c{class e{constructor(n){this.samples=n,this.device={},this.cameraBearing=0,this.enableRotation=!1}ngOnInit(){}ngOnChanges(){this.flyToMarker(this.device,this.map)}ngAfterViewInit(){this.map||(this.map=new O0.Map({container:this.mapContainer.nativeElement,style:"https://pax.lab5e.com/map/styles/basic.json",center:[10.14,63.42],zoom:3,maxBounds:[[9.78,63.17],[10.97,63.56]]}),this.map.addControl(new O0.NavigationControl),this.map.addControl(new O0.AttributionControl({compact:!1,customAttribution:"Style \xa9 MapTiler | Data \xa9 OpenStreetMap contributors"})),this.samples.activeDevices().subscribe({complete:()=>{this.samples.addMapMarkers(this.map)}}),this.flyToMarker(this.device,this.map))}ngOnDestroy(){this.enableRotation=!1,this.map?.remove()}flyToMarker(n,r){if(!n||!r)return;if(!n.lat||0==n.lat||!n.lon||0==n.lon)return this.enableRotation=!1,this.cameraBearing=0,void this.map?.flyTo({center:[10.14,63.42],zoom:3,pitch:0,bearing:0,speed:2,curve:2,easing:o=>o,essential:!0});this.enableRotation&&(this.enableRotation=!1,this.cameraBearing=0),this.map?.flyTo({center:[n.lat,n.lon],zoom:16,pitch:45,bearing:0,speed:1,curve:1,easing:o=>o,essential:!0});let i=o=>{!this.enableRotation||(r.rotateTo(this.cameraBearing,{duration:0}),this.cameraBearing+=.25,this.cameraBearing>=360&&(this.cameraBearing=0),requestAnimationFrame(i))};this.map?.on("click",()=>{this.enableRotation=!1}),this.map?.once("moveend",()=>{this.enableRotation=!0,i(0)})}}return e.\u0275fac=function(n){return new(n||e)(qe(L0))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-map-view"]],viewQuery:function(n,r){if(1&n&&Hp(Fre,5),2&n){let i;Sh(i=Mh())&&(r.mapContainer=i.first)}},inputs:{device:"device"},features:[yt],decls:2,vars:0,consts:[[1,"map"],["map",""]],template:function(n,r){1&n&&is(0,"div",0,1)},styles:[".map[_ngcontent-%COMP%]{overflow:hidden;border-radius:1em;border:solid 1px silver;width:100%;height:100%}"]}),e})();const Ore=["chart"];let Lre=(()=>{class e{constructor(n,r,i){this.samples=n,this.renderer=r,this.cd=i,this.device={},this.metricDensity="",this.metricDensityPercent=0,this.metricSampleCount=0,this.metricWifi=0,this.metricBLE=0,this.data=[],this.errorMessage=""}ngOnInit(){}ngAfterViewInit(){this.loadData()}ngOnChanges(n){this.chartRef&&this.loadData()}loadData(){var n=[];this.samples.allData().subscribe({next:r=>{r.id==this.device.id&&n.push(r)},complete:()=>{this.data=n,this.showChart(),this.buildMetrics(),this.cd.detectChanges()}})}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=this.chartRef?.nativeElement.height,i=Fh(this.data,c=>c.time),o=ls(this.data,c=>c.time);this.chart=Rx({width:n,height:r,margin:50,inset:5,y:{grid:!0,label:"Antall"},x:{label:"Klokkeslett",grid:!0,tickFormat:Em("%H:%M"),domain:[i,o]},marks:[Nx(this.data,{x:c=>c.time,y:"ble",stroke:"blue",opacity:.2}),l2(this.data,u2({reduce:"mean",k:20,anchor:"middle"},{x:"time",y:"ble",stroke:"blue",strokeWidth:2,opacity:.8})),Nx(this.data,{x:"time",y:"wifi",stroke:"red",opacity:.3}),l2(this.data,u2({reduce:"mean",k:20,anchor:"middle"},{x:"time",y:"wifi",stroke:"red",strokeWidth:2,opacity:.9})),Px()],color:{legend:!1,domain:["wifi","ble"],range:["red","blue"]},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart)}buildMetrics(){let n=ls(this.data,p=>p.ble)||0,r=ls(this.data,p=>p.wifi)||0,i="Rolig",o=this.data.length-1,d=Math.round(100*(this.data[o].ble+this.data[o].wifi)/(n+r));d>=80&&(i="Sv\xe6rt h\xf8y"),d>=60&&d<80&&(i="H\xf8y"),d>=40&&d<60&&(i="Normal"),d>=25&&d<40&&(i="Lav"),d<25&&(i="Sv\xe6rt Lav"),this.metricBLE=n,this.metricWifi=r,this.metricSampleCount=this.data.length,this.metricDensity=i,this.metricDensityPercent=d}}return e.\u0275fac=function(n){return new(n||e)(qe(L0),qe(ul),qe(sy))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-view"]],viewQuery:function(n,r){if(1&n&&Hp(Ore,5),2&n){let i;Sh(i=Mh())&&(r.chartRef=i.first)}},inputs:{device:"device"},features:[yt],decls:31,vars:11,consts:[[1,"device-status-page"],[1,"data"],["id","chart",1,"chart"],["chart",""],[1,"device-info"],[1,"metric"],[1,"metric-value"],[1,"metric-desc"],[1,"location"],[3,"device"]],template:function(n,r){1&n&&(pr(0,"div",0)(1,"div",1)(2,"h2"),Ri(3),ir(),is(4,"div",2,3),Ri(6),Pw(7,"date"),ir(),pr(8,"div",4)(9,"div",5)(10,"div",6),Ri(11),ir(),pr(12,"div",7),Ri(13,"Maks antall bluetooth-enheter"),ir()(),pr(14,"div",5)(15,"div",6),Ri(16),ir(),pr(17,"div",7),Ri(18,"Maks antall WiFi-enheter"),ir()(),pr(19,"div",5)(20,"div",6),Ri(21),ir(),pr(22,"div",7),Ri(23,"M\xe5linger i perioden"),ir()(),pr(24,"div",5)(25,"div",6),Ri(26),ir(),pr(27,"div",7),Ri(28),ir()()(),pr(29,"div",8),is(30,"app-device-map-view",9),ir()()),2&n&&(Qi(3),nf(r.device.name),Qi(3),Dh(" Sist oppdatert ",Rw(7,8,r.samples.lastDataUpdate,"YYYY-MM-dd HH:mm")," "),Qi(5),nf(r.metricBLE),Qi(5),nf(r.metricWifi),Qi(5),nf(r.metricSampleCount),Qi(5),nf(r.metricDensity),Qi(2),Dh("Folketetthet (",r.metricDensityPercent,"% av maks)"),Qi(2),fl("device",r.device))},dependencies:[b4,wC],styles:[".device-status-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);grid-row-gap:10px;grid-column-gap:10px;height:100%}.device-info[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:1fr 1fr;grid-column-gap:1em;grid-row-gap:1em}.metric[_ngcontent-%COMP%]{background-color:#2696f9;color:#fff;border-radius:1em;display:grid;grid-template-columns:1fr;grid-template-rows:3fr 1fr}.metric-value[_ngcontent-%COMP%]{font-size:6vh;text-align:center;margin-top:auto;margin-bottom:auto}.metric-desc[_ngcontent-%COMP%]{font-size:1vw;text-align:center}.location[_ngcontent-%COMP%]{background-color:#ddd;border-radius:1em}.data[_ngcontent-%COMP%]{grid-column:span 2;vertical-align:middle}.chart[_ngcontent-%COMP%]{padding:1em;width:80vw}"]}),e})();class Nre extends kl{constructor(t,n,r={},i){super(t,n,r,i);const{inset:o=0,insetTop:c=o,insetRight:d=o,insetBottom:p=o,insetLeft:v=o,rx:C,ry:D}=r;this.insetTop=fi(c),this.insetRight=fi(d),this.insetBottom=fi(p),this.insetLeft=fi(v),this.rx=us(C,"auto"),this.ry=us(D,"auto")}render(t,n,r,i,o){const{rx:c,ry:d}=this;return Go("svg:g",o).call(jh,this,i,o).call(this._transform,this,n).call(p=>p.selectAll().data(t).enter().append("rect").call(Hh,this).attr("x",this._x(n,r,i)).attr("width",this._width(n,r,i)).attr("y",this._y(n,r,i)).attr("height",this._height(n,r,i)).call(fn,"rx",c).call(fn,"ry",d).call(Lm,this,r)).node()}_x(t,{x:n},{marginLeft:r}){const{insetLeft:i}=this;return n?o=>n[o]+i:r+i}_y(t,{y:n},{marginTop:r}){const{insetTop:i}=this;return n?o=>n[o]+i:r+i}_width({x:t},{x:n},{marginRight:r,marginLeft:i,width:o}){const{insetLeft:c,insetRight:d}=this,p=n&&t?t.bandwidth():o-r-i;return Math.max(0,p-c-d)}_height({y:t},{y:n},{marginTop:r,marginBottom:i,height:o}){const{insetTop:c,insetBottom:d}=this,p=n&&t?t.bandwidth():o-r-i;return Math.max(0,p-c-d)}}const Vre={ariaLabel:"cell"};class d2 extends Nre{constructor(t,{x:n,y:r,...i}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,Vre)}_transform(t,n){t.call(Gh,n,{},0,0)}}function Ure(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=ux(n,r),new d2(e,{...i,x:n,y:r})}const $re=["chart"],jre=["legend"],Hre=["allchart"];let Gre=(()=>{class e{constructor(n,r){this.samples=n,this.renderer=r,this.data=[]}ngOnInit(){}ngAfterViewInit(){this.samples.allData().subscribe({next:n=>{this.data.push(n)},complete:()=>{this.showChart()}})}ngOnDestroy(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1),this.allChart&&this.renderer.removeChild(this.allChartRef?.nativeElement,this.allChart,!1),this.legend&&this.renderer.removeChild(this.legendRef?.nativeElement,this.legend,!1)}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1),this.allChart&&this.renderer.removeChild(this.allChartRef?.nativeElement,this.allChart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=ls(this.data,C=>C.ble+C.wifi)||1;const i=Em("%m-%d %H:00");this.chart=Rx({width:n,marginLeft:250,marginBottom:100,x:{label:"Tid",tickRotate:-90},y:{label:"Enhet"},marks:[Ure(this.data,{x:C=>i(C.time),y:"name",fill:C=>C.ble+C.wifi}),Px()],color:{legend:!1,scheme:"gnbu",reverse:!1,type:"linear"},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart),this.legend||(this.legend=function $te(e={}){for(const[t,n]of Sx){const r=e[t];if(Pm(r)){const i=vx(e);let o;if("symbol"===t){const{fill:c,stroke:d=(void 0===c&&Pm(e.color)?"color":void 0)}=e;o={fill:c,stroke:d}}return n(FS(t,r,o),qS(i,r,e),c=>Pm(e[c])?FS(c,e[c]):null)}}throw new Error("unknown legend type; no scale found")}({color:{domain:[0,r],ticks:3,scheme:"gnbu",reverse:!1,type:"linear"},width:350,ticks:5,label:"Antall enheter",style:{background:"#eeeeee"}}),this.renderer.appendChild(this.legendRef?.nativeElement,this.legend)),Em("%d %H:00");let c=this.getFlattenedSamples(),d=Fh(this.data,C=>C.time),p=ls(this.data,C=>C.time),v=this.allChartRef?.nativeElement.offsetWidth;this.allChart=Rx({width:v,margin:50,inset:5,y:{grid:!0,label:"Antall"},x:{label:"Klokkeslett",grid:!0,tickFormat:Em("%H:%M"),domain:[d,p]},marks:[l2(c,u2({reduce:"sum",k:180,anchor:"middle"},{x:"time",y:"count",stroke:"type",strokeWidth:2,opacity:.8})),Px()],color:{legend:!1,domain:["wifi","ble"],range:["red","blue"]},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080"}}),this.renderer.appendChild(this.allChartRef?.nativeElement,this.allChart)}getFlattenedSamples(){return z0(this.data.map(r=>({id:r.id,name:r.name,time:r.time,count:r.ble,type:"ble"})).concat(this.data.map(r=>({id:r.id,name:r.name,time:r.time,count:r.wifi,type:"wifi"}))),(r,i)=>r.time.getTime()-i.time.getTime())}}return e.\u0275fac=function(n){return new(n||e)(qe(L0),qe(ul))},e.\u0275cmp=Vs({type:e,selectors:[["app-device-overview"]],viewQuery:function(n,r){if(1&n&&(Hp($re,5),Hp(jre,5),Hp(Hre,5)),2&n){let i;Sh(i=Mh())&&(r.chartRef=i.first),Sh(i=Mh())&&(r.legendRef=i.first),Sh(i=Mh())&&(r.allChartRef=i.first)}},decls:19,vars:4,consts:[[1,"overview-page"],[1,"main-chart"],[1,"all-chart"],["id","allchart",1,"allchart"],["allchart",""],[1,"update"],[1,"cell-chart"],["id","chart",1,"chart"],["chart",""],["id","legend",1,"legend"],["legend",""],[1,"allmap"]],template:function(n,r){1&n&&(pr(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),Ri(4,"Totalt for alle enheter"),ir(),is(5,"div",3,4),pr(7,"div",5),Ri(8),Pw(9,"date"),ir()()(),pr(10,"div",6)(11,"h2"),Ri(12,"Per enhet"),ir(),is(13,"div",7,8)(15,"div",9,10),ir(),pr(17,"div",11),is(18,"app-device-map-view"),ir()()),2&n&&(Qi(8),Dh("Sist oppdatert ",Rw(9,1,r.samples.lastDataUpdate,"YYYY-MM-dd HH:mm"),""))},dependencies:[b4,wC],styles:[".overview-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;grid-row-gap:10px;grid-column-gap:10px;height:100%}.main-chart[_ngcontent-%COMP%]{grid-column:span 2;padding:1em}.cell-chart[_ngcontent-%COMP%]{padding:1em;border:solid 1px silver;border-radius:1em;display:flex;flex-direction:column}.cell-chart[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{margin-top:2em;margin-right:0;margin-left:auto}.chart[_ngcontent-%COMP%]{width:100%}"]}),e})();function qre(e,t){if(1&e){const n=Sv();ht(),pr(0,"svg",16),Co("click",function(){return ma(n),Gs(Vp().autoPlay(!1))}),is(1,"path",17),ir()}}function Zre(e,t){if(1&e){const n=Sv();ht(),pr(0,"svg",16),Co("click",function(){return ma(n),Gs(Vp().autoPlay(!0))}),is(1,"path",18),ir()}}const w4=function(e){return{active:e}};function Wre(e,t){if(1&e){const n=Sv();pr(0,"div",9),Co("click",function(){const o=ma(n).$implicit;return Gs(Vp().setActiveDevice(o))}),pr(1,"div",10),Ri(2),ir(),pr(3,"div",11),Ri(4),ir()()}if(2&e){const n=t.$implicit,r=Vp();fl("ngClass",kw(3,w4,r.activeDevice==n)),Qi(2),Dh(" ",n.name," "),Qi(2),Dh(" Id: ",n.id," ")}}function Xre(e,t){1&e&&is(0,"app-device-overview")}function Yre(e,t){1&e&&is(0,"app-device-view",19),2&e&&fl("device",Vp().activeDevice)}let Kre=(()=>{class e{constructor(n){this.samples=n,this.activeDevices=[],this.autoPlayEnabled=!1,this.activeStep=0;let r=[];this.samples.activeDevices().subscribe({next:i=>{r.push(i)},complete:()=>{this.activeDevices=r}})}ngOnInit(){}setActiveDevice(n){this.activeDevice=n}autoPlay(n){if(!n)return this.autoPlayEnabled=!1,void this.autoPlayer?.unsubscribe();this.activeStep=-1,this.activeDevice=void 0,this.autoPlayEnabled=!0,this.autoPlayer=function NG(e=0,t=nR){return e<0&&(e=0),function LG(e=0,t,n=FG){let r=-1;return null!=t&&(nn(t)?n=t:r=t),new Nn(i=>{let o=function OG(e){return e instanceof Date&&!isNaN(e)}(e)?+e-n.now():e;o<0&&(o=0);let c=0;return n.schedule(function(){i.closed||(i.next(c++),0<=r?this.schedule(void 0,r):i.complete())},o)})}(e,e,t)}(15e3).subscribe(r=>this.autoStep())}autoStep(){if(this.autoPlayEnabled){if(this.activeStep++,this.activeStep>=this.activeDevices.length&&(this.activeStep=-1),-1==this.activeStep)return void(this.activeDevice=void 0);this.activeDevice=this.activeDevices[this.activeStep]}}}return e.\u0275fac=function(n){return new(n||e)(qe(L0))},e.\u0275cmp=Vs({type:e,selectors:[["app-main-page"]],decls:20,vars:8,consts:[[1,"page"],[1,"heading"],[1,"logo"],["src","/assets/trondheim_kommune.png"],[1,"title"],[1,"autoplay"],["fill","white","class","start-stop","height","32px","width","32px","version","1.1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 512 512",0,"xml","space","preserve",3,"click",4,"ngIf"],[1,"content"],[1,"list"],[1,"list-item",3,"ngClass","click"],[1,"item-title"],[1,"item-subtitle"],["class","list-item",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"detail"],[4,"ngIf"],[3,"device",4,"ngIf"],["fill","white","height","32px","width","32px","version","1.1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","viewBox","0 0 512 512",0,"xml","space","preserve",1,"start-stop",3,"click"],["d","M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M336,320\n\tc0,8.837-7.163,16-16,16H192c-8.837,0-16-7.163-16-16V192c0-8.837,7.163-16,16-16h128c8.837,0,16,7.163,16,16V320z"],["d","M256,0C114.617,0,0,114.615,0,256s114.617,256,256,256s256-114.615,256-256S397.383,0,256,0z M344.48,269.57l-128,80\n c-2.59,1.617-5.535,2.43-8.48,2.43c-2.668,0-5.34-0.664-7.758-2.008C195.156,347.172,192,341.82,192,336V176\n c0-5.82,3.156-11.172,8.242-13.992c5.086-2.836,11.305-2.664,16.238,0.422l128,80c4.676,2.93,7.52,8.055,7.52,13.57\n S349.156,266.641,344.48,269.57z"],[3,"device"]],template:function(n,r){1&n&&(pr(0,"div",0)(1,"div",1)(2,"span",2),is(3,"img",3),ir(),pr(4,"span",4),Ri(5," PAX - Persontelling "),ir(),pr(6,"span",5),Bp(7,qre,2,0,"svg",6),Bp(8,Zre,2,0,"svg",6),ir()(),pr(9,"div",7)(10,"div",8)(11,"div",9),Co("click",function(){return r.setActiveDevice()}),pr(12,"div",10),Ri(13," Alle "),ir(),pr(14,"div",11),Ri(15," Vis aggregerte data for alle tellere "),ir()(),Bp(16,Wre,5,5,"div",12),ir(),pr(17,"div",13),Bp(18,Xre,1,0,"app-device-overview",14),Bp(19,Yre,1,1,"app-device-view",15),ir()()()),2&n&&(Qi(7),fl("ngIf",r.autoPlayEnabled),Qi(1),fl("ngIf",!r.autoPlayEnabled),Qi(3),fl("ngClass",kw(6,w4,null==r.activeDevice)),Qi(5),fl("ngForOf",r.activeDevices),Qi(2),fl("ngIf",null==r.activeDevice),Qi(1),fl("ngIf",null!=r.activeDevice))},dependencies:[GA,WA,YA,Lre,Gre],styles:[".page[_ngcontent-%COMP%]{margin:0;padding:0;width:100vw;height:100vh;background-color:#eee;display:flex;flex-direction:column}.heading[_ngcontent-%COMP%]{color:#fff;background-color:#009bdf;display:flex;flex-direction:row;align-items:center;justify-content:center;height:5em}.logo[_ngcontent-%COMP%]{min-width:250px}.start-stop[_ngcontent-%COMP%]{cursor:pointer}.heading[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:24pt}.content[_ngcontent-%COMP%]{height:calc(100vh - 5em);background-color:gray;display:flex;flex-direction:row}.list[_ngcontent-%COMP%]{direction:rtl;width:20em;min-height:100%;background-color:#ddd;display:flex;flex-direction:column;overflow-y:auto}.list-item[_ngcontent-%COMP%]{direction:ltr;width:100%;height:6em!important}.list-item[_ngcontent-%COMP%]:not(.active){border-bottom:solid 1px #cccccc}.list-item[_ngcontent-%COMP%]:hover:not(.active){background-color:#80add3;cursor:pointer}.active[_ngcontent-%COMP%]{background-color:#eee;color:#000;box-shadow:10px 5px 5px silver}.item-title[_ngcontent-%COMP%]{font-size:14pt;margin-top:1em;margin-left:1em}.item-subtitle[_ngcontent-%COMP%]{font-size:10pt;color:gray;margin-top:.5em;margin-left:2em;margin-bottom:1em;font-weight:light}.detail[_ngcontent-%COMP%]{background-color:#eee;flex:auto 1;padding:1em}.autoplay[_ngcontent-%COMP%]{margin-right:1em;margin-left:auto}"]}),e})(),Jre=(()=>{class e{constructor(n){this.paxService=n,this.title="PAX",this.paxService.configuration.basePath="https://pax.lab5e.com"}}return e.\u0275fac=function(n){return new(n||e)(qe(vE))},e.\u0275cmp=Vs({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(n,r){1&n&&is(0,"app-main-page")},dependencies:[Kre]}),e})(),d6=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({}),e})();const M2=new It("NgModelWithFormControlWarning");let T6=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[d6]}),e})(),Jie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[T6]}),e})(),Qie=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:M2,useValue:n.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[T6]}),e})(),ooe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e}),e.\u0275inj=Ei({imports:[ek]}),e})(),soe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=ai({type:e,bootstrap:[Jre]}),e.\u0275inj=Ei({imports:[I9,mG,Jie,Qie,IG,ooe]}),e})();(function GU(){vA=!1})(),M9().bootstrapModule(soe).catch(e=>console.error(e))},943:function(Vm){Vm.exports=function(){"use strict";var Au,ku,sr;function Kh(b,vr){if(Au)if(ku){var Rs="var sharedChunk = {}; ("+Au+")(sharedChunk); ("+ku+")(sharedChunk);",ds={};Au(ds),sr=vr(ds),typeof window<"u"&&(sr.workerUrl=window.URL.createObjectURL(new Blob([Rs],{type:"text/javascript"})))}else ku=vr;else Au=vr}return Kh(0,function(b){var vr=Rs;function Rs(l,s,u,f){this.cx=3*l,this.bx=3*(u-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(f-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=s,this.p2x=u,this.p2y=f}function ds(l,s,u,f){const _=new vr(l,s,u,f);return function(x){return _.solve(x)}}Rs.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,s){if(void 0===s&&(s=1e-6),l<0)return 0;if(l>1)return 1;for(var u=l,f=0;f<8;f++){var _=this.sampleCurveX(u)-l;if(Math.abs(_)_?E=u:M=u,u=.5*(M-E)+E;return u},solve:function(l,s){return this.sampleCurveY(this.solveCurveX(l,s))}};const Pl=ds(.25,.1,.25,1);function Zt(l,s,u){return Math.min(u,Math.max(s,l))}function Te(l,s,u){const f=u-s,_=((l-s)%f+f)%f+s;return _===s?u:_}function zi(l,...s){for(const u of s)for(const f in u)l[f]=u[f];return l}let Fs=1;function Os(l,s){l.forEach(u=>{s[u]&&(s[u]=s[u].bind(s))})}function Ra(l,s,u){const f={};for(const _ in l)f[_]=s.call(u||this,l[_],_,l);return f}function Rl(l,s,u){const f={};for(const _ in l)s.call(u||this,l[_],_,l)&&(f[_]=l[_]);return f}function wi(l){return Array.isArray(l)?l.map(wi):"object"==typeof l&&l?Ra(l,wi):l}const io={};function pn(l){io[l]||(typeof console<"u"&&console.warn(l),io[l]=!0)}function ii(l,s,u){return(u.y-l.y)*(s.x-l.x)>(s.y-l.y)*(u.x-l.x)}function kc(l){let s=0;for(let u,f,_=0,x=l.length,E=x-1;_cancelAnimationFrame(s)}},getImageData(l,s=0){return this.getImageCanvasContext(l).getImageData(-s,-s,l.width+2*s,l.height+2*s)},getImageCanvasContext(l){const s=window.document.createElement("canvas"),u=s.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return s.width=l.width,s.height=l.height,u.drawImage(l,0,0,l.width,l.height),u},resolveURL:l=>(fs||(fs=document.createElement("a")),fs.href=l,fs.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==Hn&&(Hn=matchMedia("(prefers-reduced-motion: reduce)")),Hn.matches)}};var Tt=qr;function qr(l,s){this.x=l,this.y=s}qr.prototype={clone:function(){return new qr(this.x,this.y)},add:function(l){return this.clone()._add(l)},sub:function(l){return this.clone()._sub(l)},multByPoint:function(l){return this.clone()._multByPoint(l)},divByPoint:function(l){return this.clone()._divByPoint(l)},mult:function(l){return this.clone()._mult(l)},div:function(l){return this.clone()._div(l)},rotate:function(l){return this.clone()._rotate(l)},rotateAround:function(l,s){return this.clone()._rotateAround(l,s)},matMult:function(l){return this.clone()._matMult(l)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(l){return this.x===l.x&&this.y===l.y},dist:function(l){return Math.sqrt(this.distSqr(l))},distSqr:function(l){var s=l.x-this.x,u=l.y-this.y;return s*s+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith:function(l){return this.angleWithSep(l.x,l.y)},angleWithSep:function(l,s){return Math.atan2(this.x*s-this.y*l,this.x*l+this.y*s)},_matMult:function(l){var s=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=s,this},_add:function(l){return this.x+=l.x,this.y+=l.y,this},_sub:function(l){return this.x-=l.x,this.y-=l.y,this},_mult:function(l){return this.x*=l,this.y*=l,this},_div:function(l){return this.x/=l,this.y/=l,this},_multByPoint:function(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint:function(l){return this.x/=l.x,this.y/=l.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var l=this.y;return this.y=this.x,this.x=-l,this},_rotate:function(l){var s=Math.cos(l),u=Math.sin(l),f=u*this.x+s*this.y;return this.x=s*this.x-u*this.y,this.y=f,this},_rotateAround:function(l,s){var u=Math.cos(l),f=Math.sin(l),_=s.y+f*(this.x-s.x)+u*(this.y-s.y);return this.x=s.x+u*(this.x-s.x)-f*(this.y-s.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},qr.convert=function(l){return l instanceof qr?l:Array.isArray(l)?new qr(l[0],l[1]):l};const Oa={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,REGISTERED_PROTOCOLS:{}};class Ns extends Error{constructor(s,u,f,_){super(`AJAXError: ${u} (${s}): ${f}`),this.status=s,this.statusText=u,this.url=f,this.body=_}}const Nn=Mo()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function Pc(l,s){const u=new AbortController,f=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,referrer:Nn(),signal:u.signal});let _=!1,x=!1;return"json"===l.type&&f.headers.set("Accept","application/json"),x||fetch(f).then(E=>{return E.ok?(M=E,void("arrayBuffer"===l.type?M.arrayBuffer():"json"===l.type?M.json():M.text()).then(A=>{x||(_=!0,s(null,A,M.headers.get("Cache-Control"),M.headers.get("Expires")))}).catch(A=>{x||s(new Error(A.message))})):E.blob().then(M=>s(new Ns(E.status,E.statusText,l.url,M)));var M}).catch(E=>{20!==E.code&&s(new Error(E.message))}),{cancel:()=>{x=!0,_||u.abort()}}}const Fl=function(l,s){if(/:\/\//.test(l.url)&&!/^https?:|^file:/.test(l.url)){if(Mo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,s);if(!Mo()){const f=l.url.substring(0,l.url.indexOf("://"));return(Oa.REGISTERED_PROTOCOLS[f]||Pc)(l,s)}}if(!(/^file:/.test(u=l.url)||/^file:/.test(Nn())&&!/^\w+:/.test(u))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Pc(l,s);if(Mo()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,s,void 0,!0)}var u;return function(f,_){const x=new XMLHttpRequest;x.open(f.method||"GET",f.url,!0),"arrayBuffer"===f.type&&(x.responseType="arraybuffer");for(const E in f.headers)x.setRequestHeader(E,f.headers[E]);return"json"===f.type&&(x.responseType="text",x.setRequestHeader("Accept","application/json")),x.withCredentials="include"===f.credentials,x.onerror=()=>{_(new Error(x.statusText))},x.onload=()=>{if((x.status>=200&&x.status<300||0===x.status)&&null!==x.response){let E=x.response;if("json"===f.type)try{E=JSON.parse(x.response)}catch(M){return _(M)}_(null,E,x.getResponseHeader("Cache-Control"),x.getResponseHeader("Expires"))}else{const E=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});_(new Ns(x.status,x.statusText,f.url,E))}},x.send(f.body),{cancel:()=>x.abort()}}(l,s)},La=function(l,s){return Fl(zi(l,{type:"arrayBuffer"}),s)};function Rc(l){const s=window.document.createElement("a");return s.href=l,s.protocol===window.document.location.protocol&&s.host===window.document.location.host}function oi(l,s,u){u[l]&&-1!==u[l].indexOf(s)||(u[l]=u[l]||[],u[l].push(s))}function Na(l,s,u){if(u&&u[l]){const f=u[l].indexOf(s);-1!==f&&u[l].splice(f,1)}}class ra{constructor(s,u={}){zi(this,u),this.type=s}}class yr extends ra{constructor(s,u={}){super("error",zi({error:s},u))}}class Qn{on(s,u){return this._listeners=this._listeners||{},oi(s,u,this._listeners),this}off(s,u){return Na(s,u,this._listeners),Na(s,u,this._oneTimeListeners),this}once(s,u){return u?(this._oneTimeListeners=this._oneTimeListeners||{},oi(s,u,this._oneTimeListeners),this):new Promise(f=>this.once(s,f))}fire(s,u){"string"==typeof s&&(s=new ra(s,u||{}));const f=s.type;if(this.listens(f)){s.target=this;const _=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const M of _)M.call(this,s);const x=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const M of x)Na(f,M,this._oneTimeListeners),M.call(this,s);const E=this._eventedParent;E&&(zi(s,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),E.fire(s))}else s instanceof yr&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,u){return this._eventedParent=s,this._eventedParentData=u,this}}var Ae={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Pe{constructor(s,u,f,_){this.message=(s?`${s}: `:"")+f,_&&(this.identifier=_),null!=u&&u.__line__&&(this.line=u.__line__)}}function za(l){const s=l.value;return s?[new Pe(l.key,s,"constants have been deprecated as of v8")]:[]}function Bi(l,...s){for(const u of s)for(const f in u)l[f]=u[f];return l}function Vn(l){return l instanceof Number||l instanceof String||l instanceof Boolean?l.valueOf():l}function ps(l){if(Array.isArray(l))return l.map(ps);if(l instanceof Object&&!(l instanceof Number||l instanceof String||l instanceof Boolean)){const s={};for(const u in l)s[u]=ps(l[u]);return s}return Vn(l)}class Vi extends Error{constructor(s,u){super(u),this.message=u,this.key=s}}class Ol{constructor(s,u=[]){this.parent=s,this.bindings={};for(const[f,_]of u)this.bindings[f]=_}concat(s){return new Ol(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}const ms={kind:"null"},rt={kind:"number"},Jt={kind:"string"},jt={kind:"boolean"},so={kind:"color"},gs={kind:"object"},At={kind:"value"},zs={kind:"collator"},Ci={kind:"formatted"},ia={kind:"padding"},ao={kind:"resolvedImage"};function Ui(l,s){return{kind:"array",itemType:l,N:s}}function zn(l){if("array"===l.kind){const s=zn(l.itemType);return"number"==typeof l.N?`array<${s}, ${l.N}>`:"value"===l.itemType.kind?"array":`array<${s}>`}return l.kind}const Fc=[ms,rt,Jt,jt,so,Ci,gs,Ui(At),ia,ao];function lo(l,s){if("error"===s.kind)return null;if("array"===l.kind){if("array"===s.kind&&(0===s.N&&"value"===s.itemType.kind||!lo(l.itemType,s.itemType))&&("number"!=typeof l.N||l.N===s.N))return null}else{if(l.kind===s.kind)return null;if("value"===l.kind)for(const u of Fc)if(!lo(u,s))return null}return`Expected ${zn(l)} but found ${zn(s)} instead.`}function Ll(l,s){return s.some(u=>u.kind===l.kind)}function mn(l,s){return s.some(u=>"null"===u?null===l:"array"===u?Array.isArray(l):"object"===u?l&&!Array.isArray(l)&&"object"==typeof l:u===typeof l)}var oa,Oc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ba(l){return(l=Math.round(l))<0?0:l>255?255:l}function Ru(l){return Ba("%"===l[l.length-1]?parseFloat(l)/100*255:parseInt(l))}function sa(l){return(s="%"===l[l.length-1]?parseFloat(l)/100:parseFloat(l))<0?0:s>1?1:s;var s}function Va(l,s,u){return u<0?u+=1:u>1&&(u-=1),6*u<1?l+(s-l)*u*6:2*u<1?s:3*u<2?l+(s-l)*(2/3-u)*6:l}try{oa={}.parseCSSColor=function(l){var s,u=l.replace(/ /g,"").toLowerCase();if(u in Oc)return Oc[u].slice();if("#"===u[0])return 4===u.length?(s=parseInt(u.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:7===u.length&&(s=parseInt(u.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var f=u.indexOf("("),_=u.indexOf(")");if(-1!==f&&_+1===u.length){var x=u.substr(0,f),E=u.substr(f+1,_-(f+1)).split(","),M=1;switch(x){case"rgba":if(4!==E.length)return null;M=sa(E.pop());case"rgb":return 3!==E.length?null:[Ru(E[0]),Ru(E[1]),Ru(E[2]),M];case"hsla":if(4!==E.length)return null;M=sa(E.pop());case"hsl":if(3!==E.length)return null;var A=(parseFloat(E[0])%360+360)%360/360,F=sa(E[1]),O=sa(E[2]),B=O<=.5?O*(F+1):O+F-O*F,H=2*O-B;return[Ba(255*Va(H,B,A+1/3)),Ba(255*Va(H,B,A)),Ba(255*Va(H,B,A-1/3)),M];default:return null}}return null}}catch{}class Sn{constructor(s,u,f,_=1){this.r=s,this.g=u,this.b=f,this.a=_}static parse(s){if(!s)return;if(s instanceof Sn)return s;if("string"!=typeof s)return;const u=oa(s);return u?new Sn(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3]):void 0}toString(){const[s,u,f,_]=this.toArray();return`rgba(${Math.round(s)},${Math.round(u)},${Math.round(f)},${_})`}toArray(){const{r:s,g:u,b:f,a:_}=this;return 0===_?[0,0,0,0]:[255*s/_,255*u/_,255*f/_,_]}}Sn.black=new Sn(0,0,0,1),Sn.white=new Sn(1,1,1,1),Sn.transparent=new Sn(0,0,0,0),Sn.red=new Sn(1,0,0,1);class Nl{constructor(s,u,f){this.sensitivity=s?u?"variant":"case":u?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,u){return this.collator.compare(s,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class co{constructor(s,u,f,_,x){this.text=s,this.image=u,this.scale=f,this.fontStack=_,this.textColor=x}}class Zr{constructor(s){this.sections=s}static fromString(s){return new Zr([new co(s,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(s=>0!==s.text.length||s.image&&0!==s.image.name.length)}static factory(s){return s instanceof Zr?s:Zr.fromString(s)}toString(){return 0===this.sections.length?"":this.sections.map(s=>s.text).join("")}}class Vr{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof Vr)return s;if("number"==typeof s)return new Vr([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const u of s)if("number"!=typeof u)return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new Vr(s)}}toString(){return JSON.stringify(this.values)}}class pi{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new pi({name:s,available:!1}):null}}function mi(l,s,u,f){return"number"==typeof l&&l>=0&&l<=255&&"number"==typeof s&&s>=0&&s<=255&&"number"==typeof u&&u>=0&&u<=255?void 0===f||"number"==typeof f&&f>=0&&f<=1?null:`Invalid rgba value [${[l,s,u,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof f?[l,s,u,f]:[l,s,u]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Bs(l){if(null===l||"string"==typeof l||"boolean"==typeof l||"number"==typeof l||l instanceof Sn||l instanceof Nl||l instanceof Zr||l instanceof Vr||l instanceof pi)return!0;if(Array.isArray(l)){for(const s of l)if(!Bs(s))return!1;return!0}if("object"==typeof l){for(const s in l)if(!Bs(l[s]))return!1;return!0}return!1}function J(l){if(null===l)return ms;if("string"==typeof l)return Jt;if("boolean"==typeof l)return jt;if("number"==typeof l)return rt;if(l instanceof Sn)return so;if(l instanceof Nl)return zs;if(l instanceof Zr)return Ci;if(l instanceof Vr)return ia;if(l instanceof pi)return ao;if(Array.isArray(l)){const s=l.length;let u;for(const f of l){const _=J(f);if(u){if(u===_)continue;u=At;break}u=_}return Ui(u||At,s)}return gs}function V(l){const s=typeof l;return null===l?"":"string"===s||"number"===s||"boolean"===s?String(l):l instanceof Sn||l instanceof Zr||l instanceof Vr||l instanceof pi?l.toString():JSON.stringify(l)}class ${constructor(s,u){this.type=s,this.value=u}static parse(s,u){if(2!==s.length)return u.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!Bs(s[1]))return u.error("invalid value");const f=s[1];let _=J(f);const x=u.expectedType;return"array"!==_.kind||0!==_.N||!x||"array"!==x.kind||"number"==typeof x.N&&0!==x.N||(_=x),new $(_,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class K{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const te={string:Jt,number:rt,boolean:jt,object:gs};class ce{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");let f,_=1;const x=s[0];if("array"===x){let M,A;if(s.length>2){const F=s[1];if("string"!=typeof F||!(F in te)||"object"===F)return u.error('The item type argument of "array" must be one of string, number, boolean',1);M=te[F],_++}else M=At;if(s.length>3){if(null!==s[2]&&("number"!=typeof s[2]||s[2]<0||s[2]!==Math.floor(s[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=s[2],_++}f=Ui(M,A)}else{if(!te[x])throw new Error(`Types doesn't contain name = ${x}`);f=te[x]}const E=[];for(;_s.outputDefined())}}const ge={"to-boolean":jt,"to-color":so,"to-number":rt,"to-string":Jt};class he{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");const f=s[0];if(!ge[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if(("to-boolean"===f||"to-string"===f)&&2!==s.length)return u.error("Expected one argument.");const _=ge[f],x=[];for(let E=1;E4?`Invalid rbga value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:mi(u[0],u[1],u[2],u[3]),!f))return new Sn(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new K(f||`Could not parse color from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("padding"===this.type.kind){let u;for(const f of this.args){u=f.evaluate(s);const _=Vr.parse(u);if(_)return _}throw new K(`Could not parse padding from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("number"===this.type.kind){let u=null;for(const f of this.args){if(u=f.evaluate(s),null===u)return 0;const _=Number(u);if(!isNaN(_))return _}throw new K(`Could not convert ${JSON.stringify(u)} to number.`)}return"formatted"===this.type.kind?Zr.fromString(V(this.args[0].evaluate(s))):"resolvedImage"===this.type.kind?pi.fromString(V(this.args[0].evaluate(s))):V(this.args[0].evaluate(s))}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const ue=["Unknown","Point","LineString","Polygon"];class xe{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ue[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(s){let u=this._parseColorCache[s];return u||(u=this._parseColorCache[s]=Sn.parse(s)),u}}class Me{constructor(s,u,f,_){this.name=s,this.type=u,this._evaluate=f,this.args=_}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,u){const f=s[0],_=Me.definitions[f];if(!_)return u.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(_)?_[0]:_.type,E=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,M=E.filter(([F])=>!Array.isArray(F)||F.length===s.length-1);let A=null;for(const[F,O]of M){A=new zl(u.registry,u.path,null,u.scope);const B=[];let H=!1;for(let q=1;q{return H=B,Array.isArray(H)?`(${H.map(zn).join(", ")})`:`(${zn(H.type)}...)`;var H}).join(" | "),O=[];for(let B=1;B=s[2]||l[1]<=s[1]||l[3]>=s[3])}function ft(l,s){const u=(180+l[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,_=Math.pow(2,s.z);return[Math.round(u*_*Ie),Math.round(f*_*Ie)]}function xt(l,s,u){const f=l[0]-s[0],_=l[1]-s[1],x=l[0]-u[0],E=l[1]-u[1];return f*E-x*_==0&&f*x<=0&&_*E<=0}function ln(l,s){let u=!1;for(let E=0,M=s.length;E(f=l)[1]!=(x=A[F+1])[1]>f[1]&&f[0]<(x[0]-_[0])*(f[1]-_[1])/(x[1]-_[1])+_[0]&&(u=!u)}}var f,_,x;return u}function Gn(l,s){for(let u=0;u0&&M<0||E<0&&M>0}function an(l,s,u){for(const F of u)for(let O=0;Ou[2]){const _=.5*f;let x=l[0]-u[0]>_?-f:u[0]-l[0]>_?f:0;0===x&&(x=l[0]-u[2]>_?-f:u[2]-l[0]>_?f:0),l[0]+=x}Dt(s,l)}function kf(l,s,u,f){const _=Math.pow(2,f.z)*Ie,x=[f.x*Ie,f.y*Ie],E=[];for(const M of l)for(const A of M){const F=[A.x+x[0],A.y+x[1]];Ua(F,s,u,_),E.push(F)}return E}function Pf(l,s,u,f){const _=Math.pow(2,f.z)*Ie,x=[f.x*Ie,f.y*Ie],E=[];for(const A of l){const F=[];for(const O of A){const B=[O.x+x[0],O.y+x[1]];Dt(s,B),F.push(B)}E.push(F)}if(s[2]-s[0]<=_/2){(M=s)[0]=M[1]=1/0,M[2]=M[3]=-1/0;for(const A of E)for(const F of A)Ua(F,s,u,_)}var M;return E}class $a{constructor(s,u){this.type=jt,this.geojson=s,this.geometries=u}static parse(s,u){if(2!==s.length)return u.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(Bs(s[1])){const f=s[1];if("FeatureCollection"===f.type)for(let _=0;_{s&&!Fu(u)&&(s=!1)}),s}function ja(l){if(l instanceof Me&&"feature-state"===l.name)return!1;let s=!0;return l.eachChild(u=>{s&&!ja(u)&&(s=!1)}),s}function aa(l,s){if(l instanceof Me&&s.indexOf(l.name)>=0)return!1;let u=!0;return l.eachChild(f=>{u&&!aa(f,s)&&(u=!1)}),u}class Ou{constructor(s,u){this.type=u.type,this.name=s,this.boundExpression=u}static parse(s,u){if(2!==s.length||"string"!=typeof s[1])return u.error("'var' expression requires exactly one string literal argument.");const f=s[1];return u.scope.has(f)?new Ou(f,u.scope.get(f)):u.error(`Unknown variable "${f}". Make sure "${f}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Cr{constructor(s,u=[],f,_=new Ol,x=[]){this.registry=s,this.path=u,this.key=u.map(E=>`[${E}]`).join(""),this.scope=_,this.errors=x,this.expectedType=f}parse(s,u,f,_,x={}){return u?this.concat(u,f,_)._parse(s,x):this._parse(s,x)}_parse(s,u){function f(_,x,E){return"assert"===E?new ce(x,[_]):"coerce"===E?new he(x,[_]):_}if(null!==s&&"string"!=typeof s&&"boolean"!=typeof s&&"number"!=typeof s||(s=["literal",s]),Array.isArray(s)){if(0===s.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=s[0];if("string"!=typeof _)return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const x=this.registry[_];if(x){let E=x.parse(s,this);if(!E)return null;if(this.expectedType){const M=this.expectedType,A=E.type;if("string"!==M.kind&&"number"!==M.kind&&"boolean"!==M.kind&&"object"!==M.kind&&"array"!==M.kind||"value"!==A.kind)if("color"!==M.kind&&"formatted"!==M.kind&&"resolvedImage"!==M.kind||"value"!==A.kind&&"string"!==A.kind)if("padding"!==M.kind||"value"!==A.kind&&"number"!==A.kind&&"array"!==A.kind){if(this.checkSubtype(M,A))return null}else E=f(E,M,u.typeAnnotation||"coerce");else E=f(E,M,u.typeAnnotation||"coerce");else E=f(E,M,u.typeAnnotation||"assert")}if(!(E instanceof $)&&"resolvedImage"!==E.type.kind&&Jh(E)){const M=new xe;try{E=new $(E.type,E.evaluate(M))}catch(A){return this.error(A.message),null}}return E}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===s?"'undefined' value invalid. Use null instead.":"object"==typeof s?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,u,f){const _="number"==typeof s?this.path.concat(s):this.path,x=f?this.scope.concat(f):this.scope;return new Cr(this.registry,_,u||null,x,this.errors)}error(s,...u){const f=`${this.key}${u.map(_=>`[${_}]`).join("")}`;this.errors.push(new Vi(f,s))}checkSubtype(s,u){const f=lo(s,u);return f&&this.error(f),f}}var zl=Cr;function Jh(l){if(l instanceof Ou)return Jh(l.boundExpression);if(l instanceof Me&&"error"===l.name||l instanceof je||l instanceof $a)return!1;const s=l instanceof he||l instanceof ce;let u=!0;return l.eachChild(f=>{u=s?u&&Jh(f):u&&f instanceof $}),!!u&&Fu(l)&&aa(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bl(l,s){const u=l.length-1;let f,_,x=0,E=u,M=0;for(;x<=E;)if(M=Math.floor((x+E)/2),f=l[M],_=l[M+1],f<=s){if(M===u||s<_)return M;x=M+1}else{if(!(f>s))throw new K("Input is not a number.");E=M-1}return 0}class Bn{constructor(s,u,f){this.type=s,this.input=u,this.labels=[],this.outputs=[];for(const[_,x]of f)this.labels.push(_),this.outputs.push(x)}static parse(s,u){if(s.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return u.error("Expected an even number of arguments.");const f=u.parse(s[1],1,rt);if(!f)return null;const _=[];let x=null;u.expectedType&&"value"!==u.expectedType.kind&&(x=u.expectedType);for(let E=1;E=M)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',F);const B=u.parse(A,O,x);if(!B)return null;x=x||B.type,_.push([M,B])}return new Bn(x,f,_)}evaluate(s){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(s);const _=this.input.evaluate(s);if(_<=u[0])return f[0].evaluate(s);const x=u.length;return _>=u[x-1]?f[x-1].evaluate(s):f[Bl(u,_)].evaluate(s)}eachChild(s){s(this.input);for(const u of this.outputs)s(u)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Xn(l,s,u){return l*(1-u)+s*u}var Mn=Object.freeze({__proto__:null,array:function(l,s,u){return l.map((f,_)=>Xn(f,s[_],u))},color:function(l,s,u){return new Sn(Xn(l.r,s.r,u),Xn(l.g,s.g,u),Xn(l.b,s.b,u),Xn(l.a,s.a,u))},number:Xn,padding:function(l,s,u){const f=l.values,_=s.values;return new Vr([Xn(f[0],_[0],u),Xn(f[1],_[1],u),Xn(f[2],_[2],u),Xn(f[3],_[3],u)])}});const Yn=4/29,Mt=6/29,Vl=3*Mt*Mt,Ff=Math.PI/180,nt=180/Math.PI;function wn(l){return l>.008856451679035631?Math.pow(l,1/3):l/Vl+Yn}function $t(l){return l>Mt?l*l*l:Vl*(l-Yn)}function yn(l){return 255*(l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055)}function Qh(l){return(l/=255)<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Of(l){const s=Qh(l.r),u=Qh(l.g),f=Qh(l.b),_=wn((.4124564*s+.3575761*u+.1804375*f)/.95047),x=wn((.2126729*s+.7151522*u+.072175*f)/1);return{l:116*x-16,a:500*(_-x),b:200*(x-wn((.0193339*s+.119192*u+.9503041*f)/1.08883)),alpha:l.a}}function ed(l){let s=(l.l+16)/116,u=isNaN(l.a)?s:s+l.a/500,f=isNaN(l.b)?s:s-l.b/200;return s=1*$t(s),u=.95047*$t(u),f=1.08883*$t(f),new Sn(yn(3.2404542*u-1.5371385*s-.4985314*f),yn(-.969266*u+1.8760108*s+.041556*f),yn(.0556434*u-.2040259*s+1.0572252*f),l.alpha)}function Nu(l,s,u){const f=s-l;return l+u*(f>180||f<-180?f-360*Math.round(f/360):f)}const Wr={forward:Of,reverse:ed,interpolate:function(l,s,u){return{l:Xn(l.l,s.l,u),a:Xn(l.a,s.a,u),b:Xn(l.b,s.b,u),alpha:Xn(l.alpha,s.alpha,u)}}},Lc={forward:function(l){const{l:s,a:u,b:f}=Of(l),_=Math.atan2(f,u)*nt;return{h:_<0?_+360:_,c:Math.sqrt(u*u+f*f),l:s,alpha:l.a}},reverse:function(l){const s=l.h*Ff,u=l.c;return ed({l:l.l,a:Math.cos(s)*u,b:Math.sin(s)*u,alpha:l.alpha})},interpolate:function(l,s,u){return{h:Nu(l.h,s.h,u),c:Xn(l.c,s.c,u),l:Xn(l.l,s.l,u),alpha:Xn(l.alpha,s.alpha,u)}}};var Lf=Object.freeze({__proto__:null,hcl:Lc,lab:Wr});class Io{constructor(s,u,f,_,x){this.type=s,this.operator=u,this.interpolation=f,this.input=_,this.labels=[],this.outputs=[];for(const[E,M]of x)this.labels.push(E),this.outputs.push(M)}static interpolationFactor(s,u,f,_){let x=0;if("exponential"===s.name)x=Zo(u,s.base,f,_);else if("linear"===s.name)x=Zo(u,1,f,_);else if("cubic-bezier"===s.name){const E=s.controlPoints;x=new vr(E[0],E[1],E[2],E[3]).solve(Zo(u,1,f,_))}return x}static parse(s,u){let[f,_,x,...E]=s;if(!Array.isArray(_)||0===_.length)return u.error("Expected an interpolation type expression.",1);if("linear"===_[0])_={name:"linear"};else if("exponential"===_[0]){const F=_[1];if("number"!=typeof F)return u.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:F}}else{if("cubic-bezier"!==_[0])return u.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const F=_.slice(1);if(4!==F.length||F.some(O=>"number"!=typeof O||O<0||O>1))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:F}}}if(s.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(x=u.parse(x,2,rt),!x)return null;const M=[];let A=null;"interpolate-hcl"===f||"interpolate-lab"===f?A=so:u.expectedType&&"value"!==u.expectedType.kind&&(A=u.expectedType);for(let F=0;F=O)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const W=u.parse(B,q,A);if(!W)return null;A=A||W.type,M.push([O,W])}return"number"===A.kind||"color"===A.kind||"padding"===A.kind||"array"===A.kind&&"number"===A.itemType.kind&&"number"==typeof A.N?new Io(A,f,_,x,M):u.error(`Type ${zn(A)} is not interpolatable.`)}evaluate(s){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(s);const _=this.input.evaluate(s);if(_<=u[0])return f[0].evaluate(s);const x=u.length;if(_>=u[x-1])return f[x-1].evaluate(s);const E=Bl(u,_),M=Io.interpolationFactor(this.interpolation,_,u[E],u[E+1]),A=f[E].evaluate(s),F=f[E+1].evaluate(s);return"interpolate"===this.operator?Mn[this.type.kind.toLowerCase()](A,F,M):"interpolate-hcl"===this.operator?Lc.reverse(Lc.interpolate(Lc.forward(A),Lc.forward(F),M)):Wr.reverse(Wr.interpolate(Wr.forward(A),Wr.forward(F),M))}eachChild(s){s(this.input);for(const u of this.outputs)s(u)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Zo(l,s,u,f){const _=f-u,x=l-u;return 0===_?0:1===s?x/_:(Math.pow(s,x)-1)/(Math.pow(s,_)-1)}class td{constructor(s,u){this.type=s,this.args=u}static parse(s,u){if(s.length<2)return u.error("Expectected at least one argument.");let f=null;const _=u.expectedType;_&&"value"!==_.kind&&(f=_);const x=[];for(const M of s.slice(1)){const A=u.parse(M,1+x.length,f,void 0,{typeAnnotation:"omit"});if(!A)return null;f=f||A.type,x.push(A)}if(!f)throw new Error("No output type");const E=_&&x.some(M=>lo(_,M.type));return new td(E?At:f,x)}evaluate(s){let u,f=null,_=0;for(const x of this.args)if(_++,f=x.evaluate(s),f&&f instanceof pi&&!f.available&&(u||(u=f.name),f=null,_===this.args.length&&(f=u)),null!==f)break;return f}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class zu{constructor(s,u){this.type=u.type,this.bindings=[].concat(s),this.result=u}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const u of this.bindings)s(u[1]);s(this.result)}static parse(s,u){if(s.length<4)return u.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const f=[];for(let x=1;x=f.length)throw new K(`Array index out of bounds: ${u} > ${f.length-1}.`);if(u!==Math.floor(u))throw new K(`Array index must be an integer, but found ${u} instead.`);return f[u]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class Nf{constructor(s,u){this.type=jt,this.needle=s,this.haystack=u}static parse(s,u){if(3!==s.length)return u.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,At);return f&&_?Ll(f.type,[jt,Jt,rt,ms,At])?new Nf(f,_):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${zn(f.type)} instead`):null}evaluate(s){const u=this.needle.evaluate(s),f=this.haystack.evaluate(s);if(!f)return!1;if(!mn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${zn(J(u))} instead.`);if(!mn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${zn(J(f))} instead.`);return f.indexOf(u)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class Bu{constructor(s,u,f){this.type=rt,this.needle=s,this.haystack=u,this.fromIndex=f}static parse(s,u){if(s.length<=2||s.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,At);if(!f||!_)return null;if(!Ll(f.type,[jt,Jt,rt,ms,At]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${zn(f.type)} instead`);if(4===s.length){const x=u.parse(s[3],3,rt);return x?new Bu(f,_,x):null}return new Bu(f,_)}evaluate(s){const u=this.needle.evaluate(s),f=this.haystack.evaluate(s);if(!mn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${zn(J(u))} instead.`);if(!mn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${zn(J(f))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(s);return f.indexOf(u,_)}return f.indexOf(u)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Vu{constructor(s,u,f,_,x,E){this.inputType=s,this.type=u,this.input=f,this.cases=_,this.outputs=x,this.otherwise=E}static parse(s,u){if(s.length<5)return u.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return u.error("Expected an even number of arguments.");let f,_;u.expectedType&&"value"!==u.expectedType.kind&&(_=u.expectedType);const x={},E=[];for(let F=2;FNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof W&&Math.floor(W)!==W)return H.error("Numeric branch labels must be integer values.");if(f){if(H.checkSubtype(f,J(W)))return null}else f=J(W);if(void 0!==x[String(W)])return H.error("Branch labels must be unique.");x[String(W)]=E.length}const q=u.parse(B,F,_);if(!q)return null;_=_||q.type,E.push(q)}const M=u.parse(s[1],1,At);if(!M)return null;const A=u.parse(s[s.length-1],s.length-1,_);return A?"value"!==M.type.kind&&u.concat(1).checkSubtype(f,M.type)?null:new Vu(f,_,M,x,E,A):null}evaluate(s){const u=this.input.evaluate(s);return(J(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class rd{constructor(s,u,f){this.type=s,this.branches=u,this.otherwise=f}static parse(s,u){if(s.length<4)return u.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return u.error("Expected an odd number of arguments.");let f;u.expectedType&&"value"!==u.expectedType.kind&&(f=u.expectedType);const _=[];for(let E=1;Eu.outputDefined())&&this.otherwise.outputDefined()}}class id{constructor(s,u,f,_){this.type=s,this.input=u,this.beginIndex=f,this.endIndex=_}static parse(s,u){if(s.length<=2||s.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const f=u.parse(s[1],1,At),_=u.parse(s[2],2,rt);if(!f||!_)return null;if(!Ll(f.type,[Ui(At),Jt,At]))return u.error(`Expected first argument to be of type array or string, but found ${zn(f.type)} instead`);if(4===s.length){const x=u.parse(s[3],3,rt);return x?new id(f.type,f,_,x):null}return new id(f.type,f,_)}evaluate(s){const u=this.input.evaluate(s),f=this.beginIndex.evaluate(s);if(!mn(u,["string","array"]))throw new K(`Expected first argument to be of type array or string, but found ${zn(J(u))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(s);return u.slice(f,_)}return u.slice(f)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function $i(l,s){return"=="===l||"!="===l?"boolean"===s.kind||"string"===s.kind||"number"===s.kind||"null"===s.kind||"value"===s.kind:"string"===s.kind||"number"===s.kind||"value"===s.kind}function Rn(l,s,u,f){return 0===f.compare(s,u)}function Ul(l,s,u){const f="=="!==l&&"!="!==l;return class k6{constructor(x,E,M){this.type=jt,this.lhs=x,this.rhs=E,this.collator=M,this.hasUntypedArgument="value"===x.type.kind||"value"===E.type.kind}static parse(x,E){if(3!==x.length&&4!==x.length)return E.error("Expected two or three arguments.");const M=x[0];let A=E.parse(x[1],1,At);if(!A)return null;if(!$i(M,A.type))return E.concat(1).error(`"${M}" comparisons are not supported for type '${zn(A.type)}'.`);let F=E.parse(x[2],2,At);if(!F)return null;if(!$i(M,F.type))return E.concat(2).error(`"${M}" comparisons are not supported for type '${zn(F.type)}'.`);if(A.type.kind!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return E.error(`Cannot compare types '${zn(A.type)}' and '${zn(F.type)}'.`);f&&("value"===A.type.kind&&"value"!==F.type.kind?A=new ce(F.type,[A]):"value"!==A.type.kind&&"value"===F.type.kind&&(F=new ce(A.type,[F])));let O=null;if(4===x.length){if("string"!==A.type.kind&&"string"!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return E.error("Cannot use collator to compare non-string types.");if(O=E.parse(x[3],3,zs),!O)return null}return new k6(A,F,O)}evaluate(x){const E=this.lhs.evaluate(x),M=this.rhs.evaluate(x);if(f&&this.hasUntypedArgument){const A=J(E),F=J(M);if(A.kind!==F.kind||"string"!==A.kind&&"number"!==A.kind)throw new K(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${A.kind}, ${F.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const A=J(E),F=J(M);if("string"!==A.kind||"string"!==F.kind)return s(x,E,M)}return this.collator?u(x,E,M,this.collator.evaluate(x)):s(x,E,M)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const T_=Ul("==",function(l,s,u){return s===u},Rn),A_=Ul("!=",function(l,s,u){return s!==u},function(l,s,u,f){return!Rn(0,s,u,f)}),Ot=Ul("<",function(l,s,u){return s",function(l,s,u){return s>u},function(l,s,u,f){return f.compare(s,u)>0}),Ei=Ul("<=",function(l,s,u){return s<=u},function(l,s,u,f){return f.compare(s,u)<=0}),Uu=Ul(">=",function(l,s,u){return s>=u},function(l,s,u,f){return f.compare(s,u)>=0});class od{constructor(s,u,f,_,x){this.type=Jt,this.number=s,this.locale=u,this.currency=f,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(s,u){if(3!==s.length)return u.error("Expected two arguments.");const f=u.parse(s[1],1,rt);if(!f)return null;const _=s[2];if("object"!=typeof _||Array.isArray(_))return u.error("NumberFormat options argument must be an object.");let x=null;if(_.locale&&(x=u.parse(_.locale,1,Jt),!x))return null;let E=null;if(_.currency&&(E=u.parse(_.currency,1,Jt),!E))return null;let M=null;if(_["min-fraction-digits"]&&(M=u.parse(_["min-fraction-digits"],1,rt),!M))return null;let A=null;return _["max-fraction-digits"]&&(A=u.parse(_["max-fraction-digits"],1,rt),!A)?null:new od(f,x,E,M,A)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class Nc{constructor(s){this.type=Ci,this.sections=s}static parse(s,u){if(s.length<2)return u.error("Expected at least one argument.");const f=s[1];if(!Array.isArray(f)&&"object"==typeof f)return u.error("First argument must be an image or text section.");const _=[];let x=!1;for(let E=1;E<=s.length-1;++E){const M=s[E];if(x&&"object"==typeof M&&!Array.isArray(M)){x=!1;let A=null;if(M["font-scale"]&&(A=u.parse(M["font-scale"],1,rt),!A))return null;let F=null;if(M["text-font"]&&(F=u.parse(M["text-font"],1,Ui(Jt)),!F))return null;let O=null;if(M["text-color"]&&(O=u.parse(M["text-color"],1,so),!O))return null;const B=_[_.length-1];B.scale=A,B.font=F,B.textColor=O}else{const A=u.parse(s[E],1,At);if(!A)return null;const F=A.type.kind;if("string"!==F&&"value"!==F&&"null"!==F&&"resolvedImage"!==F)return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:A,scale:null,font:null,textColor:null})}}return new Nc(_)}evaluate(s){return new Zr(this.sections.map(u=>{const f=u.content.evaluate(s);return J(f)===ao?new co("",f,null,null,null):new co(V(f),null,u.scale?u.scale.evaluate(s):null,u.font?u.font.evaluate(s).join(","):null,u.textColor?u.textColor.evaluate(s):null)}))}eachChild(s){for(const u of this.sections)s(u.content),u.scale&&s(u.scale),u.font&&s(u.font),u.textColor&&s(u.textColor)}outputDefined(){return!1}}class sd{constructor(s){this.type=ao,this.input=s}static parse(s,u){if(2!==s.length)return u.error("Expected two arguments.");const f=u.parse(s[1],1,Jt);return f?new sd(f):u.error("No image name provided.")}evaluate(s){const u=this.input.evaluate(s),f=pi.fromString(u);return f&&s.availableImages&&(f.available=s.availableImages.indexOf(u)>-1),f}eachChild(s){s(this.input)}outputDefined(){return!1}}class ad{constructor(s){this.type=rt,this.input=s}static parse(s,u){if(2!==s.length)return u.error(`Expected 1 argument, but found ${s.length-1} instead.`);const f=u.parse(s[1],1);return f?"array"!==f.type.kind&&"string"!==f.type.kind&&"value"!==f.type.kind?u.error(`Expected argument of type string or array, but found ${zn(f.type)} instead.`):new ad(f):null}evaluate(s){const u=this.input.evaluate(s);if("string"==typeof u||Array.isArray(u))return u.length;throw new K(`Expected value to be of type string or array, but found ${zn(J(u))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Ha={"==":T_,"!=":A_,">":$m,"<":Ot,">=":Uu,"<=":Ei,array:ce,at:nd,boolean:ce,case:rd,coalesce:td,collator:je,format:Nc,image:sd,in:Nf,"index-of":Bu,interpolate:Io,"interpolate-hcl":Io,"interpolate-lab":Io,length:ad,let:zu,literal:$,match:Vu,number:ce,"number-format":od,object:ce,slice:id,step:Bn,string:ce,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:Ou,within:$a};function gn(l,[s,u,f,_]){s=s.evaluate(l),u=u.evaluate(l),f=f.evaluate(l);const x=_?_.evaluate(l):1,E=mi(s,u,f,x);if(E)throw new K(E);return new Sn(s/255*x,u/255*x,f/255*x,x)}function $u(l,s){return l in s}function ju(l,s){const u=s[l];return void 0===u?null:u}function Ga(l){return{type:l}}function Rt(l){return{result:"success",value:l}}function la(l){return{result:"error",value:l}}function $l(l){return"data-driven"===l["property-type"]||"cross-faded-data-driven"===l["property-type"]}function uo(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function Hu(l){return!!l.expression&&l.expression.interpolated}function Un(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":null===l?"null":typeof l}function Wo(l){return"object"==typeof l&&null!==l&&!Array.isArray(l)}function Xo(l){return l}function jm(l,s){const u="color"===s.type,f=l.stops&&"object"==typeof l.stops[0][0],_=f||!(f||void 0!==l.property),x=l.type||(Hu(s)?"exponential":"interval");if(u||"padding"===s.type){const F=u?Sn.parse:Vr.parse;(l=Bi({},l)).stops&&(l.stops=l.stops.map(O=>[O[0],F(O[1])])),l.default=F(l.default?l.default:s.default)}if(l.colorSpace&&"rgb"!==l.colorSpace&&!Lf[l.colorSpace])throw new Error(`Unknown color space: ${l.colorSpace}`);let E,M,A;if("exponential"===x)E=Hm;else if("interval"===x)E=er;else if("categorical"===x){E=ys,M=Object.create(null);for(const F of l.stops)M[F[0]]=F[1];A=typeof l.stops[0][0]}else{if("identity"!==x)throw new Error(`Unknown function type "${x}"`);E=k_}if(f){const F={},O=[];for(let q=0;qq[0]),evaluate:({zoom:q},W)=>Hm({stops:B,base:l.base},s,q).evaluate(q,W)}}if(_){const F="exponential"===x?{name:"exponential",base:void 0!==l.base?l.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:Io.interpolationFactor.bind(void 0,F),zoomStops:l.stops.map(O=>O[0]),evaluate:({zoom:O})=>E(l,s,O,M,A)}}return{kind:"source",evaluate(F,O){const B=O&&O.properties?O.properties[l.property]:void 0;return void 0===B?Gu(l.default,s.default):E(l,s,B,M,A)}}}function Gu(l,s,u){return void 0!==l?l:void 0!==s?s:void 0!==u?u:void 0}function ys(l,s,u,f,_){return Gu(typeof u===_?f[u]:void 0,l.default,s.default)}function er(l,s,u){if("number"!==Un(u))return Gu(l.default,s.default);const f=l.stops.length;if(1===f||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[f-1][0])return l.stops[f-1][1];const _=Bl(l.stops.map(x=>x[0]),u);return l.stops[_][1]}function Hm(l,s,u){const f=void 0!==l.base?l.base:1;if("number"!==Un(u))return Gu(l.default,s.default);const _=l.stops.length;if(1===_||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[_-1][0])return l.stops[_-1][1];const x=Bl(l.stops.map(O=>O[0]),u),E=function(O,B,H,q){const W=q-H,se=O-H;return 0===W?0:1===B?se/W:(Math.pow(B,se)-1)/(Math.pow(B,W)-1)}(u,f,l.stops[x][0],l.stops[x+1][0]),M=l.stops[x][1],A=l.stops[x+1][1];let F=Mn[s.type]||Xo;if(l.colorSpace&&"rgb"!==l.colorSpace){const O=Lf[l.colorSpace];F=(B,H)=>O.reverse(O.interpolate(O.forward(B),O.forward(H),E))}return"function"==typeof M.evaluate?{evaluate(...O){const B=M.evaluate.apply(void 0,O),H=A.evaluate.apply(void 0,O);if(void 0!==B&&void 0!==H)return F(B,H,E)}}:F(M,A,E)}function k_(l,s,u){switch(s.type){case"color":u=Sn.parse(u);break;case"formatted":u=Zr.fromString(u.toString());break;case"resolvedImage":u=pi.fromString(u.toString());break;case"padding":u=Vr.parse(u);break;default:Un(u)===s.type||"enum"===s.type&&s.values[u]||(u=void 0)}return Gu(u,l.default,s.default)}Me.register(Ha,{error:[{kind:"error"},[Jt],(l,[s])=>{throw new K(s.evaluate(l))}],typeof:[Jt,[At],(l,[s])=>zn(J(s.evaluate(l)))],"to-rgba":[Ui(rt,4),[so],(l,[s])=>s.evaluate(l).toArray()],rgb:[so,[rt,rt,rt],gn],rgba:[so,[rt,rt,rt,rt],gn],has:{type:jt,overloads:[[[Jt],(l,[s])=>$u(s.evaluate(l),l.properties())],[[Jt,gs],(l,[s,u])=>$u(s.evaluate(l),u.evaluate(l))]]},get:{type:At,overloads:[[[Jt],(l,[s])=>ju(s.evaluate(l),l.properties())],[[Jt,gs],(l,[s,u])=>ju(s.evaluate(l),u.evaluate(l))]]},"feature-state":[At,[Jt],(l,[s])=>ju(s.evaluate(l),l.featureState||{})],properties:[gs,[],l=>l.properties()],"geometry-type":[Jt,[],l=>l.geometryType()],id:[At,[],l=>l.id()],zoom:[rt,[],l=>l.globals.zoom],"heatmap-density":[rt,[],l=>l.globals.heatmapDensity||0],"line-progress":[rt,[],l=>l.globals.lineProgress||0],accumulated:[At,[],l=>void 0===l.globals.accumulated?null:l.globals.accumulated],"+":[rt,Ga(rt),(l,s)=>{let u=0;for(const f of s)u+=f.evaluate(l);return u}],"*":[rt,Ga(rt),(l,s)=>{let u=1;for(const f of s)u*=f.evaluate(l);return u}],"-":{type:rt,overloads:[[[rt,rt],(l,[s,u])=>s.evaluate(l)-u.evaluate(l)],[[rt],(l,[s])=>-s.evaluate(l)]]},"/":[rt,[rt,rt],(l,[s,u])=>s.evaluate(l)/u.evaluate(l)],"%":[rt,[rt,rt],(l,[s,u])=>s.evaluate(l)%u.evaluate(l)],ln2:[rt,[],()=>Math.LN2],pi:[rt,[],()=>Math.PI],e:[rt,[],()=>Math.E],"^":[rt,[rt,rt],(l,[s,u])=>Math.pow(s.evaluate(l),u.evaluate(l))],sqrt:[rt,[rt],(l,[s])=>Math.sqrt(s.evaluate(l))],log10:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))/Math.LN10],ln:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))],log2:[rt,[rt],(l,[s])=>Math.log(s.evaluate(l))/Math.LN2],sin:[rt,[rt],(l,[s])=>Math.sin(s.evaluate(l))],cos:[rt,[rt],(l,[s])=>Math.cos(s.evaluate(l))],tan:[rt,[rt],(l,[s])=>Math.tan(s.evaluate(l))],asin:[rt,[rt],(l,[s])=>Math.asin(s.evaluate(l))],acos:[rt,[rt],(l,[s])=>Math.acos(s.evaluate(l))],atan:[rt,[rt],(l,[s])=>Math.atan(s.evaluate(l))],min:[rt,Ga(rt),(l,s)=>Math.min(...s.map(u=>u.evaluate(l)))],max:[rt,Ga(rt),(l,s)=>Math.max(...s.map(u=>u.evaluate(l)))],abs:[rt,[rt],(l,[s])=>Math.abs(s.evaluate(l))],round:[rt,[rt],(l,[s])=>{const u=s.evaluate(l);return u<0?-Math.round(-u):Math.round(u)}],floor:[rt,[rt],(l,[s])=>Math.floor(s.evaluate(l))],ceil:[rt,[rt],(l,[s])=>Math.ceil(s.evaluate(l))],"filter-==":[jt,[Jt,At],(l,[s,u])=>l.properties()[s.value]===u.value],"filter-id-==":[jt,[At],(l,[s])=>l.id()===s.value],"filter-type-==":[jt,[Jt],(l,[s])=>l.geometryType()===s.value],"filter-<":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f<_}],"filter-id-<":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f>_}],"filter-id->":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u>f}],"filter-<=":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f<=_}],"filter-id-<=":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u<=f}],"filter->=":[jt,[Jt,At],(l,[s,u])=>{const f=l.properties()[s.value],_=u.value;return typeof f==typeof _&&f>=_}],"filter-id->=":[jt,[At],(l,[s])=>{const u=l.id(),f=s.value;return typeof u==typeof f&&u>=f}],"filter-has":[jt,[At],(l,[s])=>s.value in l.properties()],"filter-has-id":[jt,[],l=>null!==l.id()&&void 0!==l.id()],"filter-type-in":[jt,[Ui(Jt)],(l,[s])=>s.value.indexOf(l.geometryType())>=0],"filter-id-in":[jt,[Ui(At)],(l,[s])=>s.value.indexOf(l.id())>=0],"filter-in-small":[jt,[Jt,Ui(At)],(l,[s,u])=>u.value.indexOf(l.properties()[s.value])>=0],"filter-in-large":[jt,[Jt,Ui(At)],(l,[s,u])=>function(f,_,x,E){for(;x<=E;){const M=x+E>>1;if(_[M]===f)return!0;_[M]>f?E=M-1:x=M+1}return!1}(l.properties()[s.value],u.value,0,u.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(l,[s,u])=>s.evaluate(l)&&u.evaluate(l)],[Ga(jt),(l,s)=>{for(const u of s)if(!u.evaluate(l))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(l,[s,u])=>s.evaluate(l)||u.evaluate(l)],[Ga(jt),(l,s)=>{for(const u of s)if(u.evaluate(l))return!0;return!1}]]},"!":[jt,[jt],(l,[s])=>!s.evaluate(l)],"is-supported-script":[jt,[Jt],(l,[s])=>{const u=l.globals&&l.globals.isSupportedScript;return!u||u(s.evaluate(l))}],upcase:[Jt,[Jt],(l,[s])=>s.evaluate(l).toUpperCase()],downcase:[Jt,[Jt],(l,[s])=>s.evaluate(l).toLowerCase()],concat:[Jt,Ga(At),(l,s)=>s.map(u=>V(u.evaluate(l))).join("")],"resolved-locale":[Jt,[zs],(l,[s])=>s.evaluate(l).resolvedLocale()]});class ca{constructor(s,u){var f;this.expression=s,this._warningHistory={},this._evaluator=new xe,this._defaultValue=u?"color"===(f=u).type&&Wo(f.default)?new Sn(0,0,0,0):"color"===f.type?Sn.parse(f.default)||null:"padding"===f.type?Vr.parse(f.default)||null:void 0===f.default?null:f.default:null,this._enumValues=u&&"enum"===u.type?u.values:null}evaluateWithoutErrorHandling(s,u,f,_,x,E){return this._evaluator.globals=s,this._evaluator.feature=u,this._evaluator.featureState=f,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E,this.expression.evaluate(this._evaluator)}evaluate(s,u,f,_,x,E){this._evaluator.globals=s,this._evaluator.feature=u||null,this._evaluator.featureState=f||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E||null;try{const M=this.expression.evaluate(this._evaluator);if(null==M||"number"==typeof M&&M!=M)return this._defaultValue;if(this._enumValues&&!(M in this._enumValues))throw new K(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(M)} instead.`);return M}catch(M){return this._warningHistory[M.message]||(this._warningHistory[M.message]=!0,typeof console<"u"&&console.warn(M.message)),this._defaultValue}}}function Cn(l){return Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in Ha}function qa(l,s){const u=new zl(Ha,[],s?function(_){const x={color:so,string:Jt,number:rt,enum:Jt,boolean:jt,formatted:Ci,padding:ia,resolvedImage:ao};return"array"===_.type?Ui(x[_.value]||At,_.length):x[_.type]}(s):void 0),f=u.parse(l,void 0,void 0,void 0,s&&"string"===s.type?{typeAnnotation:"coerce"}:void 0);return f?Rt(new ca(f,s)):la(u.errors)}class zc{constructor(s,u){this.kind=s,this._styleExpression=u,this.isStateDependent="constant"!==s&&!ja(u.expression)}evaluateWithoutErrorHandling(s,u,f,_,x,E){return this._styleExpression.evaluateWithoutErrorHandling(s,u,f,_,x,E)}evaluate(s,u,f,_,x,E){return this._styleExpression.evaluate(s,u,f,_,x,E)}}class Bc{constructor(s,u,f,_){this.kind=s,this.zoomStops=f,this._styleExpression=u,this.isStateDependent="camera"!==s&&!ja(u.expression),this.interpolationType=_}evaluateWithoutErrorHandling(s,u,f,_,x,E){return this._styleExpression.evaluateWithoutErrorHandling(s,u,f,_,x,E)}evaluate(s,u,f,_,x,E){return this._styleExpression.evaluate(s,u,f,_,x,E)}interpolationFactor(s,u,f){return this.interpolationType?Io.interpolationFactor(this.interpolationType,s,u,f):0}}function ld(l,s){const u=qa(l,s);if("error"===u.result)return u;const f=u.value.expression,_=Fu(f);if(!_&&!$l(s))return la([new Vi("","data expressions not supported")]);const x=aa(f,["zoom"]);if(!x&&!uo(s))return la([new Vi("","zoom expressions not supported")]);const E=ua(f);return E||x?E instanceof Vi?la([E]):E instanceof Io&&!Hu(s)?la([new Vi("",'"interpolate" expressions cannot be used with this property')]):Rt(E?new Bc(_?"camera":"composite",u.value,E.labels,E instanceof Io?E.interpolation:void 0):new zc(_?"constant":"source",u.value)):la([new Vi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class To{constructor(s,u){this._parameters=s,this._specification=u,Bi(this,jm(this._parameters,this._specification))}static deserialize(s){return new To(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function ua(l){let s=null;if(l instanceof zu)s=ua(l.result);else if(l instanceof td){for(const u of l.args)if(s=ua(u),s)break}else(l instanceof Bn||l instanceof Io)&&l.input instanceof Me&&"zoom"===l.input.name&&(s=l);return s instanceof Vi||l.eachChild(u=>{const f=ua(u);f instanceof Vi?s=f:!s&&f?s=new Vi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&f&&s!==f&&(s=new Vi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function Ao(l){const s=l.key,u=l.value,f=l.valueSpec||{},_=l.objectElementValidators||{},x=l.style,E=l.styleSpec,M=l.validateSpec;let A=[];const F=Un(u);if("object"!==F)return[new Pe(s,u,`object expected, ${F} found`)];for(const O in u){const B=O.split(".")[0],H=f[B]||f["*"];let q;if(_[B])q=_[B];else if(f[B])q=M;else if(_["*"])q=_["*"];else{if(!f["*"]){A.push(new Pe(s,u[O],`unknown property "${O}"`));continue}q=M}A=A.concat(q({key:(s&&`${s}.`)+O,value:u[O],valueSpec:H,style:x,styleSpec:E,object:u,objectKey:O,validateSpec:M},u))}for(const O in f)_[O]||f[O].required&&void 0===f[O].default&&void 0===u[O]&&A.push(new Pe(s,u,`missing required property "${O}"`));return A}function Vs(l){const s=l.value,u=l.valueSpec,f=l.style,_=l.styleSpec,x=l.key,E=l.arrayElementValidator||l.validateSpec;if("array"!==Un(s))return[new Pe(x,s,`array expected, ${Un(s)} found`)];if(u.length&&s.length!==u.length)return[new Pe(x,s,`array length ${u.length} expected, length ${s.length} found`)];if(u["min-length"]&&s.lengthf.maximum?[new Pe(s,u,`${u} is greater than the maximum value ${f.maximum}`)]:[]}function ud(l){const s=l.valueSpec,u=Vn(l.value.type);let f,_,x,E={};const M="categorical"!==u&&void 0===l.value.property,A=!M,F="array"===Un(l.value.stops)&&"array"===Un(l.value.stops[0])&&"object"===Un(l.value.stops[0][0]),O=Ao({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function(q){if("identity"===u)return[new Pe(q.key,q.value,'identity function may not have a "stops" property')];let W=[];const se=q.value;return W=W.concat(Vs({key:q.key,value:se,valueSpec:q.valueSpec,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,arrayElementValidator:B})),"array"===Un(se)&&0===se.length&&W.push(new Pe(q.key,se,"array must have at least one stop")),W},default:function(q){return q.validateSpec({key:q.key,value:q.value,valueSpec:s,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec})}}});return"identity"===u&&M&&O.push(new Pe(l.key,l.value,'missing required property "property"')),"identity"===u||l.value.stops||O.push(new Pe(l.key,l.value,'missing required property "stops"')),"exponential"===u&&l.valueSpec.expression&&!Hu(l.valueSpec)&&O.push(new Pe(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(A&&!$l(l.valueSpec)?O.push(new Pe(l.key,l.value,"property functions not supported")):M&&!uo(l.valueSpec)&&O.push(new Pe(l.key,l.value,"zoom functions not supported"))),"categorical"!==u&&!F||void 0!==l.value.property||O.push(new Pe(l.key,l.value,'"property" property is required')),O;function B(q){let W=[];const se=q.value,oe=q.key;if("array"!==Un(se))return[new Pe(oe,se,`array expected, ${Un(se)} found`)];if(2!==se.length)return[new Pe(oe,se,`array length 2 expected, length ${se.length} found`)];if(F){if("object"!==Un(se[0]))return[new Pe(oe,se,`object expected, ${Un(se[0])} found`)];if(void 0===se[0].zoom)return[new Pe(oe,se,"object stop key must have zoom")];if(void 0===se[0].value)return[new Pe(oe,se,"object stop key must have value")];if(x&&x>Vn(se[0].zoom))return[new Pe(oe,se[0].zoom,"stop zoom values must appear in ascending order")];Vn(se[0].zoom)!==x&&(x=Vn(se[0].zoom),_=void 0,E={}),W=W.concat(Ao({key:`${oe}[0]`,value:se[0],valueSpec:{zoom:{}},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,objectElementValidators:{zoom:cd,value:H}}))}else W=W.concat(H({key:`${oe}[0]`,value:se[0],valueSpec:{},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec},se));return Cn(ps(se[1]))?W.concat([new Pe(`${oe}[1]`,se[1],"expressions are not allowed in function stops.")]):W.concat(q.validateSpec({key:`${oe}[1]`,value:se[1],valueSpec:s,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec}))}function H(q,W){const se=Un(q.value),oe=Vn(q.value),be=null!==q.value?q.value:W;if(f){if(se!==f)return[new Pe(q.key,be,`${se} stop domain type must match previous stop domain type ${f}`)]}else f=se;if("number"!==se&&"string"!==se&&"boolean"!==se)return[new Pe(q.key,be,"stop domain value must be a number, string, or boolean")];if("number"!==se&&"categorical"!==u){let Ce=`number expected, ${se} found`;return $l(s)&&void 0===u&&(Ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pe(q.key,be,Ce)]}return"categorical"!==u||"number"!==se||isFinite(oe)&&Math.floor(oe)===oe?"categorical"!==u&&"number"===se&&void 0!==_&&oe<_?[new Pe(q.key,be,"stop domain values must appear in ascending order")]:(_=oe,"categorical"===u&&oe in E?[new Pe(q.key,be,"stop domain values must be unique")]:(E[oe]=!0,[])):[new Pe(q.key,be,`integer expected, found ${oe}`)]}}function Za(l){const s=("property"===l.expressionContext?ld:qa)(ps(l.value),l.valueSpec);if("error"===s.result)return s.value.map(f=>new Pe(`${l.key}${f.key}`,l.value,f.message));const u=s.value.expression||s.value._styleExpression.expression;if("property"===l.expressionContext&&"text-font"===l.propertyKey&&!u.outputDefined())return[new Pe(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===l.expressionContext&&"layout"===l.propertyType&&!ja(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===l.expressionContext&&!ja(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&0===l.expressionContext.indexOf("cluster")){if(!aa(u,["zoom","feature-state"]))return[new Pe(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===l.expressionContext&&!Fu(u))return[new Pe(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ai(l){const s=l.key,u=l.value,f=l.valueSpec,_=[];return Array.isArray(f.values)?-1===f.values.indexOf(Vn(u))&&_.push(new Pe(s,u,`expected one of [${f.values.join(", ")}], ${JSON.stringify(u)} found`)):-1===Object.keys(f.values).indexOf(Vn(u))&&_.push(new Pe(s,u,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(u)} found`)),_}function qu(l){if(!0===l||!1===l)return!0;if(!Array.isArray(l)||0===l.length)return!1;switch(l[0]){case"has":return l.length>=2&&"$id"!==l[1]&&"$type"!==l[1];case"in":return l.length>=3&&("string"!=typeof l[1]||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==l.length||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const s of l.slice(1))if(!qu(s)&&"boolean"!=typeof s)return!1;return!0;default:return!0}}const zf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Lt(l){if(null==l)return{filter:()=>!0,needGeometry:!1};qu(l)||(l=Xr(l));const s=qa(l,zf);if("error"===s.result)throw new Error(s.value.map(u=>`${u.key}: ${u.message}`).join(", "));return{filter:(u,f,_)=>s.value.evaluate(u,f,{},_),needGeometry:Nt(l)}}function ji(l,s){return ls?1:0}function Nt(l){if(!Array.isArray(l))return!1;if("within"===l[0])return!0;for(let s=1;s"===s||"<="===s||">="===s?kt(l[1],l[2],s):"any"===s?(u=l.slice(1),["any"].concat(u.map(Xr))):"all"===s?["all"].concat(l.slice(1).map(Xr)):"none"===s?["all"].concat(l.slice(1).map(Xr).map(rn)):"in"===s?Us(l[1],l.slice(2)):"!in"===s?rn(Us(l[1],l.slice(2))):"has"===s?cn(l[1]):"!has"===s?rn(cn(l[1])):"within"!==s||l;var u}function kt(l,s,u){switch(l){case"$type":return[`filter-type-${u}`,s];case"$id":return[`filter-id-${u}`,s];default:return[`filter-${u}`,l,s]}}function Us(l,s){if(0===s.length)return!1;switch(l){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(u=>typeof u!=typeof s[0])?["filter-in-large",l,["literal",s.sort(ji)]]:["filter-in-small",l,["literal",s]]}}function cn(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function rn(l){return["!",l]}function ut(l){return qu(ps(l.value))?Za(Bi({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wt(l)}function Wt(l){const s=l.value,u=l.key;if("array"!==Un(s))return[new Pe(u,s,`array expected, ${Un(s)} found`)];const f=l.styleSpec;let _,x=[];if(s.length<1)return[new Pe(u,s,"filter array must have at least 1 element")];switch(x=x.concat(ai({key:`${u}[0]`,value:s[0],valueSpec:f.filter_operator,style:l.style,styleSpec:l.styleSpec})),Vn(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"===Vn(s[1])&&x.push(new Pe(u,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":3!==s.length&&x.push(new Pe(u,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(_=Un(s[1]),"string"!==_&&x.push(new Pe(`${u}[1]`,s[1],`string expected, ${_} found`)));for(let E=2;E{F in u&&s.push(new Pe(f,u[F],`"${F}" is prohibited for ref layers`))}),_.layers.forEach(F=>{Vn(F.id)===M&&(A=F)}),A?A.ref?s.push(new Pe(f,u.ref,"ref cannot reference another ref layer")):E=Vn(A.type):s.push(new Pe(f,u.ref,`ref layer "${M}" not found`))}else if("background"!==E)if(u.source){const A=_.sources&&_.sources[u.source],F=A&&Vn(A.type);A?"vector"===F&&"raster"===E?s.push(new Pe(f,u.source,`layer "${u.id}" requires a raster source`)):"raster"===F&&"raster"!==E?s.push(new Pe(f,u.source,`layer "${u.id}" requires a vector source`)):"vector"!==F||u["source-layer"]?"raster-dem"===F&&"hillshade"!==E?s.push(new Pe(f,u.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==E||!u.paint||!u.paint["line-gradient"]||"geojson"===F&&A.lineMetrics||s.push(new Pe(f,u,`layer "${u.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new Pe(f,u,`layer "${u.id}" must specify a "source-layer"`)):s.push(new Pe(f,u.source,`source "${u.source}" not found`))}else s.push(new Pe(f,u,'missing required property "source"'));return s=s.concat(Ao({key:f,value:u,valueSpec:x.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${f}.type`,value:u.type,valueSpec:x.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:u,objectKey:"type"}),filter:ut,layout:A=>Ao({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>ha(Bi({layerType:E},F))}}),paint:A=>Ao({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>Hi(Bi({layerType:E},F))}})}})),s}function Gi(l){const s=l.value,u=l.key,f=Un(s);return"string"!==f?[new Pe(u,s,`string expected, ${f} found`)]:[]}const _r={promoteId:function({key:l,value:s}){if("string"===Un(s))return Gi({key:l,value:s});{const u=[];for(const f in s)u.push(...Gi({key:`${l}.${f}`,value:s[f]}));return u}}};function Wa(l){const s=l.value,u=l.key,f=l.styleSpec,_=l.style,x=l.validateSpec;if(!s.type)return[new Pe(u,s,'"type" is required')];const E=Vn(s.type);let M;switch(E){case"vector":case"raster":case"raster-dem":return M=Ao({key:u,value:s,valueSpec:f[`source_${E.replace("-","_")}`],style:l.style,styleSpec:f,objectElementValidators:_r,validateSpec:x}),M;case"geojson":if(M=Ao({key:u,value:s,valueSpec:f.source_geojson,style:_,styleSpec:f,validateSpec:x,objectElementValidators:_r}),s.cluster)for(const A in s.clusterProperties){const[F,O]=s.clusterProperties[A],B="string"==typeof F?[F,["accumulated"],["get",A]]:F;M.push(...Za({key:`${u}.${A}.map`,value:O,validateSpec:x,expressionContext:"cluster-map"})),M.push(...Za({key:`${u}.${A}.reduce`,value:B,validateSpec:x,expressionContext:"cluster-reduce"}))}return M;case"video":return Ao({key:u,value:s,valueSpec:f.source_video,style:_,validateSpec:x,styleSpec:f});case"image":return Ao({key:u,value:s,valueSpec:f.source_image,style:_,validateSpec:x,styleSpec:f});case"canvas":return[new Pe(u,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ai({key:`${u}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,validateSpec:x,styleSpec:f})}}function Xa(l){const s=l.value,u=l.styleSpec,f=u.light,_=l.style;let x=[];const E=Un(s);if(void 0===s)return x;if("object"!==E)return x=x.concat([new Pe("light",s,`object expected, ${E} found`)]),x;for(const M in s){const A=M.match(/^(.*)-transition$/);x=x.concat(A&&f[A[1]]&&f[A[1]].transition?l.validateSpec({key:M,value:s[M],valueSpec:u.transition,validateSpec:l.validateSpec,style:_,styleSpec:u}):f[M]?l.validateSpec({key:M,value:s[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,s[M],`unknown property "${M}"`)])}return x}function Xt(l){const s=l.value,u=l.styleSpec,f=u.terrain,_=l.style;let x=[];const E=Un(s);if(void 0===s)return x;if("object"!==E)return x=x.concat([new Pe("terrain",s,`object expected, ${E} found`)]),x;for(const M in s)x=x.concat(f[M]?l.validateSpec({key:M,value:s[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,s[M],`unknown property "${M}"`)]);return x}function Vc(l){let s=[];const u=l.value,f=l.key;if(Array.isArray(u)){const _=[],x=[];for(const E in u)u[E].id&&_.includes(u[E].id)&&s.push(new Pe(f,u,`all the sprites' ids must be unique, but ${u[E].id} is duplicated`)),_.push(u[E].id),u[E].url&&x.includes(u[E].url)&&s.push(new Pe(f,u,`all the sprites' URLs must be unique, but ${u[E].url} is duplicated`)),x.push(u[E].url),s=s.concat(Ao({key:`${f}[${E}]`,value:u[E],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return s}return Gi({key:f,value:u})}const Ya={"*":()=>[],array:Vs,boolean:function(l){const s=l.value,u=l.key,f=Un(s);return"boolean"!==f?[new Pe(u,s,`boolean expected, ${f} found`)]:[]},number:cd,color:function(l){const s=l.key,u=l.value,f=Un(u);return"string"!==f?[new Pe(s,u,`color expected, ${f} found`)]:null===oa(u)?[new Pe(s,u,`color expected, "${u}" found`)]:[]},constants:za,enum:ai,filter:ut,function:ud,layer:Ur,object:Ao,source:Wa,light:Xa,terrain:Xt,string:Gi,formatted:function(l){return 0===Gi(l).length?[]:Za(l)},resolvedImage:function(l){return 0===Gi(l).length?[]:Za(l)},padding:function(l){const s=l.key,u=l.value;if("array"===Un(u)){if(u.length<1||u.length>4)return[new Pe(s,u,`padding requires 1 to 4 values; ${u.length} values found`)];const f={type:"number"};let _=[];for(let x=0;x[]}})),l.constants&&(u=u.concat(za({key:"constants",value:l.constants,style:l,styleSpec:s,validateSpec:Ka}))),Ja(u)}function ho(l){return function(s){return l({...s,validateSpec:Ka})}}function Ja(l){return[].concat(l).sort((s,u)=>s.line-u.line)}function $r(l){return function(...s){return Ja(l.apply(this,s))}}cr.source=$r(ho(Wa)),cr.sprite=$r(ho(Vc)),cr.glyphs=$r(ho(da)),cr.light=$r(ho(Xa)),cr.terrain=$r(ho(Xt)),cr.layer=$r(ho(Ur)),cr.filter=$r(ho(ut)),cr.paintProperty=$r(ho(Hi)),cr.layoutProperty=$r(ho(ha));const Yo=cr,hd=Yo.light,$n=Yo.paintProperty,Gm=Yo.layoutProperty;function dd(l,s){let u=!1;if(s&&s.length)for(const f of s)l.fire(new yr(new Error(f.message))),u=!0;return u}class $s{constructor(s,u,f){const _=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const E=new Int32Array(this.arrayBuffer);s=E[0],this.d=(u=E[1])+2*(f=E[2]);for(let A=0;A=B[W+0]&&_>=B[W+1])?(M[q]=!0,E.push(O[q])):M[q]=!1}}}}_forEachCell(s,u,f,_,x,E,M,A){const F=this._convertToCellCoord(s),O=this._convertToCellCoord(u),B=this._convertToCellCoord(f),H=this._convertToCellCoord(_);for(let q=F;q<=B;q++)for(let W=O;W<=H;W++){const se=this.d*W+q;if((!A||A(this._convertFromCellCoord(q),this._convertFromCellCoord(W),this._convertFromCellCoord(q+1),this._convertFromCellCoord(W+1)))&&x.call(this,s,u,f,_,se,E,M,A))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,u=3+this.cells.length+1+1;let f=0;for(let E=0;E=0)continue;const E=l[x];_[x]=_s[f].shallow.indexOf(x)>=0?E:fo(E,s)}l instanceof Error&&(_.message=l.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==f&&(_.$name=f),_}throw new Error("can't serialize object of type "+typeof l)}function Er(l){if(null==l||"boolean"==typeof l||"number"==typeof l||"string"==typeof l||l instanceof Boolean||l instanceof Number||l instanceof String||l instanceof Date||l instanceof RegExp||l instanceof Blob||fa(l)||oo(l)||ArrayBuffer.isView(l)||l instanceof ImageData)return l;if(Array.isArray(l))return l.map(Er);if("object"==typeof l){const s=l.$name||"Object";if(!_s[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:u}=_s[s];if(!u)throw new Error(`can't deserialize unregistered class ${s}`);if(u.deserialize)return u.deserialize(l);const f=Object.create(u.prototype);for(const _ of Object.keys(l)){if("$name"===_)continue;const x=l[_];f[_]=_s[s].shallow.indexOf(_)>=0?x:Er(x)}return f}throw new Error("can't deserialize object of type "+typeof l)}class Bf{constructor(){this.first=!0}update(s,u){const f=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=u):this.lastFloorZooml>=128&&l<=255,Arabic:l=>l>=1536&&l<=1791,"Arabic Supplement":l=>l>=1872&&l<=1919,"Arabic Extended-A":l=>l>=2208&&l<=2303,"Hangul Jamo":l=>l>=4352&&l<=4607,"Unified Canadian Aboriginal Syllabics":l=>l>=5120&&l<=5759,Khmer:l=>l>=6016&&l<=6143,"Unified Canadian Aboriginal Syllabics Extended":l=>l>=6320&&l<=6399,"General Punctuation":l=>l>=8192&&l<=8303,"Letterlike Symbols":l=>l>=8448&&l<=8527,"Number Forms":l=>l>=8528&&l<=8591,"Miscellaneous Technical":l=>l>=8960&&l<=9215,"Control Pictures":l=>l>=9216&&l<=9279,"Optical Character Recognition":l=>l>=9280&&l<=9311,"Enclosed Alphanumerics":l=>l>=9312&&l<=9471,"Geometric Shapes":l=>l>=9632&&l<=9727,"Miscellaneous Symbols":l=>l>=9728&&l<=9983,"Miscellaneous Symbols and Arrows":l=>l>=11008&&l<=11263,"CJK Radicals Supplement":l=>l>=11904&&l<=12031,"Kangxi Radicals":l=>l>=12032&&l<=12255,"Ideographic Description Characters":l=>l>=12272&&l<=12287,"CJK Symbols and Punctuation":l=>l>=12288&&l<=12351,Hiragana:l=>l>=12352&&l<=12447,Katakana:l=>l>=12448&&l<=12543,Bopomofo:l=>l>=12544&&l<=12591,"Hangul Compatibility Jamo":l=>l>=12592&&l<=12687,Kanbun:l=>l>=12688&&l<=12703,"Bopomofo Extended":l=>l>=12704&&l<=12735,"CJK Strokes":l=>l>=12736&&l<=12783,"Katakana Phonetic Extensions":l=>l>=12784&&l<=12799,"Enclosed CJK Letters and Months":l=>l>=12800&&l<=13055,"CJK Compatibility":l=>l>=13056&&l<=13311,"CJK Unified Ideographs Extension A":l=>l>=13312&&l<=19903,"Yijing Hexagram Symbols":l=>l>=19904&&l<=19967,"CJK Unified Ideographs":l=>l>=19968&&l<=40959,"Yi Syllables":l=>l>=40960&&l<=42127,"Yi Radicals":l=>l>=42128&&l<=42191,"Hangul Jamo Extended-A":l=>l>=43360&&l<=43391,"Hangul Syllables":l=>l>=44032&&l<=55215,"Hangul Jamo Extended-B":l=>l>=55216&&l<=55295,"Private Use Area":l=>l>=57344&&l<=63743,"CJK Compatibility Ideographs":l=>l>=63744&&l<=64255,"Arabic Presentation Forms-A":l=>l>=64336&&l<=65023,"Vertical Forms":l=>l>=65040&&l<=65055,"CJK Compatibility Forms":l=>l>=65072&&l<=65103,"Small Form Variants":l=>l>=65104&&l<=65135,"Arabic Presentation Forms-B":l=>l>=65136&&l<=65279,"Halfwidth and Fullwidth Forms":l=>l>=65280&&l<=65519};function po(l){for(const s of l)if(jl(s.charCodeAt(0)))return!0;return!1}function fd(l){for(const s of l)if(!Zu(s.charCodeAt(0)))return!1;return!0}function Zu(l){return!(Xe.Arabic(l)||Xe["Arabic Supplement"](l)||Xe["Arabic Extended-A"](l)||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l))}function jl(l){return!(746!==l&&747!==l&&(l<4352||!(Xe["Bopomofo Extended"](l)||Xe.Bopomofo(l)||Xe["CJK Compatibility Forms"](l)&&!(l>=65097&&l<=65103)||Xe["CJK Compatibility Ideographs"](l)||Xe["CJK Compatibility"](l)||Xe["CJK Radicals Supplement"](l)||Xe["CJK Strokes"](l)||!(!Xe["CJK Symbols and Punctuation"](l)||l>=12296&&l<=12305||l>=12308&&l<=12319||12336===l)||Xe["CJK Unified Ideographs Extension A"](l)||Xe["CJK Unified Ideographs"](l)||Xe["Enclosed CJK Letters and Months"](l)||Xe["Hangul Compatibility Jamo"](l)||Xe["Hangul Jamo Extended-A"](l)||Xe["Hangul Jamo Extended-B"](l)||Xe["Hangul Jamo"](l)||Xe["Hangul Syllables"](l)||Xe.Hiragana(l)||Xe["Ideographic Description Characters"](l)||Xe.Kanbun(l)||Xe["Kangxi Radicals"](l)||Xe["Katakana Phonetic Extensions"](l)||Xe.Katakana(l)&&12540!==l||!(!Xe["Halfwidth and Fullwidth Forms"](l)||65288===l||65289===l||65293===l||l>=65306&&l<=65310||65339===l||65341===l||65343===l||l>=65371&&l<=65503||65507===l||l>=65512&&l<=65519)||!(!Xe["Small Form Variants"](l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||Xe["Unified Canadian Aboriginal Syllabics"](l)||Xe["Unified Canadian Aboriginal Syllabics Extended"](l)||Xe["Vertical Forms"](l)||Xe["Yijing Hexagram Symbols"](l)||Xe["Yi Syllables"](l)||Xe["Yi Radicals"](l))))}function ko(l){return!(jl(l)||(s=l,Xe["Latin-1 Supplement"](s)&&(167===s||169===s||174===s||177===s||188===s||189===s||190===s||215===s||247===s)||Xe["General Punctuation"](s)&&(8214===s||8224===s||8225===s||8240===s||8241===s||8251===s||8252===s||8258===s||8263===s||8264===s||8265===s||8273===s)||Xe["Letterlike Symbols"](s)||Xe["Number Forms"](s)||Xe["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||9003===s||s>=9085&&s<=9114||s>=9150&&s<=9165||9167===s||s>=9169&&s<=9179||s>=9186&&s<=9215)||Xe["Control Pictures"](s)&&9251!==s||Xe["Optical Character Recognition"](s)||Xe["Enclosed Alphanumerics"](s)||Xe["Geometric Shapes"](s)||Xe["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||Xe["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||Xe["CJK Symbols and Punctuation"](s)||Xe.Katakana(s)||Xe["Private Use Area"](s)||Xe["CJK Compatibility Forms"](s)||Xe["Small Form Variants"](s)||Xe["Halfwidth and Fullwidth Forms"](s)||8734===s||8756===s||8757===s||s>=9984&&s<=10087||s>=10102&&s<=10131||65532===s||65533===s));var s}function Uc(l){return l>=1424&&l<=2303||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l)}function pd(l,s){return!(!s&&Uc(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||Xe.Khmer(l))}function Po(l){for(const s of l)if(Uc(s.charCodeAt(0)))return!0;return!1}const Hl="deferred",Vf="loading",Uf="loaded";let $f=null,mo="unavailable",js=null;const qm=function(l){l&&"string"==typeof l&&l.indexOf("NetworkError")>-1&&(mo="error"),$f&&$f(l)};function Wu(){jf.fire(new ra("pluginStateChange",{pluginStatus:mo,pluginURL:js}))}const jf=new Qn,Gl=function(){return mo},Zm=function(){if(mo!==Hl||!js)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");mo=Vf,Wu(),js&&La({url:js},l=>{l?qm(l):(mo=Uf,Wu())})},go={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>mo===Uf||null!=go.applyArabicShaping,isLoading:()=>mo===Vf,setState(l){if(!Mo())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");mo=l.pluginStatus,js=l.pluginURL},isParsed(){if(!Mo())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=go.applyArabicShaping&&null!=go.processBidirectionalText&&null!=go.processStyledBidirectionalText},getPluginURL(){if(!Mo())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return js}};class ur{constructor(s,u){this.zoom=s,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Bf,this.transition={})}isSupportedScript(s){return function(u,f){for(const _ of u)if(!pd(_.charCodeAt(0),f))return!1;return!0}(s,go.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,u=s-Math.floor(s),f=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*u}}}class $c{constructor(s,u){this.property=s,this.value=u,this.expression=function(f,_){if(Wo(f))return new To(f,_);if(Cn(f)){const x=ld(f,_);if("error"===x.result)throw new Error(x.value.map(E=>`${E.key}: ${E.message}`).join(", "));return x.value}{let x=f;return"color"===_.type&&"string"==typeof f?x=Sn.parse(f):"padding"!==_.type||"number"!=typeof f&&!Array.isArray(f)||(x=Vr.parse(f)),{kind:"constant",evaluate:()=>x}}}(void 0===u?s.specification.default:u,s.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(s,u,f){return this.property.possiblyEvaluate(this,s,u,f)}}class md{constructor(s){this.property=s,this.value=new $c(s,void 0)}transitioned(s,u){return new Yu(this.property,this.value,u,zi({},s.transition,this.transition),s.now)}untransitioned(){return new Yu(this.property,this.value,null,{},0)}}class Xu{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return wi(this._values[s].value.value)}setValue(s,u){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new md(this._values[s].property)),this._values[s].value=new $c(this._values[s].property,null===u?void 0:wi(u))}getTransition(s){return wi(this._values[s].transition)}setTransition(s,u){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new md(this._values[s].property)),this._values[s].transition=wi(u)||void 0}serialize(){const s={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(s[u]=f);const _=this.getTransition(u);void 0!==_&&(s[`${u}-transition`]=_)}return s}transitioned(s,u){const f=new gd(this._properties);for(const _ of Object.keys(this._values))f._values[_]=this._values[_].transitioned(s,u._values[_]);return f}untransitioned(){const s=new gd(this._properties);for(const u of Object.keys(this._values))s._values[u]=this._values[u].untransitioned();return s}}class Yu{constructor(s,u,f,_,x){this.property=s,this.value=u,this.begin=x+_.delay||0,this.end=this.begin+_.duration||0,s.specification.transition&&(_.delay||_.duration)&&(this.prior=f)}possiblyEvaluate(s,u,f){const _=s.now||0,x=this.value.possiblyEvaluate(s,u,f),E=this.prior;if(E){if(_>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(_=1)return 1;const F=A*A,O=F*A;return 4*(A<.5?O:3*(A-F)+O-.75)}(M))}}return x}}class gd{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,u,f){const _=new bs(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,u,f);return _}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class yd{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}getValue(s){return wi(this._values[s].value)}setValue(s,u){this._values[s]=new $c(this._values[s].property,null===u?void 0:wi(u))}serialize(){const s={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(s[u]=f)}return s}possiblyEvaluate(s,u,f){const _=new bs(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,u,f);return _}}class vs{constructor(s,u,f){this.property=s,this.value=u,this.parameters=f}isConstant(){return"constant"===this.value.kind}constantOr(s){return"constant"===this.value.kind?this.value.value:s}evaluate(s,u,f,_){return this.property.evaluate(this.value,this.parameters,s,u,f,_)}}class bs{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class wt{constructor(s){this.specification=s}possiblyEvaluate(s,u){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(u)}interpolate(s,u,f){const _=Mn[this.specification.type];return _?_(s,u,f):s}}class yt{constructor(s,u){this.specification=s,this.overrides=u}possiblyEvaluate(s,u,f,_){return new vs(this,"constant"===s.expression.kind||"camera"===s.expression.kind?{kind:"constant",value:s.expression.evaluate(u,null,{},f,_)}:s.expression,u)}interpolate(s,u,f){if("constant"!==s.value.kind||"constant"!==u.value.kind)return s;if(void 0===s.value.value||void 0===u.value.value)return new vs(this,{kind:"constant",value:void 0},s.parameters);const _=Mn[this.specification.type];return _?new vs(this,{kind:"constant",value:_(s.value.value,u.value.value,f)},s.parameters):s}evaluate(s,u,f,_,x,E){return"constant"===s.kind?s.value:s.evaluate(u,f,_,x,E)}}class Qa extends yt{possiblyEvaluate(s,u,f,_){if(void 0===s.value)return new vs(this,{kind:"constant",value:void 0},u);if("constant"===s.expression.kind){const x=s.expression.evaluate(u,null,{},f,_),E="resolvedImage"===s.property.specification.type&&"string"!=typeof x?x.name:x,M=this._calculate(E,E,E,u);return new vs(this,{kind:"constant",value:M},u)}if("camera"===s.expression.kind){const x=this._calculate(s.expression.evaluate({zoom:u.zoom-1}),s.expression.evaluate({zoom:u.zoom}),s.expression.evaluate({zoom:u.zoom+1}),u);return new vs(this,{kind:"constant",value:x},u)}return new vs(this,s.expression,u)}evaluate(s,u,f,_,x,E){if("source"===s.kind){const M=s.evaluate(u,f,_,x,E);return this._calculate(M,M,M,u)}return"composite"===s.kind?this._calculate(s.evaluate({zoom:Math.floor(u.zoom)-1},f,_),s.evaluate({zoom:Math.floor(u.zoom)},f,_),s.evaluate({zoom:Math.floor(u.zoom)+1},f,_),u):s.value}_calculate(s,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:u}:{from:f,to:u}}interpolate(s){return s}}class _d{constructor(s){this.specification=s}possiblyEvaluate(s,u,f,_){if(void 0!==s.value){if("constant"===s.expression.kind){const x=s.expression.evaluate(u,null,{},f,_);return this._calculate(x,x,x,u)}return this._calculate(s.expression.evaluate(new ur(Math.floor(u.zoom-1),u)),s.expression.evaluate(new ur(Math.floor(u.zoom),u)),s.expression.evaluate(new ur(Math.floor(u.zoom+1),u)),u)}}_calculate(s,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:u}:{from:f,to:u}}interpolate(s){return s}}class vd{constructor(s){this.specification=s}possiblyEvaluate(s,u,f,_){return!!s.expression.evaluate(u,null,{},f,_)}interpolate(){return!1}}class Di{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const u in s){const f=s[u];f.specification.overridable&&this.overridableProperties.push(u);const _=this.defaultPropertyValues[u]=new $c(f,void 0),x=this.defaultTransitionablePropertyValues[u]=new md(f);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=_.possiblyEvaluate({})}}}ct("DataDrivenProperty",yt),ct("DataConstantProperty",wt),ct("CrossFadedDataDrivenProperty",Qa),ct("CrossFadedProperty",_d),ct("ColorRampProperty",vd);const jc="-transition";class Ko extends Qn{constructor(s,u){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==s.type&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,"background"!==s.type&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),u.layout&&(this._unevaluatedLayout=new yd(u.layout)),u.paint)){this._transitionablePaint=new Xu(u.paint);for(const f in s.paint)this.setPaintProperty(f,s.paint[f],{validate:!1});for(const f in s.layout)this.setLayoutProperty(f,s.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new bs(u.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return"visibility"===s?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,u,f={}){null!=u&&this._validate(Gm,`layers.${this.id}.layout.${s}`,s,u,f)||("visibility"!==s?this._unevaluatedLayout.setValue(s,u):this.visibility=u)}getPaintProperty(s){return s.endsWith(jc)?this._transitionablePaint.getTransition(s.slice(0,-jc.length)):this._transitionablePaint.getValue(s)}setPaintProperty(s,u,f={}){if(null!=u&&this._validate($n,`layers.${this.id}.paint.${s}`,s,u,f))return!1;if(s.endsWith(jc))return this._transitionablePaint.setTransition(s.slice(0,-jc.length),u||void 0),!1;{const _=this._transitionablePaint._values[s],x="cross-faded-data-driven"===_.property.specification["property-type"],E=_.value.isDataDriven(),M=_.value;this._transitionablePaint.setValue(s,u),this._handleSpecialPaintPropertyUpdate(s);const A=this._transitionablePaint._values[s].value;return A.isDataDriven()||E||x||this._handleOverridablePaintPropertyUpdate(s,M,A)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,u,f){return!1}isHidden(s){return!!(this.minzoom&&s=this.maxzoom)||"none"===this.visibility}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,u){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,u)}serialize(){const s={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&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),Rl(s,(u,f)=>!(void 0===u||"layout"===f&&!Object.keys(u).length||"paint"===f&&!Object.keys(u).length))}_validate(s,u,f,_,x={}){return(!x||!1!==x.validate)&&dd(this,s.call(Yo,{key:u,layerType:this.type,objectKey:f,value:_,styleSpec:Ae,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const u=this.paint.get(s);if(u instanceof vs&&$l(u.property.specification)&&("source"===u.value.kind||"composite"===u.value.kind)&&u.value.isStateDependent)return!0}return!1}}const bd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ku{constructor(s,u){this._structArray=s,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class In{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,u){return s._trim(),u&&(s.isTransferred=!0,u.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const u=Object.create(this.prototype);return u.arrayBuffer=s.arrayBuffer,u.length=s.length,u.capacity=s.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Dr(l,s=1){let u=0,f=0;return{members:l.map(_=>{const x=bd[_.type].BYTES_PER_ELEMENT,E=u=Hf(u,Math.max(s,x)),M=_.components||1;return f=Math.max(f,x),u+=x*M,{name:_.name,type:_.type,components:M,offset:E}}),size:Hf(u,Math.max(f,s)),alignment:s}}function Hf(l,s){return Math.ceil(l/s)*s}class el extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.int16[_+0]=u,this.int16[_+1]=f,s}}el.prototype.bytesPerElement=4,ct("StructArrayLayout2i4",el);class Ju extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.int16[x+0]=u,this.int16[x+1]=f,this.int16[x+2]=_,s}}Ju.prototype.bytesPerElement=6,ct("StructArrayLayout3i6",Ju);class Hc extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const E=4*s;return this.int16[E+0]=u,this.int16[E+1]=f,this.int16[E+2]=_,this.int16[E+3]=x,s}}Hc.prototype.bytesPerElement=8,ct("StructArrayLayout4i8",Hc);class Sr extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,E){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,E)}emplace(s,u,f,_,x,E,M){const A=6*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=E,this.int16[A+5]=M,s}}Sr.prototype.bytesPerElement=12,ct("StructArrayLayout2i4i12",Sr);class Gc extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,E){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,E)}emplace(s,u,f,_,x,E,M){const A=4*s,F=8*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.uint8[F+4]=_,this.uint8[F+5]=x,this.uint8[F+6]=E,this.uint8[F+7]=M,s}}Gc.prototype.bytesPerElement=8,ct("StructArrayLayout2i4ub8",Gc);class Qu extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.float32[_+0]=u,this.float32[_+1]=f,s}}Qu.prototype.bytesPerElement=8,ct("StructArrayLayout2f8",Qu);class ql extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,E,M,A,F,O){const B=this.length;return this.resize(B+1),this.emplace(B,s,u,f,_,x,E,M,A,F,O)}emplace(s,u,f,_,x,E,M,A,F,O,B){const H=10*s;return this.uint16[H+0]=u,this.uint16[H+1]=f,this.uint16[H+2]=_,this.uint16[H+3]=x,this.uint16[H+4]=E,this.uint16[H+5]=M,this.uint16[H+6]=A,this.uint16[H+7]=F,this.uint16[H+8]=O,this.uint16[H+9]=B,s}}ql.prototype.bytesPerElement=20,ct("StructArrayLayout10ui20",ql);class Si extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,E,M,A,F,O,B,H){const q=this.length;return this.resize(q+1),this.emplace(q,s,u,f,_,x,E,M,A,F,O,B,H)}emplace(s,u,f,_,x,E,M,A,F,O,B,H,q){const W=12*s;return this.int16[W+0]=u,this.int16[W+1]=f,this.int16[W+2]=_,this.int16[W+3]=x,this.uint16[W+4]=E,this.uint16[W+5]=M,this.uint16[W+6]=A,this.uint16[W+7]=F,this.int16[W+8]=O,this.int16[W+9]=B,this.int16[W+10]=H,this.int16[W+11]=q,s}}Si.prototype.bytesPerElement=24,ct("StructArrayLayout4i4ui4i24",Si);class eh extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.float32[x+0]=u,this.float32[x+1]=f,this.float32[x+2]=_,s}}eh.prototype.bytesPerElement=12,ct("StructArrayLayout3f12",eh);class Zl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.uint32[1*s+0]=u,s}}Zl.prototype.bytesPerElement=4,ct("StructArrayLayout1ul4",Zl);class pa extends In{_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(s,u,f,_,x,E,M,A,F){const O=this.length;return this.resize(O+1),this.emplace(O,s,u,f,_,x,E,M,A,F)}emplace(s,u,f,_,x,E,M,A,F,O){const B=10*s,H=5*s;return this.int16[B+0]=u,this.int16[B+1]=f,this.int16[B+2]=_,this.int16[B+3]=x,this.int16[B+4]=E,this.int16[B+5]=M,this.uint32[H+3]=A,this.uint16[B+8]=F,this.uint16[B+9]=O,s}}pa.prototype.bytesPerElement=20,ct("StructArrayLayout6i1ul2ui20",pa);class Mi extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x,E){const M=this.length;return this.resize(M+1),this.emplace(M,s,u,f,_,x,E)}emplace(s,u,f,_,x,E,M){const A=6*s;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=E,this.int16[A+5]=M,s}}Mi.prototype.bytesPerElement=12,ct("StructArrayLayout2i2i2i12",Mi);class xd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,u,f,_,x){const E=this.length;return this.resize(E+1),this.emplace(E,s,u,f,_,x)}emplace(s,u,f,_,x,E){const M=4*s,A=8*s;return this.float32[M+0]=u,this.float32[M+1]=f,this.float32[M+2]=_,this.int16[A+6]=x,this.int16[A+7]=E,s}}xd.prototype.bytesPerElement=16,ct("StructArrayLayout2f1f2i16",xd);class Wl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const E=12*s,M=3*s;return this.uint8[E+0]=u,this.uint8[E+1]=f,this.float32[M+1]=_,this.float32[M+2]=x,s}}Wl.prototype.bytesPerElement=12,ct("StructArrayLayout2ub2f12",Wl);class th extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=3*s;return this.uint16[x+0]=u,this.uint16[x+1]=f,this.uint16[x+2]=_,s}}th.prototype.bytesPerElement=6,ct("StructArrayLayout3ui6",th);class xs extends In{_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(s,u,f,_,x,E,M,A,F,O,B,H,q,W,se,oe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,s,u,f,_,x,E,M,A,F,O,B,H,q,W,se,oe,be)}emplace(s,u,f,_,x,E,M,A,F,O,B,H,q,W,se,oe,be,Ce){const me=24*s,Ee=12*s,$e=48*s;return this.int16[me+0]=u,this.int16[me+1]=f,this.uint16[me+2]=_,this.uint16[me+3]=x,this.uint32[Ee+2]=E,this.uint32[Ee+3]=M,this.uint32[Ee+4]=A,this.uint16[me+10]=F,this.uint16[me+11]=O,this.uint16[me+12]=B,this.float32[Ee+7]=H,this.float32[Ee+8]=q,this.uint8[$e+36]=W,this.uint8[$e+37]=se,this.uint8[$e+38]=oe,this.uint32[Ee+10]=be,this.int16[me+22]=Ce,s}}xs.prototype.bytesPerElement=48,ct("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",xs);class Hs extends In{_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(s,u,f,_,x,E,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot){const it=this.length;return this.resize(it+1),this.emplace(it,s,u,f,_,x,E,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot)}emplace(s,u,f,_,x,E,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot,it){const Ge=34*s,Et=17*s;return this.int16[Ge+0]=u,this.int16[Ge+1]=f,this.int16[Ge+2]=_,this.int16[Ge+3]=x,this.int16[Ge+4]=E,this.int16[Ge+5]=M,this.int16[Ge+6]=A,this.int16[Ge+7]=F,this.uint16[Ge+8]=O,this.uint16[Ge+9]=B,this.uint16[Ge+10]=H,this.uint16[Ge+11]=q,this.uint16[Ge+12]=W,this.uint16[Ge+13]=se,this.uint16[Ge+14]=oe,this.uint16[Ge+15]=be,this.uint16[Ge+16]=Ce,this.uint16[Ge+17]=me,this.uint16[Ge+18]=Ee,this.uint16[Ge+19]=$e,this.uint16[Ge+20]=Ve,this.uint16[Ge+21]=gt,this.uint16[Ge+22]=Ct,this.uint32[Et+12]=at,this.float32[Et+13]=tt,this.float32[Et+14]=Qe,this.float32[Et+15]=ot,this.float32[Et+16]=it,s}}Hs.prototype.bytesPerElement=68,ct("StructArrayLayout8i15ui1ul4f68",Hs);class Xl extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.float32[1*s+0]=u,s}}Xl.prototype.bytesPerElement=4,ct("StructArrayLayout1f4",Xl);class Vt extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,s,u,f)}emplace(s,u,f,_){const x=4*s;return this.uint32[2*s+0]=u,this.uint16[x+2]=f,this.uint16[x+3]=_,s}}Vt.prototype.bytesPerElement=8,ct("StructArrayLayout1ul2ui8",Vt);class nh extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,u){const f=this.length;return this.resize(f+1),this.emplace(f,s,u)}emplace(s,u,f){const _=2*s;return this.uint16[_+0]=u,this.uint16[_+1]=f,s}}nh.prototype.bytesPerElement=4,ct("StructArrayLayout2ui4",nh);class wd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const u=this.length;return this.resize(u+1),this.emplace(u,s)}emplace(s,u){return this.uint16[1*s+0]=u,s}}wd.prototype.bytesPerElement=2,ct("StructArrayLayout1ui2",wd);class Cd extends In{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,u,f,_)}emplace(s,u,f,_,x){const E=4*s;return this.float32[E+0]=u,this.float32[E+1]=f,this.float32[E+2]=_,this.float32[E+3]=x,s}}Cd.prototype.bytesPerElement=16,ct("StructArrayLayout4f16",Cd);class Gf extends Ku{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Tt(this.anchorPointX,this.anchorPointY)}}Gf.prototype.size=20;class Ed extends pa{get(s){return new Gf(this,s)}}ct("CollisionBoxArray",Ed);class qc extends Ku{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(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}qc.prototype.size=48;class Dd extends xs{get(s){return new qc(this,s)}}ct("PlacedSymbolArray",Dd);class rh extends Ku{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(s){this._structArray.uint32[this._pos4+12]=s}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}rh.prototype.size=68;class He extends Hs{get(s){return new rh(this,s)}}ct("SymbolInstanceArray",He);class en extends Xl{getoffsetX(s){return this.float32[1*s+0]}}ct("GlyphOffsetArray",en);class ma extends Ju{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}ct("SymbolLineVertexArray",ma);class Gs extends Ku{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]}}Gs.prototype.size=8;class Pr extends Vt{get(s){return new Gs(this,s)}}ct("FeatureIndexArray",Pr);class ih extends el{}class qs extends el{}class ws extends el{}class Sd extends Sr{}class oh extends Gc{}class P_ extends Qu{}class ga extends ql{}class g extends Si{}class a extends eh{}class h extends Zl{}class m extends Mi{}class y extends Wl{}class w extends th{}class S extends nh{}const T=Dr([{name:"a_pos",components:2,type:"Int16"}],4),{members:k}=T;class R{constructor(s=[]){this.segments=s}prepareSegment(s,u,f,_){let x=this.segments[this.segments.length-1];return s>R.MAX_VERTEX_ARRAY_LENGTH&&pn(`Max vertices per segment is ${R.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!x||x.vertexLength+s>R.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==_)&&(x={vertexOffset:u.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},void 0!==_&&(x.sortKey=_),this.segments.push(x)),x}get(){return this.segments}destroy(){for(const s of this.segments)for(const u in s.vaos)s.vaos[u].destroy()}static simpleSegment(s,u,f,_){return new R([{vertexOffset:s,primitiveOffset:u,vertexLength:f,primitiveLength:_,vaos:{},sortKey:0}])}}function z(l,s){return 256*(l=Zt(Math.floor(l),0,255))+Zt(Math.floor(s),0,255)}R.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ct("SegmentVector",R);const L=Dr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var j={},Q={get exports(){return j},set exports(l){j=l}},ee={};({get exports(){return ee},set exports(l){ee=l}}).exports=function(l,s){var u,f,_,x,E,M,A,F;for(f=l.length-(u=3&l.length),_=s,E=3432918353,M=461845907,F=0;F>>16)*E&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(A=0,u){case 3:A^=(255&l.charCodeAt(F+2))<<16;case 2:A^=(255&l.charCodeAt(F+1))<<8;case 1:_^=A=(65535&(A=(A=(65535&(A^=255&l.charCodeAt(F)))*E+(((A>>>16)*E&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295}return _^=l.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Y={};({get exports(){return Y},set exports(l){Y=l}}).exports=function(l,s){for(var u,f=l.length,_=s^f,x=0;f>=4;)u=1540483477*(65535&(u=255&l.charCodeAt(x)|(255&l.charCodeAt(++x))<<8|(255&l.charCodeAt(++x))<<16|(255&l.charCodeAt(++x))<<24))+((1540483477*(u>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(u=1540483477*(65535&(u^=u>>>24))+((1540483477*(u>>>16)&65535)<<16)),f-=4,++x;switch(f){case 3:_^=(255&l.charCodeAt(x+2))<<16;case 2:_^=(255&l.charCodeAt(x+1))<<8;case 1:_=1540483477*(65535&(_^=255&l.charCodeAt(x)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var ae=ee,_e=Y;Q.exports=ae,j.murmur3=ae,j.murmur2=_e;class ye{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,u,f,_){this.ids.push(ie(s)),this.positions.push(u,f,_)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const u=ie(s);let f=0,_=this.ids.length-1;for(;f<_;){const E=f+_>>1;this.ids[E]>=u?_=E:f=E+1}const x=[];for(;this.ids[f]===u;)x.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return x}static serialize(s,u){const f=new Float64Array(s.ids),_=new Uint32Array(s.positions);return we(f,_,0,f.length-1),u&&u.push(f.buffer,_.buffer),{ids:f,positions:_}}static deserialize(s){const u=new ye;return u.ids=s.ids,u.positions=s.positions,u.indexed=!0,u}}function ie(l){const s=+l;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:j(String(l))}function we(l,s,u,f){for(;u>1];let x=u-1,E=f+1;for(;;){do{x++}while(l[x]<_);do{E--}while(l[E]>_);if(x>=E)break;De(l,x,E),De(s,3*x,3*E),De(s,3*x+1,3*E+1),De(s,3*x+2,3*E+2)}E-u`u_${_}`),this.type=f}setUniform(s,u,f){s.set(f.constantOr(this.value))}getBinding(s,u,f){return"color"===this.type?new Le(s,u):new ke(s,u)}}class Pt{constructor(s,u){this.uniformNames=u.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=s.tlbr}setUniform(s,u,f,_){const x="u_pattern_to"===_?this.patternTo:"u_pattern_from"===_?this.patternFrom:"u_pixel_ratio_to"===_?this.pixelRatioTo:"u_pixel_ratio_from"===_?this.pixelRatioFrom:null;x&&s.set(x)}getBinding(s,u,f){return"u_pattern"===f.substr(0,9)?new Be(s,u):new ke(s,u)}}class zt{constructor(s,u,f,_){this.expression=s,this.type=f,this.maxValue=0,this.paintVertexAttributes=u.map(x=>({name:`a_${x}`,type:"Float32",components:"color"===f?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(s,u,f,_,x){const E=this.paintVertexArray.length,M=this.expression.evaluate(new ur(0),u,{},_,[],x);this.paintVertexArray.resize(s),this._setPaintValue(E,s,M)}updatePaintArray(s,u,f,_){const x=this.expression.evaluate({zoom:0},f,_);this._setPaintValue(s,u,x)}_setPaintValue(s,u,f){if("color"===this.type){const _=ze(f);for(let x=s;x`u_${M}_t`),this.type=f,this.useIntegerZoom=_,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=u.map(M=>({name:`a_${M}`,type:"Float32",components:"color"===f?4:2,offset:0})),this.paintVertexArray=new E}populatePaintArray(s,u,f,_,x){const E=this.expression.evaluate(new ur(this.zoom),u,{},_,[],x),M=this.expression.evaluate(new ur(this.zoom+1),u,{},_,[],x),A=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(A,s,E,M)}updatePaintArray(s,u,f,_){const x=this.expression.evaluate({zoom:this.zoom},f,_),E=this.expression.evaluate({zoom:this.zoom+1},f,_);this._setPaintValue(s,u,x,E)}_setPaintValue(s,u,f,_){if("color"===this.type){const x=ze(f),E=ze(_);for(let M=s;M`#define HAS_UNIFORM_${_}`))}return s}getBinderAttributes(){const s=[];for(const u in this.binders){const f=this.binders[u];if(f instanceof zt||f instanceof mt)for(let _=0;_!0)){this.programConfigurations={};for(const _ of s)this.programConfigurations[_.id]=new An(_,u,f);this.needsUpload=!1,this._featureMap=new ye,this._bufferOffset=0}populatePaintArrays(s,u,f,_,x,E){for(const M in this.programConfigurations)this.programConfigurations[M].populatePaintArrays(s,u,_,x,E);void 0!==u.id&&this._featureMap.add(u.id,f,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,u,f,_){for(const x of f)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(s,this._featureMap,u,x,_)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const u in this.programConfigurations)this.programConfigurations[u].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function on(l,s){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[l]||[l.replace(`${s}-`,"").replace(/-/g,"_")]}function Fn(l,s,u){const _={"line-pattern":{source:ga,composite:ga},"fill-pattern":{source:ga,composite:ga},"fill-extrusion-pattern":{source:ga,composite:ga}}[l];return _&&_[u]||{color:{source:Qu,composite:Cd},number:{source:Xl,composite:Qu}}[s][u]}ct("ConstantBinder",ht),ct("CrossFadedConstantBinder",Pt),ct("SourceExpressionBinder",zt),ct("CrossFadedCompositeBinder",Tn),ct("CompositeExpressionBinder",mt),ct("ProgramConfiguration",An,{omit:["_buffers"]}),ct("ProgramConfigurationSet",Ht);var _n=8192;const yo=Math.pow(2,14)-1,Ro=-yo-1;function br(l){const s=_n/l.extent,u=l.loadGeometry();for(let f=0;fE.x+1||AE.y+1)&&pn("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return u}function li(l,s){return{type:l.type,id:l.id,properties:l.properties,geometry:s?br(l):[]}}function Ii(l,s,u,f,_){l.emplaceBack(2*s+(f+1)/2,2*u+(_+1)/2)}class Jo{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new qs,this.indexArray=new w,this.segments=new R,this.programConfigurations=new Ht(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){const _=this.layers[0],x=[];let E=null,M=!1;"circle"===_.type&&(E=_.layout.get("circle-sort-key"),M=!E.isConstant());for(const{feature:A,id:F,index:O,sourceLayerIndex:B}of s){const H=this.layers[0]._featureFilter.needGeometry,q=li(A,H);if(!this.layers[0]._featureFilter.filter(new ur(this.zoom),q,f))continue;const W=M?E.evaluate(q,{},f):void 0,se={id:F,properties:A.properties,type:A.type,sourceLayerIndex:B,index:O,geometry:H?q.geometry:br(A),patterns:{},sortKey:W};x.push(se)}M&&x.sort((A,F)=>A.sortKey-F.sortKey);for(const A of x){const{geometry:F,index:O,sourceLayerIndex:B}=A,H=s[O].feature;this.addFeature(A,F,O,f),u.featureIndex.insert(H,F,O,B,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,k),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,u,f,_){for(const x of u)for(const E of x){const M=E.x,A=E.y;if(M<0||M>=_n||A<0||A>=_n)continue;const F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),O=F.vertexLength;Ii(this.layoutVertexArray,M,A,-1,-1),Ii(this.layoutVertexArray,M,A,1,-1),Ii(this.layoutVertexArray,M,A,1,1),Ii(this.layoutVertexArray,M,A,-1,1),this.indexArray.emplaceBack(O,O+1,O+2),this.indexArray.emplaceBack(O,O+3,O+2),F.vertexLength+=4,F.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,{},_)}}function Fo(l,s){for(let u=0;u1){if(On(l,s))return!0;for(let f=0;f1?u:u.sub(s)._mult(_)._add(s))}function Qo(l,s){let u,f,_,x=!1;for(let E=0;Es.y!=_.y>s.y&&s.x<(_.x-f.x)*(s.y-f.y)/(_.y-f.y)+f.x&&(x=!x)}return x}function Zi(l,s){let u=!1;for(let f=0,_=l.length-1;fs.y!=E.y>s.y&&s.x<(E.x-x.x)*(s.y-x.y)/(E.y-x.y)+x.x&&(u=!u)}return u}function sh(l,s,u){const f=u[0],_=u[2];if(l.x_.x&&s.x>_.x||l.y_.y&&s.y>_.y)return!1;const x=ii(l,s,u[0]);return x!==ii(l,s,u[1])||x!==ii(l,s,u[2])||x!==ii(l,s,u[3])}function ya(l,s,u){const f=s.paint.get(l).value;return"constant"===f.kind?f.value:u.programConfigurations.get(s.id).getMaxValue(l)}function Zs(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function ah(l,s,u,f,_){if(!s[0]&&!s[1])return l;const x=Tt.convert(s)._mult(_);"viewport"===u&&x._rotate(-f);const E=[];for(let M=0;Ml.width||_.height>l.height||u.x>l.width-_.width||u.y>l.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>s.width||_.height>s.height||f.x>s.width-_.width||f.y>s.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const E=l.data,M=s.data;if(E===M)throw new Error("srcData equals dstData, so image is already copied");for(let A=0;A<_.height;A++){const F=((u.y+A)*l.width+u.x)*x,O=((f.y+A)*s.width+f.x)*x;for(let B=0;B<_.width*x;B++)M[O+B]=E[F+B]}return s}class uh{constructor(s,u){ch(this,s,1,u)}resize(s){Td(this,s,1)}clone(){return new uh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,u,f,_,x){Ym(s,u,f,_,x,1)}}class Oo{constructor(s,u){ch(this,s,4,u)}resize(s){Td(this,s,4)}replace(s,u){u?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new Oo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,u,f,_,x){Ym(s,u,f,_,x,4)}}function Km(l){const s={},u=l.resolution||256,f=l.clips?l.clips.length:1,_=l.image||new Oo({width:u,height:f});if(Math.log(u)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${u}`);const x=(E,M,A)=>{s[l.evaluationKey]=A;const F=l.expression.evaluate(s);_.data[E+M+0]=Math.floor(255*F.r/F.a),_.data[E+M+1]=Math.floor(255*F.g/F.a),_.data[E+M+2]=Math.floor(255*F.b/F.a),_.data[E+M+3]=Math.floor(255*F.a)};if(l.clips)for(let E=0,M=0;E80*u){f=x=l[0],_=E=l[1];for(var W=u;Wx&&(x=M),A>E&&(E=A);F=0!==(F=Math.max(x-f,E-_))?32767/F:0}return va(H,q,u,f,_,F,0),q}function Jm(l,s,u,f,_){var x,E;if(_===N_(l,s,u,f)>0)for(x=s;x=s;x-=f)E=e1(x,l[x],l[x+1],E);return E&&tg(E,E.next)&&(Jf(E),E=E.next),E}function Kl(l,s){if(!l)return l;s||(s=l);var u,f=l;do{if(u=!1,f.steiner||!tg(f,f.next)&&0!==nr(f.prev,f,f.next))f=f.next;else{if(Jf(f),(f=s=f.prev)===f.next)break;u=!0}}while(u||f!==s);return s}function va(l,s,u,f,_,x,E){if(l){!E&&x&&function(O,B,H,q){var W=O;do{0===W.z&&(W.z=Jl(W.x,W.y,B,H,q)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next}while(W!==O);W.prevZ.nextZ=null,W.prevZ=null,function(se){var oe,be,Ce,me,Ee,$e,Ve,gt,Ct=1;do{for(be=se,se=null,Ee=null,$e=0;be;){for($e++,Ce=be,Ve=0,oe=0;oe0||gt>0&&Ce;)0!==Ve&&(0===gt||!Ce||be.z<=Ce.z)?(me=be,be=be.nextZ,Ve--):(me=Ce,Ce=Ce.nextZ,gt--),Ee?Ee.nextZ=me:se=me,me.prevZ=Ee,Ee=me;be=Ce}Ee.nextZ=null,Ct*=2}while($e>1)}(W)}(l,f,_,x);for(var M,A,F=l;l.prev!==l.next;)if(M=l.prev,A=l.next,x?Wi(l,f,_,x):Kx(l))s.push(M.i/u|0),s.push(l.i/u|0),s.push(A.i/u|0),Jf(l),l=A.next,F=A.next;else if((l=A)===F){E?1===E?va(l=Qm(Kl(l),s,u),s,u,f,_,x,2):2===E&&Jx(l,s,u,f,_,x):va(Kl(l),s,u,f,_,x,1);break}}}function Kx(l){var s=l.prev,u=l,f=l.next;if(nr(s,u,f)>=0)return!1;for(var _=s.x,x=u.x,E=f.x,M=s.y,A=u.y,F=f.y,O=_x?_>E?_:E:x>E?x:E,q=M>A?M>F?M:F:A>F?A:F,W=f.next;W!==s;){if(W.x>=O&&W.x<=H&&W.y>=B&&W.y<=q&&Zc(_,M,x,A,E,F,W.x,W.y)&&nr(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function Wi(l,s,u,f){var _=l.prev,x=l,E=l.next;if(nr(_,x,E)>=0)return!1;for(var M=_.x,A=x.x,F=E.x,O=_.y,B=x.y,H=E.y,q=MA?M>F?M:F:A>F?A:F,oe=O>B?O>H?O:H:B>H?B:H,be=Jl(q,W,s,u,f),Ce=Jl(se,oe,s,u,f),me=l.prevZ,Ee=l.nextZ;me&&me.z>=be&&Ee&&Ee.z<=Ce;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==E&&Zc(M,O,A,B,F,H,me.x,me.y)&&nr(me.prev,me,me.next)>=0||(me=me.prevZ,Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==E&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&nr(Ee.prev,Ee,Ee.next)>=0))return!1;Ee=Ee.nextZ}for(;me&&me.z>=be;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==E&&Zc(M,O,A,B,F,H,me.x,me.y)&&nr(me.prev,me,me.next)>=0)return!1;me=me.prevZ}for(;Ee&&Ee.z<=Ce;){if(Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==E&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&nr(Ee.prev,Ee,Ee.next)>=0)return!1;Ee=Ee.nextZ}return!0}function Qm(l,s,u){var f=l;do{var _=f.prev,x=f.next.next;!tg(_,x)&&O_(_,f,f.next,x)&&Kf(_,x)&&Kf(x,_)&&(s.push(_.i/u|0),s.push(f.i/u|0),s.push(x.i/u|0),Jf(f),Jf(f.next),f=l=x),f=f.next}while(f!==l);return Kl(f)}function Jx(l,s,u,f,_,x){var E=l;do{for(var M=E.next.next;M!==E.prev;){if(E.i!==M.i&&eg(E,M)){var A=Qx(E,M);return E=Kl(E,E.next),A=Kl(A,A.next),va(E,s,u,f,_,x,0),void va(A,s,u,f,_,x,0)}M=M.next}E=E.next}while(E!==l)}function F_(l,s){return l.x-s.x}function Ad(l,s){var u=function(_,x){var E,M=x,A=_.x,F=_.y,O=-1/0;do{if(F<=M.y&&F>=M.next.y&&M.next.y!==M.y){var B=M.x+(F-M.y)*(M.next.x-M.x)/(M.next.y-M.y);if(B<=A&&B>O&&(O=B,E=M.x=M.x&&M.x>=W&&A!==M.x&&Zc(FE.x||M.x===E.x&&hh(E,M)))&&(E=M,oe=H)),M=M.next}while(M!==q);return E}(l,s);if(!u)return s;var f=Qx(u,l);return Kl(f,f.next),Kl(u,u.next)}function hh(l,s){return nr(l.prev,l,s.prev)<0&&nr(s.next,l,l.next)<0}function Jl(l,s,u,f,_){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-u)*_|0)|l<<8))|l<<4))|l<<2))|l<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-f)*_|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function dh(l){var s=l,u=l;do{(s.x=(l-E)*(x-M)&&(l-E)*(f-M)>=(u-E)*(s-M)&&(u-E)*(x-M)>=(_-E)*(f-M)}function eg(l,s){return l.next.i!==s.i&&l.prev.i!==s.i&&!function(u,f){var _=u;do{if(_.i!==u.i&&_.next.i!==u.i&&_.i!==f.i&&_.next.i!==f.i&&O_(_,_.next,u,f))return!0;_=_.next}while(_!==u);return!1}(l,s)&&(Kf(l,s)&&Kf(s,l)&&function(u,f){var _=u,x=!1,E=(u.x+f.x)/2,M=(u.y+f.y)/2;do{_.y>M!=_.next.y>M&&_.next.y!==_.y&&E<(_.next.x-_.x)*(M-_.y)/(_.next.y-_.y)+_.x&&(x=!x),_=_.next}while(_!==u);return x}(l,s)&&(nr(l.prev,l,s.prev)||nr(l,s.prev,s))||tg(l,s)&&nr(l.prev,l,l.next)>0&&nr(s.prev,s,s.next)>0)}function nr(l,s,u){return(s.y-l.y)*(u.x-s.x)-(s.x-l.x)*(u.y-s.y)}function tg(l,s){return l.x===s.x&&l.y===s.y}function O_(l,s,u,f){var _=ng(nr(l,s,u)),x=ng(nr(l,s,f)),E=ng(nr(u,f,l)),M=ng(nr(u,f,s));return _!==x&&E!==M||!(0!==_||!It(l,u,s))||!(0!==x||!It(l,f,s))||!(0!==E||!It(u,l,f))||!(0!==M||!It(u,s,f))}function It(l,s,u){return s.x<=Math.max(l.x,u.x)&&s.x>=Math.min(l.x,u.x)&&s.y<=Math.max(l.y,u.y)&&s.y>=Math.min(l.y,u.y)}function ng(l){return l>0?1:l<0?-1:0}function Kf(l,s){return nr(l.prev,l,l.next)<0?nr(l,s,l.next)>=0&&nr(l,l.prev,s)>=0:nr(l,s,l.prev)<0||nr(l,l.next,s)<0}function Qx(l,s){var u=new L_(l.i,l.x,l.y),f=new L_(s.i,s.x,s.y),_=l.next,x=s.prev;return l.next=s,s.prev=l,u.next=_,_.prev=u,f.next=u,u.prev=f,x.next=f,f.prev=x,f}function e1(l,s,u,f){var _=new L_(l,s,u);return f?(_.next=f.next,_.prev=f,f.next.prev=_,f.next=_):(_.prev=_,_.next=_),_}function Jf(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function L_(l,s,u){this.i=l,this.x=s,this.y=u,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function N_(l,s,u,f){for(var _=0,x=s,E=u-f;xu;){if(f-u>600){var x=f-u+1,E=s-u+1,M=Math.log(x),A=.5*Math.exp(2*M/3),F=.5*Math.sqrt(M*A*(x-A)/x)*(E-x/2<0?-1:1);t1(l,s,Math.max(u,Math.floor(s-E*A/x+F)),Math.min(f,Math.floor(s+(x-E)*A/x+F)),_)}var O=l[s],B=u,H=f;for(Qf(l,u,s),_(l[f],O)>0&&Qf(l,u,f);B0;)H--}0===_(l[u],O)?Qf(l,u,H):Qf(l,++H,f),H<=s&&(u=H+1),s<=H&&(f=H-1)}}function Qf(l,s,u){var f=l[s];l[s]=l[u],l[u]=f}function ci(l,s){return ls?1:0}function Pd(l,s){const u=l.length;if(u<=1)return[l];const f=[];let _,x;for(let E=0;E1)for(let E=0;E0&&u.holes.push(f+=l[_-1].length)}return u};class _o{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ws,this.indexArray=new w,this.indexArray2=new S,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.segments2=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.hasPattern=z_("fill",this.layers,u);const _=this.layers[0].layout.get("fill-sort-key"),x=!_.isConstant(),E=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,H=li(M,B);if(!this.layers[0]._featureFilter.filter(new ur(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f,u.availableImages):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:br(M),patterns:{},sortKey:q};E.push(W)}x&&E.sort((M,A)=>M.sortKey-A.sortKey);for(const M of E){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=rg("fill",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(s[F].feature,A,F,O,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}addFeatures(s,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Xf),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),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(s,u,f,_,x){for(const E of Pd(u,500)){let M=0;for(const q of E)M+=q.length;const A=this.segments.prepareSegment(M,this.layoutVertexArray,this.indexArray),F=A.vertexLength,O=[],B=[];for(const q of E){if(0===q.length)continue;q!==E[0]&&B.push(O.length/2);const W=this.segments2.prepareSegment(q.length,this.layoutVertexArray,this.indexArray2),se=W.vertexLength;this.layoutVertexArray.emplaceBack(q[0].x,q[0].y),this.indexArray2.emplaceBack(se+q.length-1,se),O.push(q[0].x),O.push(q[0].y);for(let oe=1;oe>3}if(_--,1===f||2===f)x+=l.readSVarint(),E+=l.readSVarint(),1===f&&(s&&M.push(s),s=[]),s.push(new n1(x,E));else{if(7!==f)throw new Error("unknown command "+f);s&&s.push(s[0].clone())}}return s&&M.push(s),M},Od.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var s=l.readVarint()+l.pos,u=1,f=0,_=0,x=0,E=1/0,M=-1/0,A=1/0,F=-1/0;l.pos>3}if(f--,1===u||2===u)(_+=l.readSVarint())M&&(M=_),(x+=l.readSVarint())F&&(F=x);else if(7!==u)throw new Error("unknown command "+u)}return[E,A,M,F]},Od.prototype.toGeoJSON=function(l,s,u){var f,_,x=this.extent*Math.pow(2,u),E=this.extent*l,M=this.extent*s,A=this.loadGeometry(),F=Od.types[this.type];function O(q){for(var W=0;W>3;_=1===E?f.readString():2===E?f.readFloat():3===E?f.readDouble():4===E?f.readVarint64():5===E?f.readVarint():6===E?f.readSVarint():7===E?f.readBoolean():null}return _}(u))}i1.prototype.feature=function(l){if(l<0||l>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[l];var s=this._pbf.readVarint()+this._pbf.pos;return new ig(this._pbf,s,this.extent,this._keys,this._values)};var o1=Wc;function s1(l,s,u){if(3===l){var f=new o1(u,u.readVarint()+u.pos);f.length&&(s[f.name]=f)}}Ql.VectorTile=function(l,s){this.layers=l.readFields(s1,{},s)},Ql.VectorTileFeature=r1,Ql.VectorTileLayer=Wc;const a1=Ql.VectorTileFeature.types,og=Math.pow(2,13);function Ld(l,s,u,f,_,x,E,M){l.emplaceBack(s,u,2*Math.floor(f*og)+E,_*og*2,x*og*2,Math.round(M))}class sg{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(u=>u.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new Sd,this.centroidVertexArray=new ih,this.indexArray=new w,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.features=[],this.hasPattern=z_("fill-extrusion",this.layers,u);for(const{feature:_,id:x,index:E,sourceLayerIndex:M}of s){const A=this.layers[0]._featureFilter.needGeometry,F=li(_,A);if(!this.layers[0]._featureFilter.filter(new ur(this.zoom),F,f))continue;const O={id:x,sourceLayerIndex:M,index:E,geometry:A?F.geometry:br(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(rg("fill-extrusion",this.layers,O,this.zoom,u)):this.addFeature(O,O.geometry,E,f,{}),u.featureIndex.insert(_,O.geometry,E,M,this.index,!0)}}addFeatures(s,u,f){for(const _ of this.features){const{geometry:x}=_;this.addFeature(_,x,_.index,u,f)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,V_),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,Fd.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,u,f,_,x){const E={x:0,y:0,vertexCount:0};for(const M of Pd(u,500)){let A=0;for(const W of M)A+=W.length;let F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of M){if(0===W.length||((l=W).every(s=>s.x<0)||l.every(s=>s.x>_n)||l.every(s=>s.y<0)||l.every(s=>s.y>_n)))continue;let se=0;for(let oe=0;oe=1){const Ce=W[oe-1];if(!ag(be,Ce)){F.vertexLength+4>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const me=be.sub(Ce)._perp()._unit(),Ee=Ce.dist(be);se+Ee>32768&&(se=0),Ld(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,0,se),Ld(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,1,se),E.x+=2*be.x,E.y+=2*be.y,E.vertexCount+=2,se+=Ee,Ld(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,0,se),Ld(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,1,se),E.x+=2*Ce.x,E.y+=2*Ce.y,E.vertexCount+=2;const $e=F.vertexLength;this.indexArray.emplaceBack($e,$e+2,$e+1),this.indexArray.emplaceBack($e+1,$e+2,$e+3),F.vertexLength+=4,F.primitiveLength+=2}}}}if(F.vertexLength+A>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(A,this.layoutVertexArray,this.indexArray)),"Polygon"!==a1[s.type])continue;const O=[],B=[],H=F.vertexLength;for(const W of M)if(0!==W.length){W!==M[0]&&B.push(O.length/2);for(let se=0;se_n)||l.y===s.y&&(l.y<0||l.y>_n)}ct("FillExtrusionBucket",sg,{omit:["layers","features"]});var F2={paint:new Di({"fill-extrusion-opacity":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qa(Ae["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function il(l,s){return l.x*s.x+l.y*s.y}function np(l,s){if(1===l.length){let u=0;const f=s[u++];let _;for(;!_||f.equals(_);)if(_=s[u++],!_)return 1/0;for(;uu.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(u=>{this.gradients[u.id]={}}),this.layoutVertexArray=new oh,this.layoutVertexArray2=new P_,this.indexArray=new w,this.programConfigurations=new Ht(s.layers,s.zoom),this.segments=new R,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(s,u,f){this.hasPattern=z_("line",this.layers,u);const _=this.layers[0].layout.get("line-sort-key"),x=!_.isConstant(),E=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of s){const B=this.layers[0]._featureFilter.needGeometry,H=li(M,B);if(!this.layers[0]._featureFilter.filter(new ur(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:br(M),patterns:{},sortKey:q};E.push(W)}x&&E.sort((M,A)=>M.sortKey-A.sortKey);for(const M of E){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=rg("line",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(s[F].feature,A,F,O,this.index)}}update(s,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,u,this.stateDependentLayers,f)}addFeatures(s,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,u1)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,l1),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,u,f,_,x){const E=this.layers[0].layout,M=E.get("line-join").evaluate(s,{}),A=E.get("line-cap"),F=E.get("line-miter-limit"),O=E.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const B of u)this.addLine(B,s,M,A,F,O);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,f,x,_)}addLine(s,u,f,_,x,E){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be=2&&s[A-1].equals(s[A-2]);)A--;let F=0;for(;F0;if(gt&&be>F){const Qe=H.dist(q);if(Qe>2*O){const ot=H.sub(H.sub(q)._mult(O/Qe)._round());this.updateDistance(q,ot),this.addCurrentVertex(ot,se,0,0,B),q=ot}}const at=q&&W;let tt=at?f:M?"butt":_;if(at&&"round"===tt&&($ex&&(tt="bevel"),"bevel"===tt&&($e>2&&(tt="flipbevel"),$e100)Ce=oe.mult(-1);else{const Qe=$e*se.add(oe).mag()/se.sub(oe).mag();Ce._perp()._mult(Qe*(Ct?-1:1))}this.addCurrentVertex(H,Ce,0,0,B),this.addCurrentVertex(H,Ce.mult(-1),0,0,B)}else if("bevel"===tt||"fakeround"===tt){const Qe=-Math.sqrt($e*$e-1),ot=Ct?Qe:0,it=Ct?0:Qe;if(q&&this.addCurrentVertex(H,se,ot,it,B),"fakeround"===tt){const Ge=Math.round(180*Ve/Math.PI/20);for(let Et=1;Et2*O){const ot=H.add(W.sub(H)._mult(O/Qe)._round());this.updateDistance(H,ot),this.addCurrentVertex(ot,oe,0,0,B),H=ot}}}}addCurrentVertex(s,u,f,_,x,E=!1){const M=u.y*_-u.x,A=-u.y-u.x*_;this.addHalfVertex(s,u.x+u.y*f,u.y-u.x*f,E,!1,f,x),this.addHalfVertex(s,M,A,E,!0,-_,x),this.distance>Xc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(s,u,f,_,x,E))}addHalfVertex({x:s,y:u},f,_,x,E,M,A){const F=.5*(this.lineClips?this.scaledDistance*(Xc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(x?1:0),(u<<1)+(E?1:0),Math.round(63*f)+128,Math.round(63*_)+128,1+(0===M?0:M<0?-1:1)|(63&F)<<2,F>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const O=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,O),A.primitiveLength++),E?this.e2=O:this.e1=O}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,u){this.distance+=s.dist(u),this.updateScaledDistance()}}ct("LineBucket",lg,{omit:["layers","patternFeatures"]});const St=new Di({"line-cap":new wt(Ae.layout_line["line-cap"]),"line-join":new yt(Ae.layout_line["line-join"]),"line-miter-limit":new wt(Ae.layout_line["line-miter-limit"]),"line-round-limit":new wt(Ae.layout_line["line-round-limit"]),"line-sort-key":new yt(Ae.layout_line["line-sort-key"])});var cg={paint:new Di({"line-opacity":new yt(Ae.paint_line["line-opacity"]),"line-color":new yt(Ae.paint_line["line-color"]),"line-translate":new wt(Ae.paint_line["line-translate"]),"line-translate-anchor":new wt(Ae.paint_line["line-translate-anchor"]),"line-width":new yt(Ae.paint_line["line-width"]),"line-gap-width":new yt(Ae.paint_line["line-gap-width"]),"line-offset":new yt(Ae.paint_line["line-offset"]),"line-blur":new yt(Ae.paint_line["line-blur"]),"line-dasharray":new _d(Ae.paint_line["line-dasharray"]),"line-pattern":new Qa(Ae.paint_line["line-pattern"]),"line-gradient":new vd(Ae.paint_line["line-gradient"])}),layout:St};const Fr=new class extends yt{possiblyEvaluate(l,s){return s=new ur(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(l,s)}evaluate(l,s,u,f){return s=zi({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(l,s,u,f)}}(cg.paint.properties["line-width"].specification);function ip(l,s){return s>0?s+2*l:l}Fr.useIntegerZoom=!0;const zd=Dr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),h1=Dr([{name:"a_projected_pos",components:3,type:"Float32"}],4);Dr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const d1=Dr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Dr([{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 H_=Dr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ug=Dr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Bd(l,s,u){return l.sections.forEach(f=>{f.text=function(_,x,E){const M=x.layout.get("text-transform").evaluate(E,{});return"uppercase"===M?_=_.toLocaleUpperCase():"lowercase"===M&&(_=_.toLocaleLowerCase()),go.applyArabicShaping&&(_=go.applyArabicShaping(_)),_}(f.text,s,u)}),l}Dr([{name:"triangle",components:3,type:"Uint16"}]),Dr([{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"}]),Dr([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Dr([{type:"Float32",name:"offsetX"}]),Dr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const fh={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var hg=Ln,dg=function(l,s,u,f,_){var x,E,M=8*_-f-1,A=(1<>1,O=-7,B=u?_-1:0,H=u?-1:1,q=l[s+B];for(B+=H,x=q&(1<<-O)-1,q>>=-O,O+=M;O>0;x=256*x+l[s+B],B+=H,O-=8);for(E=x&(1<<-O)-1,x>>=-O,O+=f;O>0;E=256*E+l[s+B],B+=H,O-=8);if(0===x)x=1-F;else{if(x===A)return E?NaN:1/0*(q?-1:1);E+=Math.pow(2,f),x-=F}return(q?-1:1)*E*Math.pow(2,x-f)},ph=function(l,s,u,f,_,x){var E,M,A,F=8*x-_-1,O=(1<>1,H=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,q=f?0:x-1,W=f?1:-1,se=s<0||0===s&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(M=isNaN(s)?1:0,E=O):(E=Math.floor(Math.log(s)/Math.LN2),s*(A=Math.pow(2,-E))<1&&(E--,A*=2),(s+=E+B>=1?H/A:H*Math.pow(2,1-B))*A>=2&&(E++,A/=2),E+B>=O?(M=0,E=O):E+B>=1?(M=(s*A-1)*Math.pow(2,_),E+=B):(M=s*Math.pow(2,B-1)*Math.pow(2,_),E=0));_>=8;l[u+q]=255&M,q+=W,M/=256,_-=8);for(E=E<<_|M,F+=_;F>0;l[u+q]=255&E,q+=W,E/=256,F-=8);l[u+q-W]|=128*se};function Ln(l){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(l)?l:new Uint8Array(l||0),this.pos=0,this.type=0,this.length=this.buf.length}Ln.Varint=0,Ln.Fixed64=1,Ln.Bytes=2,Ln.Fixed32=5;var ol,fg=4294967296,G_=1/fg,Yc=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ts(l){return l.type===Ln.Bytes?l.readVarint()+l.pos:l.pos+1}function f1(l,s,u){var f=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));u.realloc(f);for(var _=u.pos-1;_>=l;_--)u.buf[_+f]=u.buf[_]}function q_(l,s){for(var u=0;u>>8,l[u+2]=s>>>16,l[u+3]=s>>>24}function pg(l,s){return(l[s]|l[s+1]<<8|l[s+2]<<16)+(l[s+3]<<24)}function L2(l,s,u){1===l&&u.readMessage(v1,s)}function v1(l,s,u){if(3===l){const{id:f,bitmap:_,width:x,height:E,left:M,top:A,advance:F}=u.readMessage(b1,{});s.push({id:f,bitmap:new uh({width:x+6,height:E+6},_),metrics:{width:x,height:E,left:M,top:A,advance:F}})}}function b1(l,s,u){1===l?s.id=u.readVarint():2===l?s.bitmap=u.readBytes():3===l?s.width=u.readVarint():4===l?s.height=u.readVarint():5===l?s.left=u.readSVarint():6===l?s.top=u.readSVarint():7===l&&(s.advance=u.readVarint())}function sp(l){let s=0,u=0;for(const E of l)s+=E.w*E.h,u=Math.max(u,E.w);l.sort((E,M)=>M.h-E.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),u),h:1/0}];let _=0,x=0;for(const E of l)for(let M=f.length-1;M>=0;M--){const A=f[M];if(!(E.w>A.w||E.h>A.h)){if(E.x=A.x,E.y=A.y,x=Math.max(x,E.y+E.h),_=Math.max(_,E.x+E.w),E.w===A.w&&E.h===A.h){const F=f.pop();M>3,x=this.pos;this.type=7&f,l(_,s,this),this.pos===x&&this.skip(f)}return s},readMessage:function(l,s){return this.readFields(l,s,this.readVarint()+this.pos)},readFixed32:function(){var l=Vd(this.buf,this.pos);return this.pos+=4,l},readSFixed32:function(){var l=pg(this.buf,this.pos);return this.pos+=4,l},readFixed64:function(){var l=Vd(this.buf,this.pos)+Vd(this.buf,this.pos+4)*fg;return this.pos+=8,l},readSFixed64:function(){var l=Vd(this.buf,this.pos)+pg(this.buf,this.pos+4)*fg;return this.pos+=8,l},readFloat:function(){var l=dg(this.buf,this.pos,!0,23,4);return this.pos+=4,l},readDouble:function(){var l=dg(this.buf,this.pos,!0,52,8);return this.pos+=8,l},readVarint:function(l){var s,u,f=this.buf;return s=127&(u=f[this.pos++]),u<128?s:(s|=(127&(u=f[this.pos++]))<<7,u<128?s:(s|=(127&(u=f[this.pos++]))<<14,u<128?s:(s|=(127&(u=f[this.pos++]))<<21,u<128?s:function(_,x,E){var M,A,F=E.buf;if(M=(112&(A=F[E.pos++]))>>4,A<128||(M|=(127&(A=F[E.pos++]))<<3,A<128)||(M|=(127&(A=F[E.pos++]))<<10,A<128)||(M|=(127&(A=F[E.pos++]))<<17,A<128)||(M|=(127&(A=F[E.pos++]))<<24,A<128)||(M|=(1&(A=F[E.pos++]))<<31,A<128))return function mh(l,s,u){return u?4294967296*s+(l>>>0):4294967296*(s>>>0)+(l>>>0)}(_,M,x);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(u=f[this.pos]))<<28,l,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var l=this.readVarint();return l%2==1?(l+1)/-2:l/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var l=this.readVarint()+this.pos,s=this.pos;return this.pos=l,l-s>=12&&Yc?Yc.decode(this.buf.subarray(s,l)):function(u,f,_){for(var x="",E=f;E<_;){var M,A,F,O=u[E],B=null,H=O>239?4:O>223?3:O>191?2:1;if(E+H>_)break;1===H?O<128&&(B=O):2===H?128==(192&(M=u[E+1]))&&(B=(31&O)<<6|63&M)<=127&&(B=null):3===H?(A=u[E+2],128==(192&(M=u[E+1]))&&128==(192&A)&&((B=(15&O)<<12|(63&M)<<6|63&A)<=2047||B>=55296&&B<=57343)&&(B=null)):4===H&&(A=u[E+2],F=u[E+3],128==(192&(M=u[E+1]))&&128==(192&A)&&128==(192&F)&&((B=(15&O)<<18|(63&M)<<12|(63&A)<<6|63&F)<=65535||B>=1114112)&&(B=null)),null===B?(B=65533,H=1):B>65535&&(B-=65536,x+=String.fromCharCode(B>>>10&1023|55296),B=56320|1023&B),x+=String.fromCharCode(B),E+=H}return x}(this.buf,s,l)},readBytes:function(){var l=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,l);return this.pos=l,s},readPackedVarint:function(l,s){if(this.type!==Ln.Bytes)return l.push(this.readVarint(s));var u=ts(this);for(l=l||[];this.pos127;);else if(s===Ln.Bytes)this.pos=this.readVarint()+this.pos;else if(s===Ln.Fixed32)this.pos+=4;else{if(s!==Ln.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(l,s){this.writeVarint(l<<3|s)},realloc:function(l){for(var s=this.length||16;s268435455||l<0?function(s,u){var f,_,x,M;if(s>=0?(f=s%4294967296|0,_=s/4294967296|0):(_=~(-s/4294967296),4294967295^(f=~(-s%4294967296))?f=f+1|0:(f=0,_=_+1|0)),s>=0x10000000000000000||s<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),x=f,(M=u).buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,M.buf[M.pos]=127&(x>>>=7),function(x,E){var M=(7&x)<<4;E.buf[E.pos++]|=M|((x>>>=3)?128:0),x&&(E.buf[E.pos++]=127&x|((x>>>=7)?128:0),x&&(E.buf[E.pos++]=127&x|((x>>>=7)?128:0),x&&(E.buf[E.pos++]=127&x|((x>>>=7)?128:0),x&&(E.buf[E.pos++]=127&x|((x>>>=7)?128:0),x&&(E.buf[E.pos++]=127&x)))))}(_,u)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))},writeSVarint:function(l){this.writeVarint(l<0?2*-l-1:2*l)},writeBoolean:function(l){this.writeVarint(Boolean(l))},writeString:function(l){l=String(l),this.realloc(4*l.length),this.pos++;var s=this.pos;this.pos=function(f,_,x){for(var E,M,A=0;A<_.length;A++){if((E=_.charCodeAt(A))>55295&&E<57344){if(!M){E>56319||A+1===_.length?(f[x++]=239,f[x++]=191,f[x++]=189):M=E;continue}if(E<56320){f[x++]=239,f[x++]=191,f[x++]=189,M=E;continue}E=M-55296<<10|E-56320|65536,M=null}else M&&(f[x++]=239,f[x++]=191,f[x++]=189,M=null);E<128?f[x++]=E:(E<2048?f[x++]=E>>6|192:(E<65536?f[x++]=E>>12|224:(f[x++]=E>>18|240,f[x++]=E>>12&63|128),f[x++]=E>>6&63|128),f[x++]=63&E|128)}return x}(this.buf,l,this.pos);var u=this.pos-s;u>=128&&f1(s,u,this),this.pos=s-1,this.writeVarint(u),this.pos+=u},writeFloat:function(l){this.realloc(4),ph(this.buf,l,this.pos,!0,23,4),this.pos+=4},writeDouble:function(l){this.realloc(8),ph(this.buf,l,this.pos,!0,52,8),this.pos+=8},writeBytes:function(l){var s=l.length;this.writeVarint(s),this.realloc(s);for(var u=0;u=128&&f1(u,f,this),this.pos=u-1,this.writeVarint(f),this.pos+=f},writeMessage:function(l,s,u){this.writeTag(l,Ln.Bytes),this.writeRawMessage(s,u)},writePackedVarint:function(l,s){s.length&&this.writeMessage(l,q_,s)},writePackedSVarint:function(l,s){s.length&&this.writeMessage(l,p1,s)},writePackedBoolean:function(l,s){s.length&&this.writeMessage(l,g1,s)},writePackedFloat:function(l,s){s.length&&this.writeMessage(l,O2,s)},writePackedDouble:function(l,s){s.length&&this.writeMessage(l,m1,s)},writePackedFixed32:function(l,s){s.length&&this.writeMessage(l,y1,s)},writePackedSFixed32:function(l,s){s.length&&this.writeMessage(l,op,s)},writePackedFixed64:function(l,s){s.length&&this.writeMessage(l,Z_,s)},writePackedSFixed64:function(l,s){s.length&&this.writeMessage(l,_1,s)},writeBytesField:function(l,s){this.writeTag(l,Ln.Bytes),this.writeBytes(s)},writeFixed32Field:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeSFixed64(s)},writeVarintField:function(l,s){this.writeTag(l,Ln.Varint),this.writeVarint(s)},writeSVarintField:function(l,s){this.writeTag(l,Ln.Varint),this.writeSVarint(s)},writeStringField:function(l,s){this.writeTag(l,Ln.Bytes),this.writeString(s)},writeFloatField:function(l,s){this.writeTag(l,Ln.Fixed32),this.writeFloat(s)},writeDoubleField:function(l,s){this.writeTag(l,Ln.Fixed64),this.writeDouble(s)},writeBooleanField:function(l,s){this.writeVarintField(l,Boolean(s))}};class W_{constructor(s,{pixelRatio:u,version:f,stretchX:_,stretchY:x,content:E}){this.paddedRect=s,this.pixelRatio=u,this.stretchX=_,this.stretchY=x,this.content=E,this.version=f}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 x1{constructor(s,u){const f={},_={};this.haveRenderCallbacks=[];const x=[];this.addImages(s,f,x),this.addImages(u,_,x);const{w:E,h:M}=sp(x),A=new Oo({width:E||1,height:M||1});for(const F in s){const O=s[F],B=f[F].paddedRect;Oo.copy(O.data,A,{x:0,y:0},{x:B.x+1,y:B.y+1},O.data)}for(const F in u){const O=u[F],B=_[F].paddedRect,H=B.x+1,q=B.y+1,W=O.data.width,se=O.data.height;Oo.copy(O.data,A,{x:0,y:0},{x:H,y:q},O.data),Oo.copy(O.data,A,{x:0,y:se-1},{x:H,y:q-1},{width:W,height:1}),Oo.copy(O.data,A,{x:0,y:0},{x:H,y:q+se},{width:W,height:1}),Oo.copy(O.data,A,{x:W-1,y:0},{x:H-1,y:q},{width:1,height:se}),Oo.copy(O.data,A,{x:0,y:0},{x:H+W,y:q},{width:1,height:se})}this.image=A,this.iconPositions=f,this.patternPositions=_}addImages(s,u,f){for(const _ in s){const x=s[_],E={x:0,y:0,w:x.data.width+2,h:x.data.height+2};f.push(E),u[_]=new W_(E,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(s,u){s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const f in s.updatedImages)this.patchUpdatedImage(this.iconPositions[f],s.getImage(f),u),this.patchUpdatedImage(this.patternPositions[f],s.getImage(f),u)}patchUpdatedImage(s,u,f){if(!s||!u||s.version===u.version)return;s.version=u.version;const[_,x]=s.tl;f.update(u.data,void 0,{x:_,y:x})}}ct("ImagePosition",W_),ct("ImageAtlas",x1),b.WritingMode=void 0,(ol=b.WritingMode||(b.WritingMode={}))[ol.none=0]="none",ol[ol.horizontal=1]="horizontal",ol[ol.vertical=2]="vertical",ol[ol.horizontalOnly=3]="horizontalOnly";class ap{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,u){const f=new ap;return f.scale=s||1,f.fontStack=u,f}static forImage(s){const u=new ap;return u.imageName=s,u}}class $d{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,u){const f=new $d;for(let _=0;_=0&&f>=s&&gg[this.text.charCodeAt(f)];f--)u--;this.text=this.text.substring(s,u),this.sectionIndex=this.sectionIndex.slice(s,u)}substring(s,u){const f=new $d;return f.text=this.text.substring(s,u),f.sectionIndex=this.sectionIndex.slice(s,u),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,u)=>Math.max(s,this.sections[u].scale),0)}addTextSection(s,u){this.text+=s.text,this.sections.push(ap.forText(s.scale,s.fontStack||u));const f=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function mg(l,s,u,f,_,x,E,M,A,F,O,B,H,q,W,se){const oe=$d.fromFeature(l,_);let be;B===b.WritingMode.vertical&&oe.verticalizePunctuation();const{processBidirectionalText:Ce,processStyledBidirectionalText:me}=go;if(Ce&&1===oe.sections.length){be=[];const Ve=Ce(oe.toString(),lp(oe,F,x,s,f,q,W));for(const gt of Ve){const Ct=new $d;Ct.text=gt,Ct.sections=oe.sections;for(let at=0;at0&&ll>Ji&&(Ji=ll)}else{const rs=Ct[Qt.fontStack],xo=rs&&rs[vn];if(xo&&xo.rect)ns=xo.rect,Ds=xo.metrics;else{const ll=gt[Qt.fontStack],xp=ll&&ll[vn];if(!xp)continue;Ds=xp.metrics}ki=24*(gi-Qt.scale)}Ms?(Ve.verticalizable=!0,bo.push({glyph:vn,imageName:Ss,x:Kn,y:rr+ki,vertical:Ms,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:zo,metrics:Ds,rect:ns}),Kn+=al*Qt.scale+Et):(bo.push({glyph:vn,imageName:Ss,x:Kn,y:rr+ki,vertical:Ms,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:zo,metrics:Ds,rect:ns}),Kn+=Ds.advance*Qt.scale+Et)}0!==bo.length&&(Or=Math.max(Kn-Et,Or),w1(bo,0,bo.length-1,Ti,Ji)),Kn=0;const dr=Qe*gi+Ji;Ki.lineOffset=Math.max(Ji,Ai),rr+=dr,Es=Math.max(dr,Es),++jr}var Lr;const Kr=rr- -17,{horizontalAlign:Yi,verticalAlign:No}=Xi(ot);(function(Ar,gi,Ai,Ki,bo,Ji,dr,yi,Qt){const zo=(gi-Ai)*bo;let vn=0;vn=Ji!==dr?-yi*Ki- -17:(-Ki*Qt+.5)*dr;for(const ki of Ar)for(const Ds of ki.positionedGlyphs)Ds.x+=zo,Ds.y+=vn})(Ve.positionedLines,Ti,Yi,No,Or,Es,Qe,Kr,tt.length),Ve.top+=-No*Kr,Ve.bottom=Ve.top+Kr,Ve.left+=-Yi*Or,Ve.right=Ve.left+Or}($e,s,u,f,be,E,M,A,B,F,H,se),!function(Ve){for(const gt of Ve)if(0!==gt.positionedGlyphs.length)return!1;return!0}(Ee)&&$e}const gg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},N2={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function X_(l,s,u,f,_,x){if(s.imageName){const E=f[s.imageName];return E?E.displaySize[0]*s.scale*24/x+_:0}{const E=u[s.fontStack],M=E&&E[l];return M?M.metrics.advance*s.scale+_:0}}function yg(l,s,u,f){const _=Math.pow(l-s,2);return f?l=0;let O=0;for(let H=0;H-u/2;){if(E--,E<0)return!1;M-=l[E].dist(x),x=l[E]}M+=l[E].dist(l[E+1]),E++;const A=[];let F=0;for(;Mf;)F-=A.shift().angleDelta;if(F>_)return!1;E++,M+=O.dist(B)}return!0}function J_(l){let s=0;for(let u=0;uF){const W=(F-A)/q,se=Xn(B.x,H.x,W),oe=Xn(B.y,H.y,W),be=new ec(se,oe,H.angleTo(B),O);return be._round(),!E||K_(l,be,M,E,s)?be:void 0}A+=q}}function vo(l,s,u,f,_,x,E,M,A){const F=xg(f,x,E),O=Q_(f,_),B=O*E,H=0===l[0].x||l[0].x===A||0===l[0].y||l[0].y===A;return s-B=0&&Ee=0&&$e=0&&H+F<=O){const Ve=new ec(Ee,$e,Ce,W);Ve._round(),f&&!K_(l,Ve,x,f,_)||q.push(Ve)}}B+=be}return M||q.length||E||(q=up(l,B/2,u,f,_,x,E,!0,A)),q}function wg(l,s,u,f,_){const x=[];for(let E=0;E=f&&B.x>=f||(O.x>=f?O=new Tt(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round():B.x>=f&&(B=new Tt(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round()),O.y>=_&&B.y>=_||(O.y>=_?O=new Tt(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round():B.y>=_&&(B=new Tt(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round()),A&&O.equals(A[A.length-1])||(A=[O],x.push(A)),A.push(B)))))}}return x}function hp(l,s,u,f){const _=[],x=l.image,E=x.pixelRatio,M=x.paddedRect.w-2,A=x.paddedRect.h-2,F=l.right-l.left,O=l.bottom-l.top,B=x.stretchX||[[0,M]],H=x.stretchY||[[0,A]],q=(Qe,ot)=>Qe+ot[1]-ot[0],W=B.reduce(q,0),se=H.reduce(q,0),oe=M-W,be=A-se;let Ce=0,me=W,Ee=0,$e=se,Ve=0,gt=oe,Ct=0,at=be;if(x.content&&f){const Qe=x.content;Ce=ui(B,0,Qe[0]),Ee=ui(H,0,Qe[1]),me=ui(B,Qe[0],Qe[2]),$e=ui(H,Qe[1],Qe[3]),Ve=Qe[0]-Ce,Ct=Qe[1]-Ee,gt=Qe[2]-Qe[0]-me,at=Qe[3]-Qe[1]-$e}const tt=(Qe,ot,it,Ge)=>{const Et=jd(Qe.stretch-Ce,me,F,l.left),pt=dp(Qe.fixed-Ve,gt,Qe.stretch,W),Yt=jd(ot.stretch-Ee,$e,O,l.top),Kn=dp(ot.fixed-Ct,at,ot.stretch,se),rr=jd(it.stretch-Ce,me,F,l.left),Or=dp(it.fixed-Ve,gt,it.stretch,W),Es=jd(Ge.stretch-Ee,$e,O,l.top),Ti=dp(Ge.fixed-Ct,at,Ge.stretch,se),jr=new Tt(Et,Yt),Lr=new Tt(rr,Yt),Kr=new Tt(rr,Es),Yi=new Tt(Et,Es),No=new Tt(pt/E,Kn/E),Ar=new Tt(Or/E,Ti/E),gi=s*Math.PI/180;if(gi){const bo=Math.sin(gi),Ji=Math.cos(gi),dr=[Ji,-bo,bo,Ji];jr._matMult(dr),Lr._matMult(dr),Yi._matMult(dr),Kr._matMult(dr)}const Ai=Qe.stretch+Qe.fixed,Ki=ot.stretch+ot.fixed;return{tl:jr,tr:Lr,bl:Yi,br:Kr,tex:{x:x.paddedRect.x+1+Ai,y:x.paddedRect.y+1+Ki,w:it.stretch+it.fixed-Ai,h:Ge.stretch+Ge.fixed-Ki},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:No,pixelOffsetBR:Ar,minFontScaleX:gt/E/F,minFontScaleY:at/E/O,isSDF:u}};if(f&&(x.stretchX||x.stretchY)){const Qe=yh(B,oe,W),ot=yh(H,be,se);for(let it=0;it0&&(W=Math.max(10,W),this.circleDiameter=W)}else{let B=E.top*M-A[0],H=E.bottom*M+A[2],q=E.left*M-A[3],W=E.right*M+A[1];const se=E.collisionPadding;if(se&&(q-=se[0]*M,B-=se[1]*M,W+=se[2]*M,H+=se[3]*M),O){const oe=new Tt(q,B),be=new Tt(W,B),Ce=new Tt(q,H),me=new Tt(W,H),Ee=O*Math.PI/180;oe._rotate(Ee),be._rotate(Ee),Ce._rotate(Ee),me._rotate(Ee),q=Math.min(oe.x,be.x,Ce.x,me.x),W=Math.max(oe.x,be.x,Ce.x,me.x),B=Math.min(oe.y,be.y,Ce.y,me.y),H=Math.max(oe.y,be.y,Ce.y,me.y)}s.emplaceBack(u.x,u.y,q,B,W,H,f,_,x)}this.boxEndIndex=s.length}}class ev{constructor(s=[],u=D1){if(this.data=s,this.length=this.data.length,this.compare=u,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const s=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:u,compare:f}=this,_=u[s];for(;s>0;){const x=s-1>>1,E=u[x];if(f(_,E)>=0)break;u[s]=E,s=x}u[s]=_}_down(s){const{data:u,compare:f}=this,_=this.length>>1,x=u[s];for(;s<_;){let E=1+(s<<1),M=u[E];const A=E+1;if(A=0)break;u[s]=M,s=E}u[s]=x}}function D1(l,s){return ls?1:0}function tv(l,s=1,u=!1){let f=1/0,_=1/0,x=-1/0,E=-1/0;const M=l[0];for(let q=0;qx)&&(x=W.x),(!q||W.y>E)&&(E=W.y)}const A=Math.min(x-f,E-_);let F=A/2;const O=new ev([],S1);if(0===A)return new Tt(f,_);for(let q=f;qB.d||!B.d)&&(B=q,u&&console.log("found best %d after %d probes",Math.round(1e4*q.d)/1e4,H)),q.max-B.d<=s||(F=q.h/2,O.push(new Kc(q.p.x-F,q.p.y-F,F,l)),O.push(new Kc(q.p.x+F,q.p.y-F,F,l)),O.push(new Kc(q.p.x-F,q.p.y+F,F,l)),O.push(new Kc(q.p.x+F,q.p.y+F,F,l)),H+=4)}return u&&(console.log(`num probes: ${H}`),console.log(`best distance: ${B.d}`)),B.p}function S1(l,s){return s.max-l.max}function Kc(l,s,u,f){this.p=new Tt(l,s),this.h=u,this.d=function(_,x){let E=!1,M=1/0;for(let A=0;A_.y!=W.y>_.y&&_.x<(W.x-q.x)*(_.y-q.y)/(W.y-q.y)+q.x&&(E=!E),M=Math.min(M,tr(_,q,W))}}return(E?1:-1)*Math.sqrt(M)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}const Cg=Number.POSITIVE_INFINITY;function nv(l,s){return s[1]!==Cg?function(u,f,_){let x=0,E=0;switch(f=Math.abs(f),_=Math.abs(_),u){case"top-right":case"top-left":case"top":E=_-7;break;case"bottom-right":case"bottom-left":case"bottom":E=7-_}switch(u){case"top-right":case"bottom-right":case"right":x=-f;break;case"top-left":case"bottom-left":case"left":x=f}return[x,E]}(l,s[0],s[1]):function(u,f){let _=0,x=0;f<0&&(f=0);const E=f/Math.sqrt(2);switch(u){case"top-right":case"top-left":x=E-7;break;case"bottom-right":case"bottom-left":x=7-E;break;case"bottom":x=7-f;break;case"top":x=f-7}switch(u){case"top-right":case"bottom-right":_=-E;break;case"top-left":case"bottom-left":_=E;break;case"left":_=f;break;case"right":_=-f}return[_,x]}(l,s[0])}function Hd(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Eg(l,s,u,f,_,x,E,M,A,F,O){let B=x.textMaxSize.evaluate(s,{});void 0===B&&(B=E);const H=l.layers[0].layout,q=H.get("icon-offset").evaluate(s,{},O),W=rv(u.horizontal),se=E/24,oe=l.tilePixelRatio*se,be=l.tilePixelRatio*B/24,Ce=l.tilePixelRatio*M,me=l.tilePixelRatio*H.get("symbol-spacing"),Ee=H.get("text-padding")*l.tilePixelRatio,$e=function(Ge,Et,pt,Yt=1){const Kn=Ge.get("icon-padding").evaluate(Et,{},pt),rr=Kn&&Kn.values;return[rr[0]*Yt,rr[1]*Yt,rr[2]*Yt,rr[3]*Yt]}(H,s,O,l.tilePixelRatio),Ve=H.get("text-max-angle")/180*Math.PI,gt="viewport"!==H.get("text-rotation-alignment")&&"point"!==H.get("symbol-placement"),Ct="map"===H.get("icon-rotation-alignment")&&"point"!==H.get("symbol-placement"),at=H.get("symbol-placement"),tt=me/2,Qe=H.get("icon-text-fit");let ot;f&&"none"!==Qe&&(l.allowVerticalPlacement&&u.vertical&&(ot=Y_(f,u.vertical,Qe,H.get("icon-text-fit-padding"),q,se)),W&&(f=Y_(f,W,Qe,H.get("icon-text-fit-padding"),q,se)));const it=(Ge,Et)=>{Et.x<0||Et.x>=_n||Et.y<0||Et.y>=_n||function(pt,Yt,Kn,rr,Or,Es,Ti,jr,Lr,Kr,Yi,No,Ar,gi,Ai,Ki,bo,Ji,dr,yi,Qt,zo,vn,ki,Ds){const ns=pt.addToLineVertexArray(Yt,Kn);let Ss,al,Ms,rs,xo=0,ll=0,xp=0,L1=0,Qc=-1,Jd=-1;const xa={};let Ng=j(""),wp=0,zg=0;if(void 0===jr._unevaluatedLayout.getValue("text-radial-offset")?[wp,zg]=jr.layout.get("text-offset").evaluate(Qt,{},ki).map(wo=>24*wo):(wp=24*jr.layout.get("text-radial-offset").evaluate(Qt,{},ki),zg=Cg),pt.allowVerticalPlacement&&rr.vertical){const wo=jr.layout.get("text-rotate").evaluate(Qt,{},ki)+90;Ms=new fp(Lr,Yt,Kr,Yi,No,rr.vertical,Ar,gi,Ai,wo),Ti&&(rs=new fp(Lr,Yt,Kr,Yi,No,Ti,bo,Ji,Ai,wo))}if(Or){const wo=jr.layout.get("icon-rotate").evaluate(Qt,{}),Is="none"!==jr.layout.get("icon-text-fit"),ac=hp(Or,wo,vn,Is),Ts=Ti?hp(Ti,wo,vn,Is):void 0;al=new fp(Lr,Yt,Kr,Yi,No,Or,bo,Ji,!1,wo),xo=4*ac.length;const $g=pt.iconSizeData;let cl=null;"source"===$g.kind?(cl=[ba*jr.layout.get("icon-size").evaluate(Qt,{})],cl[0]>tc&&pn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===$g.kind&&(cl=[ba*zo.compositeIconSizes[0].evaluate(Qt,{},ki),ba*zo.compositeIconSizes[1].evaluate(Qt,{},ki)],(cl[0]>tc||cl[1]>tc)&&pn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),pt.addSymbols(pt.icon,ac,cl,yi,dr,Qt,b.WritingMode.none,Yt,ns.lineStartIndex,ns.lineLength,-1,ki),Qc=pt.icon.placedSymbolArray.length-1,Ts&&(ll=4*Ts.length,pt.addSymbols(pt.icon,Ts,cl,yi,dr,Qt,b.WritingMode.vertical,Yt,ns.lineStartIndex,ns.lineLength,-1,ki),Jd=pt.icon.placedSymbolArray.length-1)}const Bg=Object.keys(rr.horizontal);for(const wo of Bg){const Is=rr.horizontal[wo];if(!Ss){Ng=j(Is.text);const Ts=jr.layout.get("text-rotate").evaluate(Qt,{},ki);Ss=new fp(Lr,Yt,Kr,Yi,No,Is,Ar,gi,Ai,Ts)}const ac=1===Is.positionedLines.length;if(xp+=Dg(pt,Yt,Is,Es,jr,Ai,Qt,Ki,ns,rr.vertical?b.WritingMode.horizontal:b.WritingMode.horizontalOnly,ac?Bg:[wo],xa,Qc,zo,ki),ac)break}rr.vertical&&(L1+=Dg(pt,Yt,rr.vertical,Es,jr,Ai,Qt,Ki,ns,b.WritingMode.vertical,["vertical"],xa,Jd,zo,ki));const hv=Ss?Ss.boxStartIndex:pt.collisionBoxArray.length,Vg=Ss?Ss.boxEndIndex:pt.collisionBoxArray.length,z2=Ms?Ms.boxStartIndex:pt.collisionBoxArray.length,N1=Ms?Ms.boxEndIndex:pt.collisionBoxArray.length,Ug=al?al.boxStartIndex:pt.collisionBoxArray.length,dv=al?al.boxEndIndex:pt.collisionBoxArray.length,fv=rs?rs.boxStartIndex:pt.collisionBoxArray.length,eu=rs?rs.boxEndIndex:pt.collisionBoxArray.length;let Ws=-1;const wh=(wo,Is)=>wo&&wo.circleDiameter?Math.max(wo.circleDiameter,Is):Is;Ws=wh(Ss,Ws),Ws=wh(Ms,Ws),Ws=wh(al,Ws),Ws=wh(rs,Ws);const Qd=Ws>-1?1:0;Qd&&(Ws*=Ds/24),pt.glyphOffsetArray.length>=rc.MAX_GLYPHS&&pn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Qt.sortKey&&pt.addToSortKeyRanges(pt.symbolInstances.length,Qt.sortKey),pt.symbolInstances.emplaceBack(Yt.x,Yt.y,xa.right>=0?xa.right:-1,xa.center>=0?xa.center:-1,xa.left>=0?xa.left:-1,xa.vertical||-1,Qc,Jd,Ng,hv,Vg,z2,N1,Ug,dv,fv,eu,Kr,xp,L1,xo,ll,Qd,0,Ar,wp,zg,Ws)}(l,Et,Ge,u,f,_,ot,l.layers[0],l.collisionBoxArray,s.index,s.sourceLayerIndex,l.index,oe,[Ee,Ee,Ee,Ee],gt,A,Ce,$e,Ct,q,s,x,F,O,E)};if("line"===at)for(const Ge of wg(s.geometry,0,0,_n,_n)){const Et=vo(Ge,me,Ve,u.vertical||W,f,24,be,l.overscaling,_n);for(const pt of Et)W&&Gd(l,W.text,tt,pt)||it(Ge,pt)}else if("line-center"===at){for(const Ge of s.geometry)if(Ge.length>1){const Et=E1(Ge,Ve,u.vertical||W,f,24,be);Et&&it(Ge,Et)}}else if("Polygon"===s.type)for(const Ge of Pd(s.geometry,0)){const Et=tv(Ge,16);it(Ge[0],new ec(Et.x,Et.y,0))}else if("LineString"===s.type)for(const Ge of s.geometry)it(Ge,new ec(Ge[0].x,Ge[0].y,0));else if("Point"===s.type)for(const Ge of s.geometry)for(const Et of Ge)it([Et],new ec(Et.x,Et.y,0))}const tc=32640;function Dg(l,s,u,f,_,x,E,M,A,F,O,B,H,q,W){const se=function(Ce,me,Ee,$e,Ve,gt,Ct,at){const tt=$e.layout.get("text-rotate").evaluate(gt,{})*Math.PI/180,Qe=[];for(const ot of me.positionedLines)for(const it of ot.positionedGlyphs){if(!it.rect)continue;const Ge=it.rect||{};let Et=4,pt=!0,Yt=1,Kn=0;const rr=(Ve||at)&&it.vertical,Or=it.metrics.advance*it.scale/2;if(at&&me.verticalizable&&(Kn=ot.lineOffset/2-(it.imageName?-(24-it.metrics.width*it.scale)/2:24*(it.scale-1))),it.imageName){const dr=Ct[it.imageName];pt=dr.sdf,Yt=dr.pixelRatio,Et=1/Yt}const Es=Ve?[it.x+Or,it.y]:[0,0];let Ti=Ve?[0,0]:[it.x+Or+Ee[0],it.y+Ee[1]-Kn],jr=[0,0];rr&&(jr=Ti,Ti=[0,0]);const Lr=(it.metrics.left-Et)*it.scale-Or+Ti[0],Kr=(-it.metrics.top-Et)*it.scale+Ti[1],Yi=Lr+Ge.w*it.scale/Yt,No=Kr+Ge.h*it.scale/Yt,Ar=new Tt(Lr,Kr),gi=new Tt(Yi,Kr),Ai=new Tt(Lr,No),Ki=new Tt(Yi,No);if(rr){const dr=new Tt(-Or,Or- -17),yi=-Math.PI/2,Qt=12-Or,zo=new Tt(22-Qt,-(it.imageName?Qt:0)),vn=new Tt(...jr);Ar._rotateAround(yi,dr)._add(zo)._add(vn),gi._rotateAround(yi,dr)._add(zo)._add(vn),Ai._rotateAround(yi,dr)._add(zo)._add(vn),Ki._rotateAround(yi,dr)._add(zo)._add(vn)}if(tt){const dr=Math.sin(tt),yi=Math.cos(tt),Qt=[yi,-dr,dr,yi];Ar._matMult(Qt),gi._matMult(Qt),Ai._matMult(Qt),Ki._matMult(Qt)}const bo=new Tt(0,0),Ji=new Tt(0,0);Qe.push({tl:Ar,tr:gi,bl:Ai,br:Ki,tex:Ge,writingMode:me.writingMode,glyphOffset:Es,sectionIndex:it.sectionIndex,isSDF:pt,pixelOffsetTL:bo,pixelOffsetBR:Ji,minFontScaleX:0,minFontScaleY:0})}return Qe}(0,u,M,_,x,E,f,l.allowVerticalPlacement),oe=l.textSizeData;let be=null;"source"===oe.kind?(be=[ba*_.layout.get("text-size").evaluate(E,{})],be[0]>tc&&pn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===oe.kind&&(be=[ba*q.compositeTextSizes[0].evaluate(E,{},W),ba*q.compositeTextSizes[1].evaluate(E,{},W)],(be[0]>tc||be[1]>tc)&&pn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),l.addSymbols(l.text,se,be,M,x,E,F,s,A.lineStartIndex,A.lineLength,H,W);for(const Ce of O)B[Ce]=l.text.placedSymbolArray.length-1;return 4*se.length}function rv(l){for(const s in l)return l[s];return null}function Gd(l,s,u,f){const _=l.compareText;if(s in _){const x=_[s];for(let E=x.length-1;E>=0;E--)if(f.dist(x[E])E.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=qf([]),this.placementViewportMatrix=qf([]);const u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=cp(this.zoom,u["text-size"]),this.iconSizeData=cp(this.zoom,u["icon-size"]);const f=this.layers[0].layout,_=f.get("symbol-sort-key"),x=f.get("symbol-z-order");this.canOverlap="never"!==Mg(f,"text-overlap","text-allow-overlap")||"never"!==Mg(f,"icon-overlap","icon-allow-overlap")||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==x&&!_.isConstant(),this.sortFeaturesByY=("viewport-y"===x||"auto"===x&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===f.get("symbol-placement")&&(this.writingModes=f.get("text-writing-mode").map(E=>b.WritingMode[E])),this.stateDependentLayerIds=this.layers.filter(E=>E.isStateDependent()).map(E=>E.id),this.sourceID=s.sourceID}createArrays(){this.text=new ov(new Ht(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new ov(new Ht(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new en,this.lineVertexArray=new ma,this.symbolInstances=new He}calculateGlyphDependencies(s,u,f,_,x){for(let E=0;E0)&&("constant"!==E.value.kind||E.value.value.length>0),O="constant"!==A.value.kind||!!A.value.value||Object.keys(A.parameters).length>0,B=x.get("symbol-sort-key");if(this.features=[],!F&&!O)return;const H=u.iconDependencies,q=u.glyphDependencies,W=u.availableImages,se=new ur(this.zoom);for(const{feature:oe,id:be,index:Ce,sourceLayerIndex:me}of s){const Ee=_._featureFilter.needGeometry,$e=li(oe,Ee);if(!_._featureFilter.filter(se,$e,f))continue;let Ve,gt;if(Ee||($e.geometry=br(oe)),F){const at=_.getValueAndResolveTokens("text-field",$e,f,W),tt=Zr.factory(at);iv(tt)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Gl()||this.hasRTLText&&go.isParsed())&&(Ve=Bd(tt,_,$e))}if(O){const at=_.getValueAndResolveTokens("icon-image",$e,f,W);gt=at instanceof pi?at:pi.fromString(at)}if(!Ve&&!gt)continue;const Ct=this.sortFeaturesByKey?B.evaluate($e,{},f):void 0;if(this.features.push({id:be,text:Ve,icon:gt,index:Ce,sourceLayerIndex:me,geometry:$e.geometry,properties:oe.properties,type:M1[oe.type],sortKey:Ct}),gt&&(H[gt.name]=!0),Ve){const at=E.evaluate($e,{},f).join(","),tt="viewport"!==x.get("text-rotation-alignment")&&"point"!==x.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(b.WritingMode.vertical)>=0;for(const Qe of Ve.sections)if(Qe.image)H[Qe.image.name]=!0;else{const ot=po(Ve.toString()),it=Qe.fontStack||at,Ge=q[it]=q[it]||{};this.calculateGlyphDependencies(Qe.text,Ge,tt,this.allowVerticalPlacement,ot)}}}"line"===x.get("symbol-placement")&&(this.features=function(oe){const be={},Ce={},me=[];let Ee=0;function $e(at){me.push(oe[at]),Ee++}function Ve(at,tt,Qe){const ot=Ce[at];return delete Ce[at],Ce[tt]=ot,me[ot].geometry[0].pop(),me[ot].geometry[0]=me[ot].geometry[0].concat(Qe[0]),ot}function gt(at,tt,Qe){const ot=be[tt];return delete be[tt],be[at]=ot,me[ot].geometry[0].shift(),me[ot].geometry[0]=Qe[0].concat(me[ot].geometry[0]),ot}function Ct(at,tt,Qe){const ot=Qe?tt[0][tt[0].length-1]:tt[0][0];return`${at}:${ot.x}:${ot.y}`}for(let at=0;atat.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((oe,be)=>oe.sortKey-be.sortKey)}update(s,u,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,u,this.layers,f),this.icon.programConfigurations.updatePaintArrays(s,u,this.layers,f))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,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(s,u){const f=this.lineVertexArray.length;if(void 0!==s.segment){let _=s.dist(u[s.segment+1]),x=s.dist(u[s.segment]);const E={};for(let M=s.segment+1;M=0;M--)E[M]={x:u[M].x,y:u[M].y,tileUnitDistanceFromAnchor:x},M>0&&(x+=u[M-1].dist(u[M]));for(let M=0;M0}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(s,u){const f=s.placedSymbolArray.get(u),_=f.vertexStartIndex+4*f.numGlyphs;for(let x=f.vertexStartIndex;x<_;x+=4)s.indexArray.emplaceBack(x,x+1,x+2),s.indexArray.emplaceBack(x+1,x+2,x+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const u=Math.sin(s),f=Math.cos(s),_=[],x=[],E=[];for(let M=0;M_[M]-_[A]||x[A]-x[M]),E}addToSortKeyRanges(s,u){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===u?f.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const u of this.symbolInstanceIndexes){const f=this.symbolInstances.get(u);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((_,x,E)=>{_>=0&&E.indexOf(_)===x&&this.addIndicesForPlacedSymbol(this.text,_)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ct("SymbolBucket",rc,{omit:["layers","collisionBoxArray","features","compareText"]}),rc.MAX_GLYPHS=65535,rc.addDynamicAttributes=qd;const sv=new Di({"symbol-placement":new wt(Ae.layout_symbol["symbol-placement"]),"symbol-spacing":new wt(Ae.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wt(Ae.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yt(Ae.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wt(Ae.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wt(Ae.layout_symbol["icon-allow-overlap"]),"icon-overlap":new wt(Ae.layout_symbol["icon-overlap"]),"icon-ignore-placement":new wt(Ae.layout_symbol["icon-ignore-placement"]),"icon-optional":new wt(Ae.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wt(Ae.layout_symbol["icon-rotation-alignment"]),"icon-size":new yt(Ae.layout_symbol["icon-size"]),"icon-text-fit":new wt(Ae.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wt(Ae.layout_symbol["icon-text-fit-padding"]),"icon-image":new yt(Ae.layout_symbol["icon-image"]),"icon-rotate":new yt(Ae.layout_symbol["icon-rotate"]),"icon-padding":new yt(Ae.layout_symbol["icon-padding"]),"icon-keep-upright":new wt(Ae.layout_symbol["icon-keep-upright"]),"icon-offset":new yt(Ae.layout_symbol["icon-offset"]),"icon-anchor":new yt(Ae.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wt(Ae.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wt(Ae.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wt(Ae.layout_symbol["text-rotation-alignment"]),"text-field":new yt(Ae.layout_symbol["text-field"]),"text-font":new yt(Ae.layout_symbol["text-font"]),"text-size":new yt(Ae.layout_symbol["text-size"]),"text-max-width":new yt(Ae.layout_symbol["text-max-width"]),"text-line-height":new wt(Ae.layout_symbol["text-line-height"]),"text-letter-spacing":new yt(Ae.layout_symbol["text-letter-spacing"]),"text-justify":new yt(Ae.layout_symbol["text-justify"]),"text-radial-offset":new yt(Ae.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wt(Ae.layout_symbol["text-variable-anchor"]),"text-anchor":new yt(Ae.layout_symbol["text-anchor"]),"text-max-angle":new wt(Ae.layout_symbol["text-max-angle"]),"text-writing-mode":new wt(Ae.layout_symbol["text-writing-mode"]),"text-rotate":new yt(Ae.layout_symbol["text-rotate"]),"text-padding":new wt(Ae.layout_symbol["text-padding"]),"text-keep-upright":new wt(Ae.layout_symbol["text-keep-upright"]),"text-transform":new yt(Ae.layout_symbol["text-transform"]),"text-offset":new yt(Ae.layout_symbol["text-offset"]),"text-allow-overlap":new wt(Ae.layout_symbol["text-allow-overlap"]),"text-overlap":new wt(Ae.layout_symbol["text-overlap"]),"text-ignore-placement":new wt(Ae.layout_symbol["text-ignore-placement"]),"text-optional":new wt(Ae.layout_symbol["text-optional"])});var Sg={paint:new Di({"icon-opacity":new yt(Ae.paint_symbol["icon-opacity"]),"icon-color":new yt(Ae.paint_symbol["icon-color"]),"icon-halo-color":new yt(Ae.paint_symbol["icon-halo-color"]),"icon-halo-width":new yt(Ae.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yt(Ae.paint_symbol["icon-halo-blur"]),"icon-translate":new wt(Ae.paint_symbol["icon-translate"]),"icon-translate-anchor":new wt(Ae.paint_symbol["icon-translate-anchor"]),"text-opacity":new yt(Ae.paint_symbol["text-opacity"]),"text-color":new yt(Ae.paint_symbol["text-color"],{runtimeType:so,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new yt(Ae.paint_symbol["text-halo-color"]),"text-halo-width":new yt(Ae.paint_symbol["text-halo-width"]),"text-halo-blur":new yt(Ae.paint_symbol["text-halo-blur"]),"text-translate":new wt(Ae.paint_symbol["text-translate"]),"text-translate-anchor":new wt(Ae.paint_symbol["text-translate-anchor"])}),layout:sv};class pp{constructor(s){if(void 0===s.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:ms,this.defaultValue=s}evaluate(s){if(s.formattedSection){const u=this.defaultValue.property.overrides;if(u&&u.hasOverride(s.formattedSection))return u.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ct("FormatSectionOverride",pp,{omit:["defaultValue"]});class mp extends Ko{constructor(s){super(s,Sg)}recalculate(s,u){if(super.recalculate(s,u),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const f=this.layout.get("text-writing-mode");if(f){const _=[];for(const x of f)_.indexOf(x)<0&&_.push(x);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,u,f,_){const x=this.layout.get(s).evaluate(u,{},f,_),E=this._unevaluatedLayout._values[s];return E.isDataDriven()||Cn(E.value)||!x?x:(M=u.properties,x.replace(/{([^{}]+)}/g,(F,O)=>O in M?String(M[O]):""));var M}createBucket(s){return new rc(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of Sg.paint.overridableProperties){if(!mp.hasPaintOverride(this.layout,s))continue;const u=this.paint.get(s),f=new pp(u),_=new ca(f,u.property.specification);let x=null;x="constant"===u.value.kind||"source"===u.value.kind?new zc("source",_):new Bc("composite",_,u.value.zoomStops),this.paint._values[s]=new vs(u.property,x,u.parameters)}}_handleOverridablePaintPropertyUpdate(s,u,f){return!(!this.layout||u.isDataDriven()||f.isDataDriven())&&mp.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,u){const f=s.get("text-field"),_=Sg.paint.properties[u];let x=!1;const E=M=>{for(const A of M)if(_.overrides&&_.overrides.hasOverride(A))return void(x=!0)};if("constant"===f.value.kind&&f.value.value instanceof Zr)E(f.value.value.sections);else if("source"===f.value.kind){const M=F=>{x||(F instanceof $&&J(F.value)===Ci?E(F.value.sections):F instanceof Nc?E(F.sections):F.eachChild(M))},A=f.value;A._styleExpression&&M(A._styleExpression.expression)}return x}}function Mg(l,s,u){let f="never";const _=l.get(s);return _?f=_:l.get(u)&&(f="always"),f}var T1={paint:new Di({"background-color":new wt(Ae.paint_background["background-color"]),"background-pattern":new _d(Ae.paint_background["background-pattern"]),"background-opacity":new wt(Ae.paint_background["background-opacity"])})},A1={paint:new Di({"raster-opacity":new wt(Ae.paint_raster["raster-opacity"]),"raster-hue-rotate":new wt(Ae.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new wt(Ae.paint_raster["raster-brightness-min"]),"raster-brightness-max":new wt(Ae.paint_raster["raster-brightness-max"]),"raster-saturation":new wt(Ae.paint_raster["raster-saturation"]),"raster-contrast":new wt(Ae.paint_raster["raster-contrast"]),"raster-resampling":new wt(Ae.paint_raster["raster-resampling"]),"raster-fade-duration":new wt(Ae.paint_raster["raster-fade-duration"])})};class k1 extends Ko{constructor(s){super(s,{}),this.onAdd=u=>{this.implementation.onAdd&&this.implementation.onAdd(u,u.painter.context.gl)},this.onRemove=u=>{this.implementation.onRemove&&this.implementation.onRemove(u,u.painter.context.gl)},this.implementation=s}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const P1={circle:class extends Ko{constructor(l){super(l,Md)}createBucket(l){return new Jo(l)}queryRadius(l){const s=l;return ya("circle-radius",this,s)+ya("circle-stroke-width",this,s)+Zs(this.paint.get("circle-translate"))}queryIntersectsFeature(l,s,u,f,_,x,E,M){const A=ah(l,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),x.angle,E),F=this.paint.get("circle-radius").evaluate(s,u)+this.paint.get("circle-stroke-width").evaluate(s,u),O="map"===this.paint.get("circle-pitch-alignment"),B=O?A:(W=M,A.map(se=>lh(se,W))),H=O?F*E:F;var W;for(const q of f)for(const W of q){const se=O?W:lh(W,M);let oe=H;const be=Zf([],[W.x,W.y,0,1],M);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?oe*=be[3]/x.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(oe*=x.cameraToCenterDistance/be[3]),Yl(B,se,oe))return!0}return!1}},heatmap:class extends Ko{createBucket(l){return new Wf(l)}constructor(l){super(l,Xm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){"heatmap-color"===l&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Km({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},hillshade:class extends Ko{constructor(l){super(l,R_)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},fill:class extends Ko{constructor(l){super(l,B_)}recalculate(l,s){super.recalculate(l,s);const u=this.paint._values["fill-outline-color"];"constant"===u.value.kind&&void 0===u.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(l){return new _o(l)}queryRadius(){return Zs(this.paint.get("fill-translate"))}queryIntersectsFeature(l,s,u,f,_,x,E){return Rr(ah(l,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),x.angle,E),f)}isTileClipped(){return!0}},"fill-extrusion":class extends Ko{constructor(l){super(l,F2)}createBucket(l){return new sg(l)}queryRadius(){return Zs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(l,s,u,f,_,x,E,M){const A=ah(l,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,E),F=this.paint.get("fill-extrusion-height").evaluate(s,u),O=this.paint.get("fill-extrusion-base").evaluate(s,u),B=function(q,W,se,oe){const be=[];for(const Ce of q){const me=[Ce.x,Ce.y,0,1];Zf(me,me,W),be.push(new Tt(me[0]/me[3],me[1]/me[3]))}return be}(A,M),H=function(q,W,se,oe){const be=[],Ce=[],me=oe[8]*W,Ee=oe[9]*W,$e=oe[10]*W,Ve=oe[11]*W,gt=oe[8]*se,Ct=oe[9]*se,at=oe[10]*se,tt=oe[11]*se;for(const Qe of q){const ot=[],it=[];for(const Ge of Qe){const Et=Ge.x,pt=Ge.y,Yt=oe[0]*Et+oe[4]*pt+oe[12],Kn=oe[1]*Et+oe[5]*pt+oe[13],rr=oe[2]*Et+oe[6]*pt+oe[14],Or=oe[3]*Et+oe[7]*pt+oe[15],Es=rr+$e,Ti=Or+Ve,jr=Yt+gt,Lr=Kn+Ct,Kr=rr+at,Yi=Or+tt,No=new Tt((Yt+me)/Ti,(Kn+Ee)/Ti);No.z=Es/Ti,ot.push(No);const Ar=new Tt(jr/Yi,Lr/Yi);Ar.z=Kr/Yi,it.push(Ar)}be.push(ot),Ce.push(it)}return[be,Ce]}(f,O,F,M);return function(q,W,se){let oe=1/0;Rr(se,W)&&(oe=np(se,W[0]));for(let be=0;be=3)for(let se=0;se{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const Zd=6371008.8;class xr{constructor(s,u){if(isNaN(s)||isNaN(u))throw new Error(`Invalid LngLat object: (${s}, ${u})`);if(this.lng=+s,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new xr(Te(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const u=Math.PI/180,f=this.lat*u,_=s.lat*u,x=Math.sin(f)*Math.sin(_)+Math.cos(f)*Math.cos(_)*Math.cos((s.lng-this.lng)*u);return Zd*Math.acos(Math.min(x,1))}toBounds(s=0){const u=360*s/40075017,f=u/Math.cos(Math.PI/180*this.lat);return new lv(new xr(this.lng-f,this.lat-u),new xr(this.lng+f,this.lat+u))}static convert(s){if(s instanceof xr)return s;if(Array.isArray(s)&&(2===s.length||3===s.length))return new xr(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&"object"==typeof s&&null!==s)return new xr(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class ic{constructor(s,u){s&&(u?this.setSouthWest(s).setNorthEast(u):4===s.length?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))}setNorthEast(s){return this._ne=s instanceof xr?new xr(s.lng,s.lat):xr.convert(s),this}setSouthWest(s){return this._sw=s instanceof xr?new xr(s.lng,s.lat):xr.convert(s),this}extend(s){const u=this._sw,f=this._ne;let _,x;if(s instanceof xr)_=s,x=s;else{if(!(s instanceof ic))return Array.isArray(s)?4===s.length||s.every(Array.isArray)?this.extend(ic.convert(s)):this.extend(xr.convert(s)):this;if(_=s._sw,x=s._ne,!_||!x)return this}return u||f?(u.lng=Math.min(_.lng,u.lng),u.lat=Math.min(_.lat,u.lat),f.lng=Math.max(x.lng,f.lng),f.lat=Math.max(x.lat,f.lat)):(this._sw=new xr(_.lng,_.lat),this._ne=new xr(x.lng,x.lat)),this}getCenter(){return new xr((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 xr(this.getWest(),this.getNorth())}getSouthEast(){return new xr(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(s){const{lng:u,lat:f}=xr.convert(s);let _=this._sw.lng<=u&&u<=this._ne.lng;return this._sw.lng>this._ne.lng&&(_=this._sw.lng>=u&&u>=this._ne.lng),this._sw.lat<=f&&f<=this._ne.lat&&_}static convert(s){return s instanceof ic?s:s&&new ic(s)}}var lv=ic;const cv=2*Math.PI*Zd;function Ig(l){return cv*Math.cos(l*Math.PI/180)}function Tg(l){return(180+l)/360}function oc(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function Ag(l,s){return l/Ig(s)}function gp(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}class yp{constructor(s,u,f=0){this.x=+s,this.y=+u,this.z=+f}static fromLngLat(s,u=0){const f=xr.convert(s);return new yp(Tg(f.lng),oc(f.lat),Ag(u,f.lat))}toLngLat(){return new xr(360*this.x-180,gp(this.y))}toAltitude(){return this.z*Ig(gp(this.y))}meterInMercatorCoordinateUnits(){return 1/cv*(s=gp(this.y),1/Math.cos(s*Math.PI/180));var s}}function R1(l,s,u){var f=2*Math.PI*6378137/256/Math.pow(2,u);return[l*f-2*Math.PI*6378137/2,s*f-2*Math.PI*6378137/2]}class vh{constructor(s,u,f){if(s<0||s>25||f<0||f>=Math.pow(2,s)||u<0||u>=Math.pow(2,s))throw new Error(`x=${u}, y=${f}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=u,this.y=f,this.key=bh(0,s,s,u,f)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,u,f){const _=(E=this.y,M=this.z,A=R1(256*(x=this.x),256*(E=Math.pow(2,M)-E-1),M),F=R1(256*(x+1),256*(E+1),M),A[0]+","+A[1]+","+F[0]+","+F[1]);var x,E,M,A,F;const O=function(B,H,q){let W,se="";for(let oe=B;oe>0;oe--)W=1<1?"@2x":"").replace(/{quadkey}/g,O).replace(/{bbox-epsg-3857}/g,_)}isChildOf(s){const u=this.z-s.z;return u>0&&s.x===this.x>>u&&s.y===this.y>>u}getTilePoint(s){const u=Math.pow(2,this.z);return new Tt((s.x*u-this.x)*_n,(s.y*u-this.y)*_n)}toString(){return`${this.z}/${this.x}/${this.y}`}}class uv{constructor(s,u){this.wrap=s,this.canonical=u,this.key=bh(s,u.z,u.z,u.x,u.y)}}class Lo{constructor(s,u,f,_,x){if(s= z; overscaledZ = ${s}; z = ${f}`);this.overscaledZ=s,this.wrap=u,this.canonical=new vh(f,+_,+x),this.key=bh(u,s,f,_,x)}clone(){return new Lo(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const u=this.canonical.z-s;return s>this.canonical.z?new Lo(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Lo(s,this.wrap,s,this.canonical.x>>u,this.canonical.y>>u)}calculateScaledKey(s,u){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-s;return s>this.canonical.z?bh(this.wrap*+u,s,this.canonical.z,this.canonical.x,this.canonical.y):bh(this.wrap*+u,s,s,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const u=this.canonical.z-s.canonical.z;return 0===s.overscaledZ||s.overscaledZ>u&&s.canonical.y===this.canonical.y>>u}children(s){if(this.overscaledZ>=s)return[new Lo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const u=this.canonical.z+1,f=2*this.canonical.x,_=2*this.canonical.y;return[new Lo(u,this.wrap,u,f,_),new Lo(u,this.wrap,u,f+1,_),new Lo(u,this.wrap,u,f,_+1),new Lo(u,this.wrap,u,f+1,_+1)]}isLessThan(s){return this.wraps.wrap)&&(this.overscaledZs.overscaledZ)&&(this.canonical.xs.canonical.x)&&this.canonical.ythis.max&&(this.max=M),M=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(s+1)}_unpackMapbox(s,u,f){return(256*s*256+256*u+f)/10-1e4}_unpackTerrarium(s,u,f){return 256*s+u+f/256-32768}getPixels(){return new Oo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,u,f){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let _=u*this.dim,x=u*this.dim+this.dim,E=f*this.dim,M=f*this.dim+this.dim;switch(u){case-1:_=x-1;break;case 1:x=_+1}switch(f){case-1:E=M-1;break;case 1:M=E+1}const A=-u*this.dim,F=-f*this.dim;for(let O=E;O=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class Pg{constructor(s,u,f,_,x){this.type="Feature",this._vectorTileFeature=s,s._z=u,s._x=f,s._y=_,this.properties=s.properties,this.id=x}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const u in this)"_geometry"!==u&&"_vectorTileFeature"!==u&&(s[u]=this[u]);return s}}class Wd{constructor(s,u){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new $s(_n,16,0),this.grid3D=new $s(_n,16,0),this.featureIndexArray=new Pr,this.promoteId=u}insert(s,u,f,_,x,E){const M=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,_,x);const A=E?this.grid3D:this.grid;for(let F=0;F=0&&B[3]>=0&&A.insert(M,B[0],B[1],B[2],B[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ql.VectorTile(new hg(this.rawTileData)).layers,this.sourceLayerCoder=new _p(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,u,f,_){this.loadVTLayers();const x=s.params||{},E=_n/s.tileSize/s.scale,M=Lt(x.filter),A=s.queryGeometry,F=s.queryPadding*E,O=Rg(A),B=this.grid.query(O.minX-F,O.minY-F,O.maxX+F,O.maxY+F),H=Rg(s.cameraQueryGeometry),q=this.grid3D.query(H.minX-F,H.minY-F,H.maxX+F,H.maxY+F,(oe,be,Ce,me)=>function(Ee,$e,Ve,gt,Ct){for(const tt of Ee)if($e<=tt.x&&Ve<=tt.y&>>=tt.x&&Ct>=tt.y)return!0;const at=[new Tt($e,Ve),new Tt($e,Ct),new Tt(gt,Ct),new Tt(gt,Ve)];if(Ee.length>2)for(const tt of at)if(Zi(Ee,tt))return!0;for(let tt=0;tt(me||(me=br(Ee)),$e.queryIntersectsFeature(A,Ee,Ve,me,this.z,s.transform,E,s.pixelPosMatrix)))}return W}loadMatchingFeature(s,u,f,_,x,E,M,A,F,O,B){const H=this.bucketLayerIDs[u];if(E&&!function(oe,be){for(let Ce=0;Ce=0)return!0;return!1}(E,H))return;const q=this.sourceLayerCoder.decode(f),W=this.vtLayers[q].feature(_);if(x.needGeometry){const oe=li(W,!0);if(!x.filter(new ur(this.tileID.overscaledZ),oe,this.tileID.canonical))return}else if(!x.filter(new ur(this.tileID.overscaledZ),W))return;const se=this.getId(W,q);for(let oe=0;oe{const M=s instanceof bs?s.get(E):null;return M&&M.evaluate?M.evaluate(u,f,_):M})}function Rg(l){let s=1/0,u=1/0,f=-1/0,_=-1/0;for(const x of l)s=Math.min(s,x.x),u=Math.min(u,x.y),f=Math.max(f,x.x),_=Math.max(_,x.y);return{minX:s,minY:u,maxX:f,maxY:_}}function Fg(l,s){return s-l}function Yd(l,s,u,f,_,x){if(_-f<=u)return;const E=f+_>>1;vp(l,s,E,f,_,x%2),Yd(l,s,u,f,E-1,x+1),Yd(l,s,u,E+1,_,x+1)}function vp(l,s,u,f,_,x){for(;_>f;){if(_-f>600){const F=_-f+1,O=u-f+1,B=Math.log(F),H=.5*Math.exp(2*B/3),q=.5*Math.sqrt(B*H*(F-H)/F)*(O-F/2<0?-1:1);vp(l,s,u,Math.max(f,Math.floor(u-O*H/F+q)),Math.min(_,Math.floor(u+(F-O)*H/F+q)),x)}const E=s[2*u+x];let M=f,A=_;for(sl(l,s,f,u),s[2*_+x]>E&&sl(l,s,f,_);ME;)A--}s[2*f+x]===E?sl(l,s,f,A):(A++,sl(l,s,A,_)),A<=u&&(f=A+1),u<=A&&(_=A-1)}}function sl(l,s,u,f){Og(l,u,f),Og(s,2*u,2*f),Og(s,2*u+1,2*f+1)}function Og(l,s,u){const f=l[s];l[s]=l[u],l[u]=f}function Lg(l,s,u,f){const _=l-u,x=s-f;return _*_+x*x}ct("FeatureIndex",Wd,{omit:["rawTileData","sourceLayerCoder"]});const F1=l=>l[0],O1=l=>l[1];var bp;b.PerformanceMarkers=void 0,(bp=b.PerformanceMarkers||(b.PerformanceMarkers={})).create="create",bp.load="load",bp.fullLoad="fullLoad";let xh=null,sc=[];const Kd=1e3/30,Jc={mark(l){performance.mark(l)},frame(l){const s=l;null!=xh&&sc.push(s-xh),xh=s},clearMetrics(){xh=null,sc=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const l in b.PerformanceMarkers)performance.clearMarks(b.PerformanceMarkers[l])},getPerformanceMetrics(){performance.measure("loadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.load),performance.measure("fullLoadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.fullLoad);const l=performance.getEntriesByName("loadTime")[0].duration,s=performance.getEntriesByName("fullLoadTime")[0].duration,u=sc.length,f=1/(sc.reduce((x,E)=>x+E,0)/u/1e3),_=sc.filter(x=>x>Kd).reduce((x,E)=>x+(E-Kd)/Kd,0);return{loadTime:l,fullLoadTime:s,fps:f,percentDroppedFrames:_/(u+_)*100}}};b.AJAXError=Ns,b.ARRAY_TYPE=tl,b.Actor=class{constructor(l,s,u){this.target=l,this.parent=s,this.mapId=u,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Os(["receive","process"],this),this.invoker=new av(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Mo()?l:window}send(l,s,u,f,_=!1){const x=Math.round(1e18*Math.random()).toString(36).substring(0,10);u&&(this.callbacks[x]=u);const E=Ls(this.globalScope)?void 0:[];return this.target.postMessage({id:x,type:l,hasCallback:!!u,targetMapId:f,mustQueue:_,sourceMapId:this.mapId,data:fo(s,E)},E),{cancel:()=>{u&&delete this.callbacks[x],this.target.postMessage({id:x,type:"",targetMapId:f,sourceMapId:this.mapId})}}}receive(l){const s=l.data,u=s.id;if(u&&(!s.targetMapId||this.mapId===s.targetMapId))if(""===s.type){delete this.tasks[u];const f=this.cancelCallbacks[u];delete this.cancelCallbacks[u],f&&f()}else Mo()||s.mustQueue?(this.tasks[u]=s,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,s)}process(){if(!this.taskQueue.length)return;const l=this.taskQueue.shift(),s=this.tasks[l];delete this.tasks[l],this.taskQueue.length&&this.invoker.trigger(),s&&this.processTask(l,s)}processTask(l,s){if(""===s.type){const u=this.callbacks[l];delete this.callbacks[l],u&&(s.error?u(Er(s.error)):u(null,Er(s.data)))}else{let u=!1;const f=Ls(this.globalScope)?void 0:[],_=s.hasCallback?(M,A)=>{u=!0,delete this.cancelCallbacks[l],this.target.postMessage({id:l,type:"",sourceMapId:this.mapId,error:M?fo(M):null,data:fo(A,f)},f)}:M=>{u=!0};let x=null;const E=Er(s.data);if(this.parent[s.type])x=this.parent[s.type](s.sourceMapId,E,_);else if(this.parent.getWorkerSource){const M=s.type.split(".");x=this.parent.getWorkerSource(s.sourceMapId,M[0],E.source)[M[1]](E,_)}else _(new Error(`Could not find function ${s.type}`));!u&&x&&x.cancel&&(this.cancelCallbacks[l]=x.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},b.AlphaImage=uh,b.CanonicalTileID=vh,b.CollisionBoxArray=Ed,b.CollisionCircleLayoutArray=class extends xd{},b.Color=Sn,b.DEMData=kg,b.DataConstantProperty=wt,b.DictionaryCoder=_p,b.EXTENT=_n,b.ErrorEvent=yr,b.EvaluationParameters=ur,b.Event=ra,b.Evented=Qn,b.FeatureIndex=Wd,b.FillBucket=_o,b.FillExtrusionBucket=sg,b.GeoJSONFeature=Pg,b.ImageAtlas=x1,b.ImagePosition=W_,b.KDBush=class{constructor(l,s=F1,u=O1,f=64,_=Float64Array){this.nodeSize=f,this.points=l;const x=l.length<65536?Uint16Array:Uint32Array,E=this.ids=new x(l.length),M=this.coords=new _(2*l.length);for(let A=0;A=E&&q<=A&&W>=M&&W<=F&&H.push(_[Ee]);continue}const Ce=Math.floor((be+oe)/2);q=x[2*Ce],W=x[2*Ce+1],q>=E&&q<=A&&W>=M&&W<=F&&H.push(_[Ce]);const me=(se+1)%2;(0===se?E<=q:M<=W)&&(B.push(be),B.push(Ce-1),B.push(me)),(0===se?A>=q:F>=W)&&(B.push(Ce+1),B.push(oe),B.push(me))}return H}(this.ids,this.coords,l,s,u,f,this.nodeSize)}within(l,s,u){return function(f,_,x,E,M,A){const F=[0,f.length-1,0],O=[],B=M*M;for(;F.length;){const H=F.pop(),q=F.pop(),W=F.pop();if(q-W<=A){for(let me=W;me<=q;me++)Lg(_[2*me],_[2*me+1],x,E)<=B&&O.push(f[me]);continue}const se=Math.floor((W+q)/2),oe=_[2*se],be=_[2*se+1];Lg(oe,be,x,E)<=B&&O.push(f[se]);const Ce=(H+1)%2;(0===H?x-M<=oe:E-M<=be)&&(F.push(W),F.push(se-1),F.push(Ce)),(0===H?x+M>=oe:E+M>=be)&&(F.push(se+1),F.push(q),F.push(Ce))}return O}(this.ids,this.coords,l,s,u,this.nodeSize)}},b.LineBucket=lg,b.LineStripIndexArray=class extends wd{},b.LngLat=xr,b.LngLatBounds=lv,b.MercatorCoordinate=yp,b.ONE_EM=24,b.OverscaledTileID=Lo,b.PerformanceUtils=Jc,b.Pos3dArray=class extends Ju{},b.PosArray=ih,b.Properties=Di,b.QuadTriangleArray=class extends th{},b.RGBAImage=Oo,b.RasterBoundsArray=class extends Hc{},b.RequestPerformance=class{constructor(l){this._marks={start:[l.url,"start"].join("#"),end:[l.url,"end"].join("#"),measure:l.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let l=performance.getEntriesByName(this._marks.measure);return 0===l.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),l=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),l}},b.SegmentVector=R,b.SymbolBucket=rc,b.Transitionable=Xu,b.TriangleIndexArray=w,b.Uniform1f=ke,b.Uniform1i=class extends Se{constructor(l,s){super(l,s),this.current=0}set(l){this.current!==l&&(this.current=l,this.gl.uniform1i(this.location,l))}},b.Uniform2f=class extends Se{constructor(l,s){super(l,s),this.current=[0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]||(this.current=l,this.gl.uniform2f(this.location,l[0],l[1]))}},b.Uniform3f=class extends Se{constructor(l,s){super(l,s),this.current=[0,0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]&&l[2]===this.current[2]||(this.current=l,this.gl.uniform3f(this.location,l[0],l[1],l[2]))}},b.Uniform4f=Be,b.UniformColor=Le,b.UniformMatrix4f=class extends Se{constructor(l,s){super(l,s),this.current=Ne}set(l){if(l[12]!==this.current[12]||l[0]!==this.current[0])return this.current=l,void this.gl.uniformMatrix4fv(this.location,!1,l);for(let s=1;s<16;s++)if(l[s]!==this.current[s]){this.current=l,this.gl.uniformMatrix4fv(this.location,!1,l);break}}},b.UnwrappedTileID=uv,b.ValidationError=Pe,b.ZoomHistory=Bf,b.addDynamicAttributes=qd,b.arrayBufferToImage=function(l,s){const u=new Image;u.onload=()=>{s(null,u),URL.revokeObjectURL(u.src),u.onload=null,window.requestAnimationFrame(()=>{u.src=Fa})},u.onerror=()=>s(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 f=new Blob([new Uint8Array(l)],{type:"image/png"});u.src=l.byteLength?URL.createObjectURL(f):Fa},b.arrayBufferToImageBitmap=function(l,s){const u=new Blob([new Uint8Array(l)],{type:"image/png"});createImageBitmap(u).then(f=>{s(null,f)}).catch(f=>{s(new Error(`Could not load image because of ${f.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},b.asyncAll=function(l,s,u){if(!l.length)return u(null,[]);let f=l.length;const _=new Array(l.length);let x=null;l.forEach((E,M)=>{s(E,(A,F)=>{A&&(x=A),_[M]=F,0==--f&&u(x,_)})})},b.bezier=ds,b.bindAll=Os,b.clamp=Zt,b.clipLine=wg,b.clone=function(l){var s=new tl(16);return s[0]=l[0],s[1]=l[1],s[2]=l[2],s[3]=l[3],s[4]=l[4],s[5]=l[5],s[6]=l[6],s[7]=l[7],s[8]=l[8],s[9]=l[9],s[10]=l[10],s[11]=l[11],s[12]=l[12],s[13]=l[13],s[14]=l[14],s[15]=l[15],s},b.clone$1=wi,b.collisionCircleLayout=ug,b.config=Oa,b.copy=function(l,s){return l[0]=s[0],l[1]=s[1],l[2]=s[2],l[3]=s[3],l[4]=s[4],l[5]=s[5],l[6]=s[6],l[7]=s[7],l[8]=s[8],l[9]=s[9],l[10]=s[10],l[11]=s[11],l[12]=s[12],l[13]=s[13],l[14]=s[14],l[15]=s[15],l},b.create=function(){var l=new tl(16);return tl!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},b.createExpression=qa,b.createFilter=Lt,b.createLayout=Dr,b.createStyleLayer=function(l){return"custom"===l.type?new k1(l):new P1[l.type](l)},b.dot=function(l,s){return l[0]*s[0]+l[1]*s[1]+l[2]*s[2]+l[3]*s[3]},b.earthRadius=Zd,b.ease=Pl,b.emitValidationErrors=dd,b.equals=function(l,s){var u=l[0],f=l[1],_=l[2],x=l[3],E=l[4],M=l[5],A=l[6],F=l[7],O=l[8],B=l[9],H=l[10],q=l[11],W=l[12],se=l[13],oe=l[14],be=l[15],Ce=s[0],me=s[1],Ee=s[2],$e=s[3],Ve=s[4],gt=s[5],Ct=s[6],at=s[7],tt=s[8],Qe=s[9],ot=s[10],it=s[11],Ge=s[12],Et=s[13],pt=s[14],Yt=s[15];return Math.abs(u-Ce)<=Mr*Math.max(1,Math.abs(u),Math.abs(Ce))&&Math.abs(f-me)<=Mr*Math.max(1,Math.abs(f),Math.abs(me))&&Math.abs(_-Ee)<=Mr*Math.max(1,Math.abs(_),Math.abs(Ee))&&Math.abs(x-$e)<=Mr*Math.max(1,Math.abs(x),Math.abs($e))&&Math.abs(E-Ve)<=Mr*Math.max(1,Math.abs(E),Math.abs(Ve))&&Math.abs(M-gt)<=Mr*Math.max(1,Math.abs(M),Math.abs(gt))&&Math.abs(A-Ct)<=Mr*Math.max(1,Math.abs(A),Math.abs(Ct))&&Math.abs(F-at)<=Mr*Math.max(1,Math.abs(F),Math.abs(at))&&Math.abs(O-tt)<=Mr*Math.max(1,Math.abs(O),Math.abs(tt))&&Math.abs(B-Qe)<=Mr*Math.max(1,Math.abs(B),Math.abs(Qe))&&Math.abs(H-ot)<=Mr*Math.max(1,Math.abs(H),Math.abs(ot))&&Math.abs(q-it)<=Mr*Math.max(1,Math.abs(q),Math.abs(it))&&Math.abs(W-Ge)<=Mr*Math.max(1,Math.abs(W),Math.abs(Ge))&&Math.abs(se-Et)<=Mr*Math.max(1,Math.abs(se),Math.abs(Et))&&Math.abs(oe-pt)<=Mr*Math.max(1,Math.abs(oe),Math.abs(pt))&&Math.abs(be-Yt)<=Mr*Math.max(1,Math.abs(be),Math.abs(Yt))},b.evaluateSizeForFeature=function(l,{uSize:s,uSizeT:u},{lowerSize:f,upperSize:_}){return"source"===l.kind?f/ba:"composite"===l.kind?Xn(f/ba,_/ba,u):s},b.evaluateSizeForZoom=function(l,s){let u=0,f=0;if("constant"===l.kind)f=l.layoutSize;else if("source"!==l.kind){const{interpolationType:_,minZoom:x,maxZoom:E}=l,M=_?Zt(Io.interpolationFactor(_,s,x,E),0,1):0;"camera"===l.kind?f=Xn(l.minSize,l.maxSize,M):u=M}return{uSizeT:u,uSize:f}},b.evaluateVariableOffset=nv,b.evented=jf,b.exported=Pu,b.extend=zi,b.filterObject=Rl,b.fromScaling=function(l,s){return l[0]=s[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=s[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=s[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},b.getAnchorAlignment=Xi,b.getAnchorJustification=Hd,b.getArrayBuffer=La,b.getJSON=function(l,s){return Fl(zi(l,{type:"json"}),s)},b.getOverlapMode=Mg,b.getRTLTextPluginStatus=Gl,b.getReferrer=Nn,b.getVideo=function(l,s){const u=window.document.createElement("video");u.muted=!0,u.onloadstart=function(){s(null,u)};for(let f=0;f{}}},b.identity=qf,b.invert=function(l,s){var u=s[0],f=s[1],_=s[2],x=s[3],E=s[4],M=s[5],A=s[6],F=s[7],O=s[8],B=s[9],H=s[10],q=s[11],W=s[12],se=s[13],oe=s[14],be=s[15],Ce=u*M-f*E,me=u*A-_*E,Ee=u*F-x*E,$e=f*A-_*M,Ve=f*F-x*M,gt=_*F-x*A,Ct=O*se-B*W,at=O*oe-H*W,tt=O*be-q*W,Qe=B*oe-H*se,ot=B*be-q*se,it=H*be-q*oe,Ge=Ce*it-me*ot+Ee*Qe+$e*tt-Ve*at+gt*Ct;return Ge?(l[0]=(M*it-A*ot+F*Qe)*(Ge=1/Ge),l[1]=(_*ot-f*it-x*Qe)*Ge,l[2]=(se*gt-oe*Ve+be*$e)*Ge,l[3]=(H*Ve-B*gt-q*$e)*Ge,l[4]=(A*tt-E*it-F*at)*Ge,l[5]=(u*it-_*tt+x*at)*Ge,l[6]=(oe*Ee-W*gt-be*me)*Ge,l[7]=(O*gt-H*Ee+q*me)*Ge,l[8]=(E*ot-M*tt+F*Ct)*Ge,l[9]=(f*tt-u*ot-x*Ct)*Ge,l[10]=(W*Ve-se*Ee+be*Ce)*Ge,l[11]=(B*Ee-O*Ve-q*Ce)*Ge,l[12]=(M*at-E*Qe-A*Ct)*Ge,l[13]=(u*Qe-f*at+_*Ct)*Ge,l[14]=(se*me-W*$e-oe*Ce)*Ge,l[15]=(O*$e-B*me+H*Ce)*Ge,l):null},b.isImageBitmap=oo,b.isSafari=Ls,b.isWorker=Mo,b.keysDifference=function(l,s){const u=[];for(const f in l)f in s||u.push(f);return u},b.lazyLoadRTLTextPlugin=function(){go.isLoading()||go.isLoaded()||"deferred"!==Gl()||Zm()},b.makeRequest=Fl,b.mapObject=Ra,b.mercatorXfromLng=Tg,b.mercatorYfromLat=oc,b.mercatorZfromAltitude=Ag,b.mul=_a,b.mul$1=function(l,s,u){return l[0]=s[0]*u[0],l[1]=s[1]*u[1],l[2]=s[2]*u[2],l[3]=s[3]*u[3],l},b.multiply=Wm,b.nextPowerOfTwo=function(l){return l<=1?1:Math.pow(2,Math.ceil(Math.log(l)/Math.LN2))},b.number=Xn,b.ortho=function(l,s,u,f,_,x,E){var M=1/(s-u),A=1/(f-_),F=1/(x-E);return l[0]=-2*M,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=-2*A,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2*F,l[11]=0,l[12]=(s+u)*M,l[13]=(_+f)*A,l[14]=(E+x)*F,l[15]=1,l},b.parseCacheControl=function(l){const s={};if(l.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(u,f,_,x)=>{const E=_||x;return s[f]=!E||E.toLowerCase(),""}),s["max-age"]){const u=parseInt(s["max-age"],10);isNaN(u)?delete s["max-age"]:s["max-age"]=u}return s},b.parseGlyphPbf=function(l){return new hg(l).readFields(L2,[])},b.pbf=hg,b.performSymbolLayout=function(l){l.bucket.createArrays(),l.bucket.tilePixelRatio=_n/(512*l.bucket.overscaling),l.bucket.compareText={},l.bucket.iconsNeedLinear=!1;const s=l.bucket.layers[0].layout,u=l.bucket.layers[0]._unevaluatedLayout._values,f={layoutIconSize:u["icon-size"].possiblyEvaluate(new ur(l.bucket.zoom+1),l.canonical),layoutTextSize:u["text-size"].possiblyEvaluate(new ur(l.bucket.zoom+1),l.canonical),textMaxSize:u["text-size"].possiblyEvaluate(new ur(18))};if("composite"===l.bucket.textSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.textSizeData;f.compositeTextSizes=[u["text-size"].possiblyEvaluate(new ur(A),l.canonical),u["text-size"].possiblyEvaluate(new ur(F),l.canonical)]}if("composite"===l.bucket.iconSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.iconSizeData;f.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new ur(A),l.canonical),u["icon-size"].possiblyEvaluate(new ur(F),l.canonical)]}const _=24*s.get("text-line-height"),x="viewport"!==s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),E=s.get("text-keep-upright"),M=s.get("text-size");for(const A of l.bucket.features){const F=s.get("text-font").evaluate(A,{},l.canonical).join(","),O=M.evaluate(A,{},l.canonical),B=f.layoutTextSize.evaluate(A,{},l.canonical),H=f.layoutIconSize.evaluate(A,{},l.canonical),q={horizontal:{},vertical:void 0},W=A.text;let se,oe=[0,0];if(W){const me=W.toString(),Ee=24*s.get("text-letter-spacing").evaluate(A,{},l.canonical),$e=fd(me)?Ee:0,Ve=s.get("text-anchor").evaluate(A,{},l.canonical),gt=s.get("text-variable-anchor");if(!gt){const ot=s.get("text-radial-offset").evaluate(A,{},l.canonical);oe=ot?nv(Ve,[24*ot,Cg]):s.get("text-offset").evaluate(A,{},l.canonical).map(it=>24*it)}let Ct=x?"center":s.get("text-justify").evaluate(A,{},l.canonical);const at=s.get("symbol-placement"),tt="point"===at?24*s.get("text-max-width").evaluate(A,{},l.canonical):0,Qe=()=>{l.bucket.allowVerticalPlacement&&po(me)&&(q.vertical=mg(W,l.glyphMap,l.glyphPositions,l.imagePositions,F,tt,_,Ve,"left",$e,oe,b.WritingMode.vertical,!0,at,B,O))};if(!x&>){const ot="auto"===Ct?gt.map(Ge=>Hd(Ge)):[Ct];let it=!1;for(let Ge=0;Gethis._layers[je.id]),ge=ce[0];if("none"===ge.visibility)continue;const he=ge.source||"";let ue=this.familiesBySource[he];ue||(ue=this.familiesBySource[he]={});const xe=ge.sourceLayer||"_geojsonTileLayer";let Me=ue[xe];Me||(Me=ue[xe]=[]),Me.push(ce)}}}class Pl{constructor(V){const $={},K=[];for(const he in V){const ue=V[he],xe=$[he]={};for(const Me in ue){const je=ue[+Me];if(!je||0===je.bitmap.width||0===je.bitmap.height)continue;const Ie={x:0,y:0,w:je.bitmap.width+2,h:je.bitmap.height+2};K.push(Ie),xe[Me]={rect:Ie,metrics:je.metrics}}}const{w:te,h:ce}=b.potpack(K),ge=new b.AlphaImage({width:te||1,height:ce||1});for(const he in V){const ue=V[he];for(const xe in ue){const Me=ue[+xe];if(!Me||0===Me.bitmap.width||0===Me.bitmap.height)continue;const je=$[he][xe].rect;b.AlphaImage.copy(Me.bitmap,ge,{x:0,y:0},{x:je.x+1,y:je.y+1},Me.bitmap)}}this.image=ge,this.positions=$}}b.register("GlyphAtlas",Pl);class Zt{constructor(V){this.tileID=new b.OverscaledTileID(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId}parse(V,$,K,te,ce){this.status="parsing",this.data=V,this.collisionBoxArray=new b.CollisionBoxArray;const ge=new b.DictionaryCoder(Object.keys(V.layers).sort()),he=new b.FeatureIndex(this.tileID,this.promoteId);he.bucketLayerIDs=[];const ue={},xe={featureIndex:he,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:K},Me=$.familiesBySource[this.source];for(const nn in Me){const an=V.layers[nn];if(!an)continue;1===an.version&&b.warnOnce(`Vector tile source "${this.source}" layer "${nn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const qn=ge.encode(nn),ar=[];for(let si=0;si=kr.maxzoom||"none"!==kr.visibility&&(Te(si,this.zoom,K),(ue[kr.id]=kr.createBucket({index:he.bucketLayerIDs.length,layers:si,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:qn,sourceID:this.source})).populate(ar,xe,this.tileID.canonical),he.bucketLayerIDs.push(si.map(Ua=>Ua.id)))}}let je,Ie,Dt,dt;const ft=b.mapObject(xe.glyphDependencies,nn=>Object.keys(nn).map(Number));Object.keys(ft).length?te.send("getGlyphs",{uid:this.uid,stacks:ft,source:this.source,tileID:this.tileID,type:"glyphs"},(nn,an)=>{je||(je=nn,Ie=an,Gn.call(this))}):Ie={};const xt=Object.keys(xe.iconDependencies);xt.length?te.send("getImages",{icons:xt,source:this.source,tileID:this.tileID,type:"icons"},(nn,an)=>{je||(je=nn,Dt=an,Gn.call(this))}):Dt={};const ln=Object.keys(xe.patternDependencies);function Gn(){if(je)return ce(je);if(Ie&&Dt&&dt){const nn=new Pl(Ie),an=new b.ImageAtlas(Dt,dt);for(const qn in ue){const ar=ue[qn];ar instanceof b.SymbolBucket?(Te(ar.layers,this.zoom,K),b.performSymbolLayout({bucket:ar,glyphMap:Ie,glyphPositions:nn.positions,imageMap:Dt,imagePositions:an.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ar.hasPattern&&(ar instanceof b.LineBucket||ar instanceof b.FillBucket||ar instanceof b.FillExtrusionBucket)&&(Te(ar.layers,this.zoom,K),ar.addFeatures(xe,this.tileID.canonical,an.patternPositions))}this.status="done",ce(null,{buckets:Object.values(ue).filter(qn=>!qn.isEmpty()),featureIndex:he,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:nn.image,imageAtlas:an,glyphMap:this.returnDependencies?Ie:null,iconMap:this.returnDependencies?Dt:null,glyphPositions:this.returnDependencies?nn.positions:null})}}ln.length?te.send("getImages",{icons:ln,source:this.source,tileID:this.tileID,type:"patterns"},(nn,an)=>{je||(je=nn,dt=an,Gn.call(this))}):dt={},Gn.call(this)}}function Te(J,V,$){const K=new b.EvaluationParameters(V);for(const te of J)te.recalculate(K,$)}function zi(J,V){const $=b.getArrayBuffer(J.request,(K,te,ce,ge)=>{K?V(K):te&&V(null,{vectorTile:new b.vectorTile.VectorTile(new b.pbf(te)),rawData:te,cacheControl:ce,expires:ge})});return()=>{$.cancel(),V()}}class Fs{constructor(V,$,K,te){this.actor=V,this.layerIndex=$,this.availableImages=K,this.loadVectorData=te||zi,this.loading={},this.loaded={}}loadTile(V,$){const K=V.uid;this.loading||(this.loading={});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request),ce=this.loading[K]=new Zt(V);ce.abort=this.loadVectorData(V,(ge,he)=>{if(delete this.loading[K],ge||!he)return ce.status="done",this.loaded[K]=ce,$(ge);const ue=he.rawData,xe={};he.expires&&(xe.expires=he.expires),he.cacheControl&&(xe.cacheControl=he.cacheControl);const Me={};if(te){const je=te.finish();je&&(Me.resourceTiming=JSON.parse(JSON.stringify(je)))}ce.vectorTile=he.vectorTile,ce.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor,(je,Ie)=>{if(je||!Ie)return $(je);$(null,b.extend({rawTileData:ue.slice(0)},Ie,xe,Me))}),this.loaded=this.loaded||{},this.loaded[K]=ce})}reloadTile(V,$){const K=this.loaded,te=V.uid,ce=this;if(K&&K[te]){const ge=K[te];ge.showCollisionBoxes=V.showCollisionBoxes;const he=(ue,xe)=>{const Me=ge.reloadCallback;Me&&(delete ge.reloadCallback,ge.parse(ge.vectorTile,ce.layerIndex,this.availableImages,ce.actor,Me)),$(ue,xe)};"parsing"===ge.status?ge.reloadCallback=he:"done"===ge.status&&(ge.vectorTile?ge.parse(ge.vectorTile,this.layerIndex,this.availableImages,this.actor,he):he())}}abortTile(V,$){const K=this.loading,te=V.uid;K&&K[te]&&K[te].abort&&(K[te].abort(),delete K[te]),$()}removeTile(V,$){const K=this.loaded,te=V.uid;K&&K[te]&&delete K[te],$()}}class Os{constructor(){this.loaded={}}loadTile(V,$){const{uid:K,encoding:te,rawImageData:ce}=V,ge=b.isImageBitmap(ce)?this.getImageData(ce):ce,he=new b.DEMData(K,ge,te);this.loaded=this.loaded||{},this.loaded[K]=he,$(null,he)}getImageData(V){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(V.width,V.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=V.width,this.offscreenCanvas.height=V.height,this.offscreenCanvasContext.drawImage(V,0,0,V.width,V.height);const $=this.offscreenCanvasContext.getImageData(-1,-1,V.width+2,V.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new b.RGBAImage({width:$.width,height:$.height},$.data)}removeTile(V){const $=this.loaded,K=V.uid;$&&$[K]&&delete $[K]}}var Ra=function J(V,$){var K,te=V&&V.type;if("FeatureCollection"===te)for(K=0;K=Math.abs(he)?$-ue+he:he-ue+$,$=ue}$+K>=0!=!!V&&J.reverse()}const io=b.vectorTile.VectorTileFeature.prototype.toGeoJSON;var pn={},ii={get exports(){return pn},set exports(J){pn=J}},kc=b.pointGeometry,Mo=b.vectorTile.VectorTileFeature,na=Ls;function Ls(J,V){this.options=V||{},this.features=J,this.length=J.length}function oo(J,V){this.id="number"==typeof J.id?J.id:void 0,this.type=J.type,this.rawGeometry=1===J.type?[J.geometry]:J.geometry,this.properties=J.tags,this.extent=V||4096}Ls.prototype.feature=function(J){return new oo(this.features[J],this.options.extent)},oo.prototype.loadGeometry=function(){var J=this.rawGeometry;this.geometry=[];for(var V=0;V>31}function Nn(J,V){for(var $=J.loadGeometry(),K=J.type,te=0,ce=0,ge=$.length,he=0;heJ},La=Math.fround||(Rc=new Float32Array(1),J=>(Rc[0]=+J,Rc[0]));var Rc;class oi{constructor(V){this.options=Bi(Object.create(Fl),V),this.trees=new Array(this.options.maxZoom+1)}load(V){const{log:$,minZoom:K,maxZoom:te,nodeSize:ce}=this.options;$&&console.time("total time");const ge=`prepare ${V.length} points`;$&&console.time(ge),this.points=V;let he=[];for(let ue=0;ue=K;ue--){const xe=+Date.now();he=this._cluster(he,ue),this.trees[ue]=new b.KDBush(he,Vn,ps,ce,Float32Array),$&&console.log("z%d: %d clusters in %dms",ue,he.length,+Date.now()-xe)}return $&&console.timeEnd("total time"),this}getClusters(V,$){let K=((V[0]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,V[1]));let ce=180===V[2]?180:((V[2]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)K=-180,ce=180;else if(K>ce){const Me=this.getClusters([K,te,180,ge],$),je=this.getClusters([-180,te,ce,ge],$);return Me.concat(je)}const he=this.trees[this._limitZoom($)],ue=he.range(Ae(K),Pe(ge),Ae(ce),Pe(te)),xe=[];for(const Me of ue){const je=he.points[Me];xe.push(je.numPoints?yr(je):this.points[je.index])}return xe}getChildren(V){const $=this._getOriginId(V),K=this._getOriginZoom(V),te="No cluster with the specified id.",ce=this.trees[K];if(!ce)throw new Error(te);const ge=ce.points[$];if(!ge)throw new Error(te);const he=this.options.radius/(this.options.extent*Math.pow(2,K-1)),ue=ce.within(ge.x,ge.y,he),xe=[];for(const Me of ue){const je=ce.points[Me];je.parentId===V&&xe.push(je.numPoints?yr(je):this.points[je.index])}if(0===xe.length)throw new Error(te);return xe}getLeaves(V,$,K){const te=[];return this._appendLeaves(te,V,$=$||10,K=K||0,0),te}getTile(V,$,K){const te=this.trees[this._limitZoom(V)],ce=Math.pow(2,V),{extent:ge,radius:he}=this.options,ue=he/ge,xe=(K-ue)/ce,Me=(K+1+ue)/ce,je={features:[]};return this._addTileFeatures(te.range(($-ue)/ce,xe,($+1+ue)/ce,Me),te.points,$,K,ce,je),0===$&&this._addTileFeatures(te.range(1-ue/ce,xe,1,Me),te.points,ce,K,ce,je),$===ce-1&&this._addTileFeatures(te.range(0,xe,ue/ce,Me),te.points,-1,K,ce,je),je.features.length?je:null}getClusterExpansionZoom(V){let $=this._getOriginZoom(V)-1;for(;$<=this.options.maxZoom;){const K=this.getChildren(V);if($++,1!==K.length)break;V=K[0].properties.cluster_id}return $}_appendLeaves(V,$,K,te,ce){const ge=this.getChildren($);for(const he of ge){const ue=he.properties;if(ue&&ue.cluster?ce+ue.point_count<=te?ce+=ue.point_count:ce=this._appendLeaves(V,ue.cluster_id,K,te,ce):ce$&&(dt+=xt.numPoints||1)}if(dt>Dt&&dt>=he){let ft=Me.x*Dt,xt=Me.y*Dt,ln=ge&&Dt>1?this._map(Me,!0):null;const Gn=(xe<<5)+($+1)+this.points.length;for(const nn of Ie){const an=je.points[nn];if(an.zoom<=$)continue;an.zoom=$;const qn=an.numPoints||1;ft+=an.x*qn,xt+=an.y*qn,an.parentId=Gn,ge&&(ln||(ln=this._map(Me,!0)),ge(ln,this._map(an)))}Me.parentId=Gn,K.push(Na(ft/dt,xt/dt,Gn,dt,ln))}else if(K.push(Me),dt>1)for(const ft of Ie){const xt=je.points[ft];xt.zoom<=$||(xt.zoom=$,K.push(xt))}}return K}_getOriginId(V){return V-this.points.length>>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,$){if(V.numPoints)return $?Bi({},V.properties):V.properties;const K=this.points[V.index].properties,te=this.options.map(K);return $&&te===K?Bi({},te):te}}function Na(J,V,$,K,te){return{x:La(J),y:La(V),zoom:1/0,id:$,parentId:-1,numPoints:K,properties:te}}function ra(J,V){const[$,K]=J.geometry.coordinates;return{x:La(Ae($)),y:La(Pe(K)),zoom:1/0,index:V,parentId:-1}}function yr(J){return{type:"Feature",id:J.id,properties:Qn(J),geometry:{type:"Point",coordinates:[(V=J.x,360*(V-.5)),za(J.y)]}};var V}function Qn(J){const V=J.numPoints,$=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V;return Bi(Bi({},J.properties),{cluster:!0,cluster_id:J.id,point_count:V,point_count_abbreviated:$})}function Ae(J){return J/360+.5}function Pe(J){const V=Math.sin(J*Math.PI/180),$=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return $<0?0:$>1?1:$}function za(J){const V=(180-360*J)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function Bi(J,V){for(const $ in V)J[$]=V[$];return J}function Vn(J){return J.x}function ps(J){return J.y}function Vi(J,V,$,K){for(var te,ce=K,ge=$-V>>1,he=$-V,ue=J[V],xe=J[V+1],Me=J[$],je=J[$+1],Ie=V+3;Ie<$;Ie+=3){var Dt=Ol(J[Ie],J[Ie+1],ue,xe,Me,je);if(Dt>ce)te=Ie,ce=Dt;else if(Dt===ce){var dt=Math.abs(Ie-ge);dtK&&(te-V>3&&Vi(J,V,te,K),J[te+2]=ce,$-te>3&&Vi(J,te,$,K))}function Ol(J,V,$,K,te,ce){var ge=te-$,he=ce-K;if(0!==ge||0!==he){var ue=((J-$)*ge+(V-K)*he)/(ge*ge+he*he);ue>1?($=te,K=ce):ue>0&&($+=ge*ue,K+=he*ue)}return(ge=J-$)*ge+(he=V-K)*he}function ms(J,V,$,K){var te={id:void 0===J?null:J,type:V,geometry:$,tags:K,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ce){var ge=ce.geometry,he=ce.type;if("Point"===he||"MultiPoint"===he||"LineString"===he)rt(ce,ge);else if("Polygon"===he||"MultiLineString"===he)for(var ue=0;ue0&&(ge+=K?(te*xe-ue*ce)/2:Math.sqrt(Math.pow(ue-te,2)+Math.pow(xe-ce,2))),te=ue,ce=xe}var Me=V.length-3;V[2]=1,Vi(V,0,Me,$),V[Me+2]=1,V.size=Math.abs(ge),V.start=0,V.end=V.size}function gs(J,V,$,K){for(var te=0;te1?1:$}function Ci(J,V,$,K,te,ce,ge,he){if(K/=V,ce>=($/=V)&&ge=K)return null;for(var ue=[],xe=0;xe=$&&dt=K)){var ft=[];if("Point"===Ie||"MultiPoint"===Ie)ia(je,ft,$,K,te);else if("LineString"===Ie)ao(je,ft,$,K,te,!1,he.lineMetrics);else if("MultiLineString"===Ie)zn(je,ft,$,K,te,!1);else if("Polygon"===Ie)zn(je,ft,$,K,te,!0);else if("MultiPolygon"===Ie)for(var xt=0;xt=$&&ge<=K&&(V.push(J[ce]),V.push(J[ce+1]),V.push(J[ce+2]))}}function ao(J,V,$,K,te,ce,ge){for(var he,ue,xe=Ui(J),Me=0===te?lo:Ll,je=J.start,Ie=0;Ie$&&(ue=Me(xe,Dt,dt,xt,ln,$),ge&&(xe.start=je+he*ue)):Gn>K?nn=$&&(ue=Me(xe,Dt,dt,xt,ln,$),an=!0),nn>K&&Gn<=K&&(ue=Me(xe,Dt,dt,xt,ln,K),an=!0),!ce&&an&&(ge&&(xe.end=je+he*ue),V.push(xe),xe=Ui(J)),ge&&(je+=he)}var qn=J.length-3;Dt=J[qn],dt=J[qn+1],ft=J[qn+2],(Gn=0===te?Dt:dt)>=$&&Gn<=K&&Fc(xe,Dt,dt,ft),qn=xe.length-3,ce&&qn>=3&&(xe[qn]!==xe[0]||xe[qn+1]!==xe[1])&&Fc(xe,xe[0],xe[1],xe[2]),xe.length&&V.push(xe)}function Ui(J){var V=[];return V.size=J.size,V.start=J.start,V.end=J.end,V}function zn(J,V,$,K,te,ce){for(var ge=0;gege.maxX&&(ge.maxX=Me),je>ge.maxY&&(ge.maxY=je)}return ge}function sa(J,V,$,K){var te=V.geometry,ce=V.type,ge=[];if("Point"===ce||"MultiPoint"===ce)for(var he=0;he0&&V.size<(te?ge:K))$.numPoints+=V.length/3;else{for(var he=[],ue=0;uege)&&($.numSimplified++,he.push(V[ue]),he.push(V[ue+1])),$.numPoints++;te&&function(xe,Me){for(var je=0,Ie=0,Dt=xe.length,dt=Dt-2;Ie0===Me)for(Ie=0,Dt=xe.length;Ie
24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");var te,ce,ge,he,ue,xe,K=function(te,ce){var ge=[];if("FeatureCollection"===te.type)for(var he=0;he1&&console.time("creation"),Ie=this.tiles[je]=Ru(J,V,$,K,ue),this.tileCoords.push({z:V,x:$,y:K}),xe)){xe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,$,K,Ie.numFeatures,Ie.numPoints,Ie.numSimplified),console.timeEnd("creation"));var Dt="z"+V;this.stats[Dt]=(this.stats[Dt]||0)+1,this.total++}if(Ie.source=J,te){if(V===ue.maxZoom||V===te)continue;var dt=1<1&&console.time("clipping");var ft,xt,ln,Gn,nn,an,qn=.5*ue.buffer/ue.extent,ar=.5-qn,si=.5+qn,kr=1+qn;ft=xt=ln=Gn=null,nn=Ci(J,Me,$-qn,$+si,0,Ie.minX,Ie.maxX,ue),an=Ci(J,Me,$+ar,$+kr,0,Ie.minX,Ie.maxX,ue),J=null,nn&&(ft=Ci(nn,Me,K-qn,K+si,1,Ie.minY,Ie.maxY,ue),xt=Ci(nn,Me,K+ar,K+kr,1,Ie.minY,Ie.maxY,ue),nn=null),an&&(ln=Ci(an,Me,K-qn,K+si,1,Ie.minY,Ie.maxY,ue),Gn=Ci(an,Me,K+ar,K+kr,1,Ie.minY,Ie.maxY,ue),an=null),xe>1&&console.timeEnd("clipping"),he.push(ft||[],V+1,2*$,2*K),he.push(xt||[],V+1,2*$,2*K+1),he.push(ln||[],V+1,2*$+1,2*K),he.push(Gn||[],V+1,2*$+1,2*K+1)}}},Sn.prototype.getTile=function(J,V,$){var K=this.options,te=K.extent,ce=K.debug;if(J<0||J>24)return null;var ge=1<1&&console.log("drilling down to z%d-%d-%d",J,V,$);for(var ue,xe=J,Me=V,je=$;!ue&&xe>0;)xe--,Me=Math.floor(Me/2),je=Math.floor(je/2),ue=this.tiles[Nl(xe,Me,je)];return ue&&ue.source?(ce>1&&console.log("found parent tile z%d-%d-%d",xe,Me,je),ce>1&&console.time("drilling down"),this.splitTile(ue.source,xe,Me,je,J,V,$),ce>1&&console.timeEnd("drilling down"),this.tiles[he]?Oc(this.tiles[he],te):null):null};class mi extends Fs{constructor(V,$,K,te){super(V,$,K,pi),this._dataUpdateable=new Map,this.loadGeoJSON=(ce,ge)=>{const{promoteId:he}=ce;if(ce.request)return b.getJSON(ce.request,(ue,xe,Me,je)=>{this._dataUpdateable=Zr(xe,he)?Vr(xe,he):void 0,ge(ue,xe,Me,je)});if("string"==typeof ce.data)try{const ue=JSON.parse(ce.data);this._dataUpdateable=Zr(ue,he)?Vr(ue,he):void 0,ge(null,ue)}catch{ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`))}else ce.dataDiff?this._dataUpdateable?(function(ue,xe,Me){var je,Ie,Dt,dt;if(xe.removeAll&&ue.clear(),xe.remove)for(const ft of xe.remove)ue.delete(ft);if(xe.add)for(const ft of xe.add){const xt=co(ft,Me);null!=xt&&ue.set(xt,ft)}if(xe.update)for(const ft of xe.update){let xt=ue.get(ft.id);if(null==xt)continue;const ln=!ft.removeAllProperties&&((null===(je=ft.removeProperties)||void 0===je?void 0:je.length)>0||(null===(Ie=ft.addOrUpdateProperties)||void 0===Ie?void 0:Ie.length)>0);if((ft.newGeometry||ft.removeAllProperties||ln)&&(xt={...xt},ue.set(ft.id,xt),ln&&(xt.properties={...xt.properties})),ft.newGeometry&&(xt.geometry=ft.newGeometry),ft.removeAllProperties)xt.properties={};else if((null===(Dt=ft.removeProperties)||void 0===Dt?void 0:Dt.length)>0)for(const Gn of ft.removeProperties)Object.prototype.hasOwnProperty.call(xt.properties,Gn)&&delete xt.properties[Gn];if((null===(dt=ft.addOrUpdateProperties)||void 0===dt?void 0:dt.length)>0)for(const{key:Gn,value:nn}of ft.addOrUpdateProperties)xt.properties[Gn]=nn}}(this._dataUpdateable,ce.dataDiff,he),ge(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ge(new Error(`Cannot update existing geojson data in ${ce.source}`)):ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},te&&(this.loadGeoJSON=te)}loadData(V,$){var K;null===(K=this._pendingRequest)||void 0===K||K.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request);this._pendingCallback=$,this._pendingRequest=this.loadGeoJSON(V,(ce,ge)=>{if(delete this._pendingCallback,delete this._pendingRequest,ce||!ge)return $(ce);if("object"!=typeof ge)return $(new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`));{Ra(ge,!0);try{if(V.filter){const ue=b.createExpression(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===ue.result)throw new Error(ue.value.map(Me=>`${Me.key}: ${Me.message}`).join(", "));const xe=ge.features.filter(Me=>ue.value.evaluate({zoom:0},Me));ge={type:"FeatureCollection",features:xe}}this._geoJSONIndex=V.cluster?new oi(function({superclusterOptions:ue,clusterProperties:xe}){if(!xe||!ue)return ue;const Me={},je={},Ie={accumulated:null,zoom:0},Dt={properties:null},dt=Object.keys(xe);for(const ft of dt){const[xt,ln]=xe[ft],Gn=b.createExpression(ln),nn=b.createExpression("string"==typeof xt?[xt,["accumulated"],["get",ft]]:xt);Me[ft]=Gn.value,je[ft]=nn.value}return ue.map=ft=>{Dt.properties=ft;const xt={};for(const ln of dt)xt[ln]=Me[ln].evaluate(Ie,Dt);return xt},ue.reduce=(ft,xt)=>{Dt.properties=xt;for(const ln of dt)Ie.accumulated=ft[ln],ft[ln]=je[ln].evaluate(Ie,Dt)},ue}(V)).load(ge.features):new Sn(ue=ge,V.geojsonVtOptions)}catch(ue){return $(ue)}this.loaded={};const he={};if(te){const ue=te.finish();ue&&(he.resourceTiming={},he.resourceTiming[V.source]=JSON.parse(JSON.stringify(ue)))}$(null,he)}var ue})}reloadTile(V,$){const K=this.loaded;return K&&K[V.uid]?super.reloadTile(V,$):this.loadTile(V,$)}removeSource(V,$){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),$()}getClusterExpansionZoom(V,$){try{$(null,this._geoJSONIndex.getClusterExpansionZoom(V.clusterId))}catch(K){$(K)}}getClusterChildren(V,$){try{$(null,this._geoJSONIndex.getChildren(V.clusterId))}catch(K){$(K)}}getClusterLeaves(V,$){try{$(null,this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset))}catch(K){$(K)}}}class Bs{constructor(V){this.self=V,this.actor=new b.Actor(V,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Fs,geojson:mi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=($,K)=>{if(this.workerSourceTypes[$])throw new Error(`Worker source with name "${$}" already registered.`);this.workerSourceTypes[$]=K},this.self.registerRTLTextPlugin=$=>{if(b.plugin.isParsed())throw new Error("RTL text plugin already registered.");b.plugin.applyArabicShaping=$.applyArabicShaping,b.plugin.processBidirectionalText=$.processBidirectionalText,b.plugin.processStyledBidirectionalText=$.processStyledBidirectionalText}}setReferrer(V,$){this.referrer=$}setImages(V,$,K){this.availableImages[V]=$;for(const te in this.workerSources[V]){const ce=this.workerSources[V][te];for(const ge in ce)ce[ge].availableImages=$}K()}setLayers(V,$,K){this.getLayerIndex(V).replace($),K()}updateLayers(V,$,K){this.getLayerIndex(V).update($.layers,$.removedIds),K()}loadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).loadTile($,K)}loadDEMTile(V,$,K){this.getDEMWorkerSource(V,$.source).loadTile($,K)}reloadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).reloadTile($,K)}abortTile(V,$,K){this.getWorkerSource(V,$.type,$.source).abortTile($,K)}removeTile(V,$,K){this.getWorkerSource(V,$.type,$.source).removeTile($,K)}removeDEMTile(V,$){this.getDEMWorkerSource(V,$.source).removeTile($)}removeSource(V,$,K){if(!this.workerSources[V]||!this.workerSources[V][$.type]||!this.workerSources[V][$.type][$.source])return;const te=this.workerSources[V][$.type][$.source];delete this.workerSources[V][$.type][$.source],void 0!==te.removeSource?te.removeSource($,K):K()}loadWorkerSource(V,$,K){try{this.self.importScripts($.url),K()}catch(te){K(te.toString())}}syncRTLPluginState(V,$,K){try{b.plugin.setState($);const te=b.plugin.getPluginURL();if(b.plugin.isLoaded()&&!b.plugin.isParsed()&&null!=te){this.self.importScripts(te);const ce=b.plugin.isParsed();K(ce?void 0:new Error(`RTL Text Plugin failed to import scripts from ${te}`),ce)}}catch(te){K(te.toString())}}getAvailableImages(V){let $=this.availableImages[V];return $||($=[]),$}getLayerIndex(V){let $=this.layerIndexes[V];return $||($=this.layerIndexes[V]=new ds),$}getWorkerSource(V,$,K){return this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][$]||(this.workerSources[V][$]={}),this.workerSources[V][$][K]||(this.workerSources[V][$][K]=new this.workerSourceTypes[$]({send:(ce,ge,he)=>{this.actor.send(ce,ge,he,V)}},this.getLayerIndex(V),this.getAvailableImages(V))),this.workerSources[V][$][K]}getDEMWorkerSource(V,$){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][$]||(this.demWorkerSources[V][$]=new Os),this.demWorkerSources[V][$]}}return b.isWorker()&&(self.worker=new Bs(self)),Bs}),Kh(0,function(b){var vr=Rs;function Rs(g){return a=g,!(typeof window>"u"||typeof document>"u"||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var m,y,w=new Blob([""],{type:"text/javascript"}),S=URL.createObjectURL(w);try{y=new Worker(S),m=!0}catch{m=!1}return y&&y.terminate(),URL.revokeObjectURL(S),m}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var m=document.createElement("canvas");m.width=m.height=1;var y=m.getContext("2d");if(!y)return!1;var w=y.getImageData(0,0,1,1);return w&&w.width===m.width}()||(void 0===ds[h=a&&a.failIfMajorPerformanceCaveat]&&(ds[h]=function(m){var y,S,T,k,w=(S=m,T=document.createElement("canvas"),(k=Object.create(Rs.webGLContextAttributes)).failIfMajorPerformanceCaveat=S,T.getContext("webgl",k)||T.getContext("experimental-webgl",k));if(!w)return!1;try{y=w.createShader(w.VERTEX_SHADER)}catch{return!1}return!(!y||w.isContextLost())&&(w.shaderSource(y,"void main() {}"),w.compileShader(y),!0===w.getShaderParameter(y,w.COMPILE_STATUS))}(h)),!ds[h]||document.documentMode));var a,h}var ds={};Rs.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Zt(g,a){if(Array.isArray(g)){if(!Array.isArray(a)||g.length!==a.length)return!1;for(let h=0;h{window.removeEventListener("click",Te.suppressClickInternal,!0)},0)}static mousePos(a,h){const m=a.getBoundingClientRect();return new b.pointGeometry(h.clientX-m.left-a.clientLeft,h.clientY-m.top-a.clientTop)}static touchPos(a,h){const m=a.getBoundingClientRect(),y=[];for(let w=0;w{a=[],h=0,m=0,y={}},g.addThrottleControl=T=>{const k=m++;return y[k]=T,k},g.removeThrottleControl=T=>{delete y[T]};const w=()=>{const T=Object.keys(y);let k=!1;if(T.length>0)for(const R of T)if(k=y[R](),k)break;return k};g.getImage=(T,k)=>{zi.supported&&(T.headers||(T.headers={}),T.headers.accept="image/webp,*/*");const R={requestParameters:T,callback:k,cancelled:!1,completed:!1,cancel:()=>{}};return a.push(R),w()||g.processQueue(),R};const S=T=>{const{requestParameters:k,callback:R}=T;return b.getArrayBuffer(k,(z,L,j,Q)=>{var ee,Y;z?R(z):L&&(ee=L,Y=(ee,Y)=>{null!=ee?R(ee):null!=Y&&R(null,Y,{cacheControl:j,expires:Q})},"function"==typeof createImageBitmap?b.arrayBufferToImageBitmap(ee,Y):b.arrayBufferToImage(ee,Y)),T.cancelled||(T.completed=!0,h--,w()||g.processQueue())})};g.processQueue=(T=0)=>{T<=0&&(T=w()?b.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:b.config.MAX_PARALLEL_IMAGE_REQUESTS);for(let k=h;k0;k++){const R=a.shift();if(R.cancelled)continue;const z=S(R);h++,R.innerRequest=z,R.cancel=()=>{var L;(L=R).completed||L.cancelled||(h--,L.cancelled=!0,L.innerRequest.cancel(),g.processQueue())}}return a.length}}(io||(io={})),io.resetRequestQueue();var pn,g,ii=io;(g=pn||(pn={})).Glyphs="Glyphs",g.Image="Image",g.Source="Source",g.SpriteImage="SpriteImage",g.SpriteJSON="SpriteJSON",g.Style="Style",g.Tile="Tile",g.Unknown="Unknown";class kc{constructor(a){this._transformRequestFn=a}transformRequest(a,h){return this._transformRequestFn&&this._transformRequestFn(a,h)||{url:a}}normalizeSpriteURL(a,h,m){const y=function(w){const S=w.match(Mo);if(!S)throw new Error(`Unable to parse URL "${w}"`);return{protocol:S[1],authority:S[2],path:S[3]||"/",params:S[4]?S[4].split("&"):[]}}(a);return y.path+=`${h}${m}`,function(w){const S=w.params.length?`?${w.params.join("&")}`:"";return`${w.protocol}://${w.authority}${w.path}${S}`}(y)}setTransformRequest(a){this._transformRequestFn=a}}const Mo=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function na(g){var a=new b.ARRAY_TYPE(3);return a[0]=g[0],a[1]=g[1],a[2]=g[2],a}var Ls,oo=function(g,a,h){return g[0]=a[0]-h[0],g[1]=a[1]-h[1],g[2]=a[2]-h[2],g};Ls=new b.ARRAY_TYPE(3),b.ARRAY_TYPE!=Float32Array&&(Ls[0]=0,Ls[1]=0,Ls[2]=0);var Fa=function(g){var a=g[0],h=g[1];return a*a+h*h};function fs(g){return"string"==typeof g?[{id:"default",url:g}]:g??[]}!function(){var g=new b.ARRAY_TYPE(2);b.ARRAY_TYPE!=Float32Array&&(g[0]=0,g[1]=0)}();class Hn{constructor(a,h,m,y){this.context=a,this.format=m,this.texture=a.gl.createTexture(),this.update(h,y)}update(a,h,m){const{width:y,height:w}=a,S=!(this.size&&this.size[0]===y&&this.size[1]===w||m),{context:T}=this,{gl:k}=T;if(this.useMipmap=Boolean(h&&h.useMipmap),k.bindTexture(k.TEXTURE_2D,this.texture),T.pixelStoreUnpackFlipY.set(!1),T.pixelStoreUnpack.set(1),T.pixelStoreUnpackPremultiplyAlpha.set(this.format===k.RGBA&&(!h||!1!==h.premultiply)),S)this.size=[y,w],a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||b.isImageBitmap(a)?k.texImage2D(k.TEXTURE_2D,0,this.format,this.format,k.UNSIGNED_BYTE,a):k.texImage2D(k.TEXTURE_2D,0,this.format,y,w,0,this.format,k.UNSIGNED_BYTE,a.data);else{const{x:R,y:z}=m||{x:0,y:0};a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||b.isImageBitmap(a)?k.texSubImage2D(k.TEXTURE_2D,0,R,z,k.RGBA,k.UNSIGNED_BYTE,a):k.texSubImage2D(k.TEXTURE_2D,0,R,z,y,w,k.RGBA,k.UNSIGNED_BYTE,a.data)}this.useMipmap&&this.isSizePowerOfTwo()&&k.generateMipmap(k.TEXTURE_2D)}bind(a,h,m){const{context:y}=this,{gl:w}=y;w.bindTexture(w.TEXTURE_2D,this.texture),m!==w.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(m=w.LINEAR),a!==this.filter&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,a),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,m||a),this.filter=a),h!==this.wrap&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,h),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:a}=this.context;a.deleteTexture(this.texture),this.texture=null}}function Pu(g){const{userImage:a}=g;return!!(a&&a.render&&a.render())&&(g.data.replace(new Uint8Array(a.data.buffer)),!0)}class Tt extends b.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new b.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(a){if(this.loaded!==a&&(this.loaded=a,a)){for(const{ids:h,callback:m}of this.requestors)this._notify(h,m);this.requestors=[]}}getImage(a){const h=this.images[a];if(h&&!h.data&&h.spriteData){const m=h.spriteData;h.data=new b.RGBAImage({width:m.width,height:m.height},m.context.getImageData(m.x,m.y,m.width,m.height).data),h.spriteData=null}return h}addImage(a,h){if(this.images[a])throw new Error(`Image id ${a} already exist, use updateImage instead`);this._validate(a,h)&&(this.images[a]=h)}_validate(a,h){let m=!0;const y=h.data||h.spriteData;return this._validateStretch(h.stretchX,y&&y.width)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "stretchX" value`))),m=!1),this._validateStretch(h.stretchY,y&&y.height)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "stretchY" value`))),m=!1),this._validateContent(h.content,h)||(this.fire(new b.ErrorEvent(new Error(`Image "${a}" has invalid "content" value`))),m=!1),m}_validateStretch(a,h){if(!a)return!0;let m=0;for(const y of a){if(y[0]-1);k++,w[k]=T,S[k]=R,S[k+1]=qr}for(let T=0,k=0;T{let T=this.entries[y];T||(T=this.entries[y]={glyphs:{},requests:{},ranges:{}});let k=T.glyphs[w];if(void 0!==k)return void S(null,{stack:y,id:w,glyph:k});if(k=this._tinySDF(T,y,w),k)return T.glyphs[w]=k,void S(null,{stack:y,id:w,glyph:k});const R=Math.floor(w/256);if(256*R>65535)return void S(new Error("glyphs > 65535 not supported"));if(T.ranges[R])return void S(null,{stack:y,id:w,glyph:k});if(!this.url)return void S(new Error("glyphsUrl is not set"));let z=T.requests[R];z||(z=T.requests[R]=[],Nn.loadGlyphRange(y,R,this.url,this.requestManager,(L,j)=>{if(j){for(const Q in j)this._doesCharSupportLocalGlyph(+Q)||(T.glyphs[+Q]=j[+Q]);T.ranges[R]=!0}for(const Q of z)Q(L,j);delete T.requests[R]})),z.push((L,j)=>{L?S(L):j&&S(null,{stack:y,id:w,glyph:j[w]||null})})},(y,w)=>{if(y)h(y);else if(w){const S={};for(const{stack:T,id:k,glyph:R}of w)(S[T]||(S[T]={}))[k]=R&&{id:R.id,bitmap:R.bitmap.clone(),metrics:R.metrics};h(null,S)}})}_doesCharSupportLocalGlyph(a){return!!this.localIdeographFontFamily&&(b.unicodeBlockLookup["CJK Unified Ideographs"](a)||b.unicodeBlockLookup["Hangul Syllables"](a)||b.unicodeBlockLookup.Hiragana(a)||b.unicodeBlockLookup.Katakana(a))}_tinySDF(a,h,m){const y=this.localIdeographFontFamily;if(!y||!this._doesCharSupportLocalGlyph(m))return;let w=a.tinySDF;if(!w){let T="400";/bold/i.test(h)?T="900":/medium/i.test(h)?T="500":/light/i.test(h)&&(T="200"),w=a.tinySDF=new Nn.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:y,fontWeight:T})}const S=w.draw(String.fromCharCode(m));return{id:m,bitmap:new b.AlphaImage({width:S.width||30,height:S.height||30},S.data),metrics:{width:S.glyphWidth||24,height:S.glyphHeight||24,left:S.glyphLeft||0,top:S.glyphTop-27||-8,advance:S.glyphAdvance||24}}}}Nn.loadGlyphRange=function(g,a,h,m,y){const w=256*a,S=w+255,T=m.transformRequest(h.replace("{fontstack}",g).replace("{range}",`${w}-${S}`),pn.Glyphs);b.getArrayBuffer(T,(k,R)=>{if(k)y(k);else if(R){const z={};for(const L of b.parseGlyphPbf(R))z[L.id]=L;y(null,z)}})},Nn.TinySDF=class{constructor({fontSize:g=24,buffer:a=3,radius:h=8,cutoff:m=.25,fontFamily:y="sans-serif",fontWeight:w="normal",fontStyle:S="normal"}={}){this.buffer=a,this.cutoff=m,this.radius=h;const T=this.size=g+4*a,k=this._createCanvas(T),R=this.ctx=k.getContext("2d",{willReadFrequently:!0});R.font=`${S} ${w} ${g}px ${y}`,R.textBaseline="alphabetic",R.textAlign="left",R.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(g){const a=document.createElement("canvas");return a.width=a.height=g,a}draw(g){const{width:a,actualBoundingBoxAscent:h,actualBoundingBoxDescent:m,actualBoundingBoxLeft:y,actualBoundingBoxRight:w}=this.ctx.measureText(g),S=Math.ceil(h),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(w-y))),k=Math.min(this.size-this.buffer,S+Math.ceil(m)),R=T+2*this.buffer,z=k+2*this.buffer,L=Math.max(R*z,0),j=new Uint8ClampedArray(L),Q={data:j,width:R,height:z,glyphWidth:T,glyphHeight:k,glyphTop:S,glyphLeft:0,glyphAdvance:a};if(0===T||0===k)return Q;const{ctx:ee,buffer:Y,gridInner:ae,gridOuter:_e}=this;ee.clearRect(Y,Y,T,k),ee.fillText(g,Y,Y+S);const ye=ee.getImageData(Y,Y,T,k);_e.fill(qr,0,L),ae.fill(0,0,L);for(let ie=0;ie0?ke*ke:0,ae[Se]=ke<0?ke*ke:0}}Oa(_e,0,0,R,z,R,this.f,this.v,this.z),Oa(ae,Y,Y,T,k,R,this.f,this.v,this.z);for(let ie=0;ie1&&(k=a[++T]);const z=Math.abs(R-k.left),L=Math.abs(R-k.right),j=Math.min(z,L);let Q;const ee=w/m*(y+1);if(k.isDash){const Y=y-Math.abs(ee);Q=Math.sqrt(j*j+Y*Y)}else Q=y-Math.sqrt(j*j+ee*ee);this.data[S+R]=Math.max(0,Math.min(255,Q+128))}}}addRegularDash(a){for(let T=a.length-1;T>=0;--T){const k=a[T],R=a[T+1];k.zeroLength?a.splice(T,1):R&&R.isDash===k.isDash&&(R.left=k.left,a.splice(T,1))}const h=a[0],m=a[a.length-1];h.isDash===m.isDash&&(h.left=m.left-this.width,m.right=h.right+this.width);const y=this.width*this.nextRow;let w=0,S=a[w];for(let T=0;T1&&(S=a[++w]);const k=Math.abs(T-S.left),R=Math.abs(T-S.right),z=Math.min(k,R);this.data[y+T]=Math.max(0,Math.min(255,(S.isDash?z:-z)+128))}}addDash(a,h){const m=h?7:0,y=2*m+1;if(this.nextRow+y>this.height)return b.warnOnce("LineAtlas out of space"),null;let w=0;for(let T=0;T{y.send(a,h,w)},m=m||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(a=!0){this.actors.forEach(h=>{h.remove()}),this.actors=[],a&&this.workerPool.release(this.id)}}function Na(g,a,h){const m=function(y,w){if(y)return h(y);if(w){const S=b.pick(b.extend(w,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);w.vector_layers&&(S.vectorLayers=w.vector_layers,S.vectorLayerIds=S.vectorLayers.map(T=>T.id)),h(null,S)}};return g.url?b.getJSON(a.transformRequest(g.url,pn.Source),m):b.exported.frame(()=>m(null,g))}oi.Actor=b.Actor;class ra{constructor(a,h,m){this.bounds=b.LngLatBounds.convert(this.validateBounds(a)),this.minzoom=h||0,this.maxzoom=m||24}validateBounds(a){return Array.isArray(a)&&4===a.length?[Math.max(-180,a[0]),Math.max(-90,a[1]),Math.min(180,a[2]),Math.min(90,a[3])]:[-180,-90,180,90]}contains(a){const h=Math.pow(2,a.z),m=Math.floor(b.mercatorXfromLng(this.bounds.getWest())*h),y=Math.floor(b.mercatorYfromLat(this.bounds.getNorth())*h),w=Math.ceil(b.mercatorXfromLng(this.bounds.getEast())*h),S=Math.ceil(b.mercatorYfromLat(this.bounds.getSouth())*h);return a.x>=m&&a.x=y&&a.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),a?this.fire(new b.ErrorEvent(a)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new ra(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}onAdd(a){this.map=a,this.load()}setSourceProperty(a){this._tileJSONRequest&&this._tileJSONRequest.cancel(),a(),this.load()}setTiles(a){return this.setSourceProperty(()=>{this._options.tiles=a}),this}setUrl(a){return this.setSourceProperty(()=>{this.url=a,this._options.url=a}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),y={request:this.map._requestManager.transformRequest(m,pn.Tile),uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,tileSize:this.tileSize*a.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function w(S,T){return delete a.request,a.aborted?h(null):S&&404!==S.status?h(S):(T&&T.resourceTiming&&(a.resourceTiming=T.resourceTiming),this.map._refreshExpiredTiles&&T&&a.setExpiryData(T),a.loadVectorData(T,this.map.painter),h(null),void(a.reloadCallback&&(this.loadTile(a,a.reloadCallback),a.reloadCallback=null)))}y.request.collectResourceTiming=this._collectResourceTiming,a.actor&&"expired"!==a.state?"loading"===a.state?a.reloadCallback=h:a.request=a.actor.send("reloadTile",y,w.bind(this)):(a.actor=this.dispatcher.getActor(),a.request=a.actor.send("loadTile",y,w.bind(this)))}abortTile(a){a.request&&(a.request.cancel(),delete a.request),a.actor&&a.actor.send("abortTile",{uid:a.uid,type:this.type,source:this.id},void 0)}unloadTile(a){a.unloadVectorData(),a.actor&&a.actor.send("removeTile",{uid:a.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Qn extends b.Evented{constructor(a,h,m,y){super(),this.id=a,this.dispatcher=m,this.setEventedParent(y),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=b.extend({type:"raster"},h),b.extend(this,b.pick(h,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Na(this._options,this.map._requestManager,(a,h)=>{this._tileJSONRequest=null,this._loaded=!0,a?this.fire(new b.ErrorEvent(a)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new ra(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(a){this.map=a,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);a.request=ii.getImage(this.map._requestManager.transformRequest(m,pn.Tile),(y,w,S)=>{if(delete a.request,a.aborted)a.state="unloaded",h(null);else if(y)a.state="errored",h(y);else if(w){this.map._refreshExpiredTiles&&a.setExpiryData(S);const T=this.map.painter.context,k=T.gl;a.texture=this.map.painter.getTileTexture(w.width),a.texture?a.texture.update(w,{useMipmap:!0}):(a.texture=new Hn(T,w,k.RGBA,{useMipmap:!0}),a.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),T.extTextureFilterAnisotropic&&k.texParameterf(k.TEXTURE_2D,T.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,T.extTextureFilterAnisotropicMax)),a.state="loaded",h(null)}})}abortTile(a,h){a.request&&(a.request.cancel(),delete a.request),h()}unloadTile(a,h){a.texture&&this.map.painter.saveTileTexture(a.texture),h()}hasTransition(){return!1}}let Ae;class Pe extends Qn{constructor(a,h,m,y){super(a,h,m,y),this.type="raster-dem",this.maxzoom=22,this._options=b.extend({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(a,h){const m=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function y(w,S){w&&(a.state="errored",h(w)),S&&(a.dem=S,a.needsHillshadePrepare=!0,a.needsTerrainPrepare=!0,a.state="loaded",h(null))}a.request=ii.getImage(this.map._requestManager.transformRequest(m,pn.Tile),function(w,S){if(delete a.request,a.aborted)a.state="unloaded",h(null);else if(w)a.state="errored",h(w);else if(S){this.map._refreshExpiredTiles&&a.setExpiryData(S),delete S.cacheControl,delete S.expires;const T=b.isImageBitmap(S)&&(null==Ae&&(Ae=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Ae)?S:b.exported.getImageData(S,1),k={uid:a.uid,coord:a.tileID,source:this.id,rawImageData:T,encoding:this.encoding};a.actor&&"expired"!==a.state||(a.actor=this.dispatcher.getActor(),a.actor.send("loadDEMTile",k,y.bind(this)))}}.bind(this)),a.neighboringTiles=this._getNeighboringTiles(a.tileID)}_getNeighboringTiles(a){const h=a.canonical,m=Math.pow(2,h.z),y=(h.x-1+m)%m,w=0===h.x?a.wrap-1:a.wrap,S=(h.x+1+m)%m,T=h.x+1===m?a.wrap+1:a.wrap,k={};return k[new b.OverscaledTileID(a.overscaledZ,w,h.z,y,h.y).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,T,h.z,S,h.y).key]={backfilled:!1},h.y>0&&(k[new b.OverscaledTileID(a.overscaledZ,w,h.z,y,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,a.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(a.overscaledZ,T,h.z,S,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||y&&y.abandoned)return void this.fire(new b.Event("dataabort",{dataType:"source"}));let w=null;if(y&&y.resourceTiming&&y.resourceTiming[this.id]&&(w=y.resourceTiming[this.id].slice(0)),m)return void this.fire(new b.ErrorEvent(m));const S={dataType:"source"};this._collectResourceTiming&&w&&w.length>0&&b.extend(S,{resourceTiming:w}),this.fire(new b.Event("data",{...S,sourceDataType:"metadata"})),this.fire(new b.Event("data",{...S,sourceDataType:"content"}))})}loaded(){return 0===this._pendingLoads}loadTile(a,h){const m=a.actor?"reloadTile":"loadTile";a.actor=this.actor;const y={type:this.type,uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request=this.actor.send(m,y,(w,S)=>(delete a.request,a.unloadVectorData(),a.aborted?h(null):w?h(w):(a.loadVectorData(S,this.map.painter,"reloadTile"===m),h(null))))}abortTile(a){a.request&&(a.request.cancel(),delete a.request),a.aborted=!0}unloadTile(a){a.unloadVectorData(),this.actor.send("removeTile",{uid:a.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return b.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Bi=b.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Vn extends b.Evented{constructor(a,h,m,y){super(),this.id=a,this.dispatcher=m,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(y),this.options=h}load(a,h){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ii.getImage(this.map._requestManager.transformRequest(this.url,pn.Image),(m,y)=>{this._request=null,this._loaded=!0,m?this.fire(new b.ErrorEvent(m)):y&&(this.image=y,a&&(this.coordinates=a),h&&h(),this._finishLoading())})}loaded(){return this._loaded}updateImage(a){return a.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=a.url,this.load(a.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(a){this.map=a,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(a){this.coordinates=a;const h=a.map(b.MercatorCoordinate.fromLngLat);this.tileID=function(y){let w=1/0,S=1/0,T=-1/0,k=-1/0;for(const j of y)w=Math.min(w,j.x),S=Math.min(S,j.y),T=Math.max(T,j.x),k=Math.max(k,j.y);const R=Math.max(T-w,k-S),z=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),L=Math.pow(2,z);return new b.CanonicalTileID(z,Math.floor((w+T)/2*L),Math.floor((S+k)/2*L))}(h),this.minzoom=this.maxzoom=this.tileID.z;const m=h.map(y=>this.tileID.getTilePoint(y)._round());return this._boundsArray=new b.RasterBoundsArray,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,b.EXTENT,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,b.EXTENT),this._boundsArray.emplaceBack(m[2].x,m[2].y,b.EXTENT,b.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const a=this.map.painter.context,h=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,Bi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Hn(a,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}loadTile(a,h){this.tileID&&this.tileID.equals(a.tileID.canonical)?(this.tiles[String(a.tileID.wrap)]=a,a.buckets={},h(null)):(a.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ps extends Vn{constructor(a,h,m,y){super(a,h,m,y),this.roundZoom=!0,this.type="video",this.options=h}load(){this._loaded=!1;const a=this.options;this.urls=[];for(const h of a.urls)this.urls.push(this.map._requestManager.transformRequest(h,pn.Source).url);b.getVideo(this.urls,(h,m)=>{this._loaded=!0,h?this.fire(new b.ErrorEvent(h)):m&&(this.video=m,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(a){if(this.video){const h=this.video.seekable;ah.end(0)?this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=a}}getVideo(){return this.video}onAdd(a){this.map||(this.map=a,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const a=this.map.painter.context,h=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,Bi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new Hn(a,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Vi extends Vn{constructor(a,h,m,y){super(a,h,m,y),h.coordinates?Array.isArray(h.coordinates)&&4===h.coordinates.length&&!h.coordinates.some(w=>!Array.isArray(w)||2!==w.length||w.some(S=>"number"!=typeof S))||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'missing required property "coordinates"'))),h.animate&&"boolean"!=typeof h.animate&&this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'optional "animate" property must be a boolean value'))),h.canvas?"string"==typeof h.canvas||h.canvas instanceof HTMLCanvasElement||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${a}`,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 b.ErrorEvent(new b.ValidationError(`sources.${a}`,null,'missing required property "canvas"'))),this.options=h,this.animate=void 0===h.animate||h.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new b.ErrorEvent(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(a){this.map=a,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let a=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,a=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,a=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const h=this.map.painter.context,m=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,Bi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(a||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Hn(h,this.canvas,m.RGBA,{premultiply:!0});for(const y in this.tiles){const w=this.tiles[y];"loaded"!==w.state&&(w.state="loaded",w.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const a of[this.canvas.width,this.canvas.height])if(isNaN(a)||a<=0)return!0;return!1}}const Ol={vector:yr,raster:Qn,"raster-dem":Pe,geojson:za,video:ps,image:Vn,canvas:Vi};function ms(g,a){const h=b.create();return b.translate(h,h,[1,1,0]),b.scale(h,h,[.5*g.width,.5*g.height,1]),b.multiply(h,h,g.calculatePosMatrix(a.toUnwrapped()))}function rt(g,a,h,m,y,w){const S=function(L,j,Q){if(L)for(const ee of L){const Y=j[ee];if(Y&&Y.source===Q&&"fill-extrusion"===Y.type)return!0}else for(const ee in j){const Y=j[ee];if(Y.source===Q&&"fill-extrusion"===Y.type)return!0}return!1}(y&&y.layers,a,g.id),T=w.maxPitchScaleFactor(),k=g.tilesIn(m,T,S);k.sort(Jt);const R=[];for(const L of k)R.push({wrappedTileID:L.tileID.wrapped().key,queryResults:L.tile.queryRenderedFeatures(a,h,g._state,L.queryGeometry,L.cameraQueryGeometry,L.scale,y,w,T,ms(g.transform,L.tileID))});const z=function(L){const j={},Q={};for(const ee of L){const Y=ee.queryResults,ae=ee.wrappedTileID,_e=Q[ae]=Q[ae]||{};for(const ye in Y){const ie=Y[ye],we=_e[ye]=_e[ye]||{},De=j[ye]=j[ye]||[];for(const Se of ie)we[Se.featureIndex]||(we[Se.featureIndex]=!0,De.push(Se))}}return j}(R);for(const L in z)z[L].forEach(j=>{const Q=j.feature,ee=g.getFeatureState(Q.layer["source-layer"],Q.id);Q.source=Q.layer.source,Q.layer["source-layer"]&&(Q.sourceLayer=Q.layer["source-layer"]),Q.state=ee});return z}function Jt(g,a){const h=g.tileID,m=a.tileID;return h.overscaledZ-m.overscaledZ||h.canonical.y-m.canonical.y||h.wrap-m.wrap||h.canonical.x-m.canonical.x}class jt{constructor(a,h){this.tileID=a,this.uid=b.uniqueId(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(a){const h=a+this.timeAdded;hw.getLayer(R)).filter(Boolean);if(0!==k.length){T.layers=k,T.stateDependentLayerIds&&(T.stateDependentLayers=T.stateDependentLayerIds.map(R=>k.filter(z=>z.id===R)[0]));for(const R of k)S[R.id]=T}}return S}(a.buckets,h.style),this.hasSymbolBuckets=!1;for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket){if(this.hasSymbolBuckets=!0,!m)break;w.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket&&w.hasRTLText){this.hasRTLText=!0,b.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const y in this.buckets){const w=this.buckets[y];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(y).queryRadius(w))}a.imageAtlas&&(this.imageAtlas=a.imageAtlas),a.glyphAtlasImage&&(this.glyphAtlasImage=a.glyphAtlasImage)}else this.collisionBoxArray=new b.CollisionBoxArray}unloadVectorData(){for(const a in this.buckets)this.buckets[a].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(a){return this.buckets[a.id]}upload(a){for(const m in this.buckets){const y=this.buckets[m];y.uploadPending()&&y.upload(a)}const h=a.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Hn(a,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Hn(a,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(a){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(a,this.imageAtlasTexture)}queryRenderedFeatures(a,h,m,y,w,S,T,k,R,z){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:y,cameraQueryGeometry:w,scale:S,tileSize:this.tileSize,pixelPosMatrix:z,transform:k,params:T,queryPadding:this.queryPadding*R},a,h,m):{}}querySourceFeatures(a,h){const m=this.latestFeatureIndex;if(!m||!m.rawTileData)return;const y=m.loadVTLayers(),w=h&&h.sourceLayer?h.sourceLayer:"",S=y._geojsonTileLayer||y[w];if(!S)return;const T=b.createFilter(h&&h.filter),{z:k,x:R,y:z}=this.tileID.canonical,L={z:k,x:R,y:z};for(let j=0;jm)y=!1;else if(h)if(this.expirationTime{this.remove(a,w)},m)),this.data[y].push(w),this.order.push(y),this.order.length>this.max){const S=this._getAndRemoveByKey(this.order[0]);S&&this.onRemove(S)}return this}has(a){return a.wrapped().key in this.data}getAndRemove(a){return this.has(a)?this._getAndRemoveByKey(a.wrapped().key):null}_getAndRemoveByKey(a){const h=this.data[a].shift();return h.timeout&&clearTimeout(h.timeout),0===this.data[a].length&&delete this.data[a],this.order.splice(this.order.indexOf(a),1),h.value}getByKey(a){const h=this.data[a];return h?h[0].value:null}get(a){return this.has(a)?this.data[a.wrapped().key][0].value:null}remove(a,h){if(!this.has(a))return this;const m=a.wrapped().key,y=void 0===h?0:this.data[m].indexOf(h),w=this.data[m][y];return this.data[m].splice(y,1),w.timeout&&clearTimeout(w.timeout),0===this.data[m].length&&delete this.data[m],this.onRemove(w.value),this.order.splice(this.order.indexOf(m),1),this}setMaxSize(a){for(this.max=a;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(a){const h=[];for(const m in this.data)for(const y of this.data[m])a(y.value)||h.push(y);for(const m of h)this.remove(m.value.tileID,m)}}class gs{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(a,h,m){const y=String(h);if(this.stateChanges[a]=this.stateChanges[a]||{},this.stateChanges[a][y]=this.stateChanges[a][y]||{},b.extend(this.stateChanges[a][y],m),null===this.deletedStates[a]){this.deletedStates[a]={};for(const w in this.state[a])w!==y&&(this.deletedStates[a][w]=null)}else if(this.deletedStates[a]&&null===this.deletedStates[a][y]){this.deletedStates[a][y]={};for(const w in this.state[a][y])m[w]||(this.deletedStates[a][y][w]=null)}else for(const w in m)this.deletedStates[a]&&this.deletedStates[a][y]&&null===this.deletedStates[a][y][w]&&delete this.deletedStates[a][y][w]}removeFeatureState(a,h,m){if(null===this.deletedStates[a])return;const y=String(h);if(this.deletedStates[a]=this.deletedStates[a]||{},m&&void 0!==h)null!==this.deletedStates[a][y]&&(this.deletedStates[a][y]=this.deletedStates[a][y]||{},this.deletedStates[a][y][m]=null);else if(void 0!==h)if(this.stateChanges[a]&&this.stateChanges[a][y])for(m in this.deletedStates[a][y]={},this.stateChanges[a][y])this.deletedStates[a][y][m]=null;else this.deletedStates[a][y]=null;else this.deletedStates[a]=null}getState(a,h){const m=String(h),y=b.extend({},(this.state[a]||{})[m],(this.stateChanges[a]||{})[m]);if(null===this.deletedStates[a])return{};if(this.deletedStates[a]){const w=this.deletedStates[a][h];if(null===w)return{};for(const S in w)delete y[S]}return y}initializeTileState(a,h){a.setFeatureState(this.state,h)}coalesceChanges(a,h){const m={};for(const y in this.stateChanges){this.state[y]=this.state[y]||{};const w={};for(const S in this.stateChanges[y])this.state[y][S]||(this.state[y][S]={}),b.extend(this.state[y][S],this.stateChanges[y][S]),w[S]=this.state[y][S];m[y]=w}for(const y in this.deletedStates){this.state[y]=this.state[y]||{};const w={};if(null===this.deletedStates[y])for(const S in this.state[y])w[S]={},this.state[y][S]={};else for(const S in this.deletedStates[y]){if(null===this.deletedStates[y][S])this.state[y][S]={};else for(const T of Object.keys(this.deletedStates[y][S]))delete this.state[y][S][T];w[S]=this.state[y][S]}m[y]=m[y]||{},b.extend(m[y],w)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(m).length)for(const y in a)a[y].setFeatureState(m,h)}}class At extends b.Evented{constructor(a,h,m){super(),this.id=a,this.dispatcher=m,this.on("data",y=>{"source"===y.dataType&&"metadata"===y.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===y.dataType&&"content"===y.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(y,w,S,T){const k=new Ol[w.type](y,w,S,T);if(k.id!==y)throw new Error(`Expected Source id to be ${y} instead of ${k.id}`);return b.bindAll(["load","abort","unload","serialize","prepare"],k),k}(a,h,m,this),this._tiles={},this._cache=new so(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new gs}onAdd(a){this.map=a,this._maxTileCacheSize=a?a._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(a)}onRemove(a){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(a)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const a in this._tiles){const h=this._tiles[a];if("loaded"!==h.state&&"errored"!==h.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const a=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,a&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(a,h){return this._source.loadTile(a,h)}_unloadTile(a){if(this._source.unloadTile)return this._source.unloadTile(a,()=>{})}_abortTile(a){this._source.abortTile&&this._source.abortTile(a,()=>{}),this._source.fire(new b.Event("dataabort",{tile:a,coord:a.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(a){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const m=this._tiles[h];m.upload(a),m.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(a=>a.tileID).sort(zs).map(a=>a.key)}getRenderableIds(a){const h=[];for(const m in this._tiles)this._isIdRenderable(m,a)&&h.push(this._tiles[m]);return a?h.sort((m,y)=>{const w=m.tileID,S=y.tileID,T=new b.pointGeometry(w.canonical.x,w.canonical.y)._rotate(this.transform.angle),k=new b.pointGeometry(S.canonical.x,S.canonical.y)._rotate(this.transform.angle);return w.overscaledZ-S.overscaledZ||k.y-T.y||k.x-T.x}).map(m=>m.tileID.key):h.map(m=>m.tileID).sort(zs).map(m=>m.key)}hasRenderableParent(a){const h=this.findLoadedParent(a,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(a,h){return this._tiles[a]&&this._tiles[a].hasData()&&!this._coveredTiles[a]&&(h||!this._tiles[a].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const a in this._tiles)"errored"!==this._tiles[a].state&&this._reloadTile(a,"reloading")}}_reloadTile(a,h){const m=this._tiles[a];m&&("loading"!==m.state&&(m.state=h),this._loadTile(m,this._tileLoaded.bind(this,m,a,h)))}_tileLoaded(a,h,m,y){if(y)return a.state="errored",void(404!==y.status?this._source.fire(new b.ErrorEvent(y,{tile:a})):this.update(this.transform,this.terrain));a.timeAdded=b.exported.now(),"expired"===m&&(a.refreshedUponExpiration=!0),this._setTileReloadTimer(h,a),"raster-dem"===this.getSource().type&&a.dem&&this._backfillDEM(a),this._state.initializeTileState(a,this.map?this.map.painter:null),a.aborted||this._source.fire(new b.Event("data",{dataType:"source",tile:a,coord:a.tileID}))}_backfillDEM(a){const h=this.getRenderableIds();for(let y=0;y1||(Math.abs(S)>1&&(1===Math.abs(S+k)?S+=k:1===Math.abs(S-k)&&(S-=k)),w.dem&&y.dem&&(y.dem.backfillBorder(w.dem,S,T),y.neighboringTiles&&y.neighboringTiles[R]&&(y.neighboringTiles[R].backfilled=!0)))}}getTile(a){return this.getTileByID(a.key)}getTileByID(a){return this._tiles[a]}_retainLoadedChildren(a,h,m,y){for(const w in this._tiles){let S=this._tiles[w];if(y[w]||!S.hasData()||S.tileID.overscaledZ<=h||S.tileID.overscaledZ>m)continue;let T=S.tileID;for(;S&&S.tileID.overscaledZ>h+1;){const R=S.tileID.scaledTo(S.tileID.overscaledZ-1);S=this._tiles[R.key],S&&S.hasData()&&(T=R)}let k=T;for(;k.overscaledZ>h;)if(k=k.scaledTo(k.overscaledZ-1),a[k.key]){y[T.key]=T;break}}}findLoadedParent(a,h){if(a.key in this._loadedParentTiles){const m=this._loadedParentTiles[a.key];return m&&m.tileID.overscaledZ>=h?m:null}for(let m=a.overscaledZ-1;m>=h;m--){const y=a.scaledTo(m),w=this._getLoadedTile(y);if(w)return w}}_getLoadedTile(a){const h=this._tiles[a.key];return h&&h.hasData()?h:this._cache.getByKey(a.wrapped().key)}updateCacheSize(a){const h=Math.ceil(a.width/this._source.tileSize)+1,m=Math.ceil(a.height/this._source.tileSize)+1,y=Math.floor(h*m*5),w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,y):y;this._cache.setMaxSize(w)}handleWrapJump(a){const h=Math.round((a-(void 0===this._prevLng?a:this._prevLng))/360);if(this._prevLng=a,h){const m={};for(const y in this._tiles){const w=this._tiles[y];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+h),m[w.tileID.key]=w}this._tiles=m;for(const y in this._timers)clearTimeout(this._timers[y]),delete this._timers[y];for(const y in this._tiles)this._setTileReloadTimer(y,this._tiles[y])}}update(a,h){if(this.transform=a,this.terrain=h,!this._sourceLoaded||this._paused)return;let m;this.updateCacheSize(a),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?m=a.getVisibleUnwrappedCoordinates(this._source.tileID).map(R=>new b.OverscaledTileID(R.canonical.z,R.wrap,R.canonical.z,R.canonical.x,R.canonical.y)):(m=a.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(m=m.filter(R=>this._source.hasTile(R)))):m=[];const y=a.coveringZoomLevel(this._source),w=Math.max(y-At.maxOverzooming,this._source.minzoom),S=Math.max(y+At.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const R={};for(const z of m)if(z.canonical.z>this._source.minzoom){const L=z.scaledTo(z.canonical.z-1);R[L.key]=L;const j=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));R[j.key]=j}m=m.concat(Object.values(R))}const T=this._updateRetainedTiles(m,y);if(Ci(this._source.type)){const R={},z={},L=Object.keys(T);for(const j of L){const Q=T[j],ee=this._tiles[j];if(!ee||ee.fadeEndTime&&ee.fadeEndTime<=b.exported.now())continue;const Y=this.findLoadedParent(Q,w);Y&&(this._addTile(Y.tileID),R[Y.tileID.key]=Y.tileID),z[j]=Q}this._retainLoadedChildren(z,y,S,T);for(const j in R)T[j]||(this._coveredTiles[j]=!0,T[j]=R[j]);if(h){const j={},Q={};for(const ee of m)this._tiles[ee.key].hasData()?j[ee.key]=ee:Q[ee.key]=ee;for(const ee in Q){const Y=Q[ee].children(this._source.maxzoom);this._tiles[Y[0].key]&&this._tiles[Y[1].key]&&this._tiles[Y[2].key]&&this._tiles[Y[3].key]&&(j[Y[0].key]=T[Y[0].key]=Y[0],j[Y[1].key]=T[Y[1].key]=Y[1],j[Y[2].key]=T[Y[2].key]=Y[2],j[Y[3].key]=T[Y[3].key]=Y[3],delete Q[ee])}for(const ee in Q){const Y=this.findLoadedParent(Q[ee],this._source.minzoom);if(Y){j[Y.tileID.key]=T[Y.tileID.key]=Y.tileID;for(const ae in j)j[ae].isChildOf(Y.tileID)&&delete j[ae]}}for(const ee in this._tiles)j[ee]||(this._coveredTiles[ee]=!0)}}for(const R in T)this._tiles[R].clearFadeHold();const k=b.keysDifference(this._tiles,T);for(const R of k){const z=this._tiles[R];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(R)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const a in this._tiles)this._tiles[a].holdingForFade()&&this._removeTile(a)}_updateRetainedTiles(a,h){const m={},y={},w=Math.max(h-At.maxOverzooming,this._source.minzoom),S=Math.max(h+At.maxUnderzooming,this._source.minzoom),T={};for(const k of a){const R=this._addTile(k);m[k.key]=k,R.hasData()||hthis._source.maxzoom){const L=k.children(this._source.maxzoom)[0],j=this.getTile(L);if(j&&j.hasData()){m[L.key]=L;continue}}else{const L=k.children(this._source.maxzoom);if(m[L[0].key]&&m[L[1].key]&&m[L[2].key]&&m[L[3].key])continue}let z=R.wasRequested();for(let L=k.overscaledZ-1;L>=w;--L){const j=k.scaledTo(L);if(y[j.key]||(y[j.key]=!0,R=this.getTile(j),!R&&z&&(R=this._addTile(j)),R&&(m[j.key]=j,z=R.wasRequested(),R.hasData())))break}}return m}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const a in this._tiles){const h=[];let m,y=this._tiles[a].tileID;for(;y.overscaledZ>0;){if(y.key in this._loadedParentTiles){m=this._loadedParentTiles[y.key];break}h.push(y.key);const w=y.scaledTo(y.overscaledZ-1);if(m=this._getLoadedTile(w),m)break;y=w}for(const w of h)this._loadedParentTiles[w]=m}}_addTile(a){let h=this._tiles[a.key];if(h)return h;h=this._cache.getAndRemove(a),h&&(this._setTileReloadTimer(a.key,h),h.tileID=a,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[a.key]&&(clearTimeout(this._cacheTimers[a.key]),delete this._cacheTimers[a.key],this._setTileReloadTimer(a.key,h)));const m=h;return h||(h=new jt(a,this._source.tileSize*a.overscaleFactor()),this._loadTile(h,this._tileLoaded.bind(this,h,a.key,h.state))),h.uses++,this._tiles[a.key]=h,m||this._source.fire(new b.Event("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(a,h){a in this._timers&&(clearTimeout(this._timers[a]),delete this._timers[a]);const m=h.getExpiryTimeout();m&&(this._timers[a]=setTimeout(()=>{this._reloadTile(a,"expired"),delete this._timers[a]},m))}_removeTile(a){const h=this._tiles[a];h&&(h.uses--,delete this._tiles[a],this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),h.uses>0||(h.hasData()&&"reloading"!==h.state?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const a in this._tiles)this._removeTile(a);this._cache.reset()}tilesIn(a,h,m){const y=[],w=this.transform;if(!w)return y;const S=m?w.getCameraQueryGeometry(a):a,T=a.map(ee=>w.pointCoordinate(ee,this.terrain)),k=S.map(ee=>w.pointCoordinate(ee,this.terrain)),R=this.getIds();let z=1/0,L=1/0,j=-1/0,Q=-1/0;for(const ee of k)z=Math.min(z,ee.x),L=Math.min(L,ee.y),j=Math.max(j,ee.x),Q=Math.max(Q,ee.y);for(let ee=0;ee=0&&ie[1].y+ye>=0){const we=T.map(Se=>ae.getTilePoint(Se)),De=k.map(Se=>ae.getTilePoint(Se));y.push({tile:Y,tileID:ae,queryGeometry:we,cameraQueryGeometry:De,scale:_e})}}return y}getVisibleCoordinates(a){const h=this.getRenderableIds(a).map(m=>this._tiles[m].tileID);for(const m of h)m.posMatrix=this.transform.calculatePosMatrix(m.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(Ci(this._source.type))for(const a in this._tiles){const h=this._tiles[a];if(void 0!==h.fadeEndTime&&h.fadeEndTime>=b.exported.now())return!0}return!1}setFeatureState(a,h,m){this._state.updateState(a=a||"_geojsonTileLayer",h,m)}removeFeatureState(a,h,m){this._state.removeFeatureState(a=a||"_geojsonTileLayer",h,m)}getFeatureState(a,h){return this._state.getState(a=a||"_geojsonTileLayer",h)}setDependencies(a,h,m){const y=this._tiles[a];y&&y.setDependencies(h,m)}reloadTilesForDependencies(a,h){for(const m in this._tiles)this._tiles[m].hasDependency(a,h)&&this._reloadTile(m,"reloading");this._cache.filter(m=>!m.hasDependency(a,h))}}function zs(g,a){const h=Math.abs(2*g.wrap)-+(g.wrap<0),m=Math.abs(2*a.wrap)-+(a.wrap<0);return g.overscaledZ-a.overscaledZ||m-h||a.canonical.y-g.canonical.y||a.canonical.x-g.canonical.x}function Ci(g){return"raster"===g||"image"===g||"video"===g}At.maxOverzooming=10,At.maxUnderzooming=3;const ia="mapboxgl_preloaded_worker_pool";class ao{constructor(){this.active={}}acquire(a){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ia]}numActive(){return Object.keys(this.active).length}}const Ui=Math.floor(b.exported.hardwareConcurrency/2);let zn;function Fc(){return zn||(zn=new ao),zn}function lo(g,a){const h={};for(const m in g)"ref"!==m&&(h[m]=g[m]);return b.refProperties.forEach(m=>{m in a&&(h[m]=a[m])}),h}function Ll(g){g=g.slice();const a=Object.create(null);for(let h=0;h0?(y-S)/T:0;return this.points[w].mult(1-k).add(this.points[h].mult(k))}}function co(g,a){let h=!0;return"always"===g||"never"!==g&&"never"!==a||(h=!1),h}class Zr{constructor(a,h,m){const y=this.boxCells=[],w=this.circleCells=[];this.xCellCount=Math.ceil(a/m),this.yCellCount=Math.ceil(h/m);for(let S=0;Sthis.width||y<0||h>this.height)return[];const k=[];if(a<=0&&h<=0&&this.width<=m&&this.height<=y){if(w)return[{key:null,x1:a,y1:h,x2:m,y2:y}];for(let R=0;R0}hitTestCircle(a,h,m,y,w){const S=a-m,T=a+m,k=h-m,R=h+m;if(T<0||S>this.width||R<0||k>this.height)return!1;const z=[];return this._forEachCell(S,k,T,R,this._queryCellCircle,z,{hitTest:!0,overlapMode:y,circle:{x:a,y:h,radius:m},seenUids:{box:{},circle:{}}},w),z.length>0}_queryCell(a,h,m,y,w,S,T,k){const{seenUids:R,hitTest:z,overlapMode:L}=T,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!R.box[Y]){R.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(a<=ee[ae+2]&&h<=ee[ae+3]&&m>=ee[ae+0]&&y>=ee[ae+1]&&(!k||k(_e))&&(!z||!co(L,_e.overlapMode))&&(S.push({key:_e,x1:ee[ae],y1:ee[ae+1],x2:ee[ae+2],y2:ee[ae+3]}),z))return!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!R.circle[Y]){R.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circleAndRectCollide(ee[ae],ee[ae+1],ee[ae+2],a,h,m,y)&&(!k||k(_e))&&(!z||!co(L,_e.overlapMode))){const ye=ee[ae],ie=ee[ae+1],we=ee[ae+2];if(S.push({key:_e,x1:ye-we,y1:ie-we,x2:ye+we,y2:ie+we}),z)return!0}}}return!1}_queryCellCircle(a,h,m,y,w,S,T,k){const{circle:R,seenUids:z,overlapMode:L}=T,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!z.box[Y]){z.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(this._circleAndRectCollide(R.x,R.y,R.radius,ee[ae+0],ee[ae+1],ee[ae+2],ee[ae+3])&&(!k||k(_e))&&!co(L,_e.overlapMode))return S.push(!0),!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!z.circle[Y]){z.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circlesCollide(ee[ae],ee[ae+1],ee[ae+2],R.x,R.y,R.radius)&&(!k||k(_e))&&!co(L,_e.overlapMode))return S.push(!0),!0}}}_forEachCell(a,h,m,y,w,S,T,k){const R=this._convertToXCellCoord(a),z=this._convertToYCellCoord(h),L=this._convertToXCellCoord(m),j=this._convertToYCellCoord(y);for(let Q=R;Q<=L;Q++)for(let ee=z;ee<=j;ee++)if(w.call(this,a,h,m,y,this.xCellCount*ee+Q,S,T,k))return}_convertToXCellCoord(a){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(a*this.xScale)))}_convertToYCellCoord(a){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(a*this.yScale)))}_circlesCollide(a,h,m,y,w,S){const T=y-a,k=w-h,R=m+S;return R*R>T*T+k*k}_circleAndRectCollide(a,h,m,y,w,S,T){const k=(S-y)/2,R=Math.abs(a-(y+k));if(R>k+m)return!1;const z=(T-w)/2,L=Math.abs(h-(w+z));if(L>z+m)return!1;if(R<=k||L<=z)return!0;const j=R-k,Q=L-z;return j*j+Q*Q<=m*m}}function Vr(g,a,h,m,y){const w=b.create();return a?(b.scale(w,w,[1/y,1/y,1]),h||b.rotateZ(w,w,m.angle)):b.multiply(w,m.labelPlaneMatrix,g),w}function pi(g,a,h,m,y){if(a){const w=b.clone(g);return b.scale(w,w,[y,y,1]),h||b.rotateZ(w,w,-m.angle),w}return m.glCoordMatrix}function mi(g,a,h){let m;h?(m=[g.x,g.y,h(g.x,g.y),1],b.transformMat4(m,m,a)):(m=[g.x,g.y,0,1],xe(m,m,a));const y=m[3];return{point:new b.pointGeometry(m[0]/y,m[1]/y),signedDistanceFromCamera:y}}function Bs(g,a){return.5+g/a*.5}function J(g,a){const h=g[0]/g[3],m=g[1]/g[3];return h>=-a[0]&&h<=a[0]&&m>=-a[1]&&m<=a[1]}function V(g,a,h,m,y,w,S,T,k,R){const z=m?g.textSizeData:g.iconSizeData,L=b.evaluateSizeForZoom(z,h.transform.zoom),j=[256/h.width*2+1,256/h.height*2+1],Q=m?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;Q.clear();const ee=g.lineVertexArray,Y=m?g.text.placedSymbolArray:g.icon.placedSymbolArray,ae=h.transform.width/h.transform.height;let _e=!1;for(let ye=0;yeMath.abs(h.x-a.x)*m?{useVertical:!0}:(g===b.WritingMode.vertical?a.yh.x)?{needsFlipping:!0}:null}function te(g,a,h,m,y,w,S,T,k,R,z,L,j,Q,ee,Y){const ae=a/24,_e=g.lineOffsetX*ae,ye=g.lineOffsetY*ae;let ie;if(g.numGlyphs>1){const we=g.glyphStartIndex+g.numGlyphs,De=g.lineStartIndex,Se=g.lineStartIndex+g.lineLength,ke=$(ae,T,_e,ye,h,z,L,g,k,w,j,ee,Y);if(!ke)return{notEnoughRoom:!0};const Be=mi(ke.first.point,S,Y).point,Le=mi(ke.last.point,S,Y).point;if(m&&!h){const Ne=K(g.writingMode,Be,Le,Q);if(Ne)return Ne}ie=[ke.first];for(let Ne=g.glyphStartIndex+1;Ne0?Be.point:ce(L,ke,De,1,y,Y),Ne=K(g.writingMode,De,Le,Q);if(Ne)return Ne}const we=ge(ae*T.getoffsetX(g.glyphStartIndex),_e,ye,h,z,L,g.segment,g.lineStartIndex,g.lineStartIndex+g.lineLength,k,w,j,ee,Y);if(!we)return{notEnoughRoom:!0};ie=[we]}for(const we of ie)b.addDynamicAttributes(R,we.point,we.angle);return{}}function ce(g,a,h,m,y,w){const S=mi(g.add(g.sub(a)._unit()),y,w).point,T=h.sub(S);return h.add(T._mult(m/T.mag()))}function ge(g,a,h,m,y,w,S,T,k,R,z,L,j,Q){const ee=m?g-a:g+a;let Y=ee>0?1:-1,ae=0;m&&(Y*=-1,ae=Math.PI),Y<0&&(ae+=Math.PI);let _e=Y>0?T+S:T+S+1,ye=y,ie=y,we=0,De=0;const Se=Math.abs(ee),ke=[];for(;we+De<=Se;){if(_e+=Y,_e=k)return null;if(ie=ye,ke.push(ye),ye=L[_e],void 0===ye){const ht=new b.pointGeometry(R.getx(_e),R.gety(_e)),Pt=mi(ht,z,Q);if(Pt.signedDistanceFromCamera>0)ye=L[_e]=Pt.point;else{const zt=_e-Y;ye=ce(0===we?w:new b.pointGeometry(R.getx(zt),R.gety(zt)),ht,ie,Se-we+1,z,Q)}}we+=De,De=ie.dist(ye)}const Be=(Se-we)/De,Le=ye.sub(ie),Ne=Le.mult(Be)._add(ie);Ne._add(Le._unit()._perp()._mult(h*Y));const ze=ae+Math.atan2(ye.y-ie.y,ye.x-ie.x);return ke.push(Ne),{point:Ne,angle:j?ze:0,path:ke}}const he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(g,a){for(let h=0;h=1;Ht--)mt.push(Pt.path[Ht]);for(let Ht=1;Htmi(on,k,ee));mt=Ht.some(on=>on.signedDistanceFromCamera<=0)?[]:Ht.map(on=>on.point)}let An=[];if(mt.length>0){const Ht=mt[0].clone(),on=mt[0].clone();for(let Fn=1;Fn=Ne.x&&on.x<=ze.x&&Ht.y>=Ne.y&&on.y<=ze.y?[mt]:on.xze.x||on.yze.y?[]:b.clipLine([mt],Ne.x,Ne.y,ze.x,ze.y)}for(const Ht of An){ht.reset(Ht,.25*Le);let on=0;on=ht.length<=.5*Le?1:Math.ceil(ht.paddedLength/Tn)+1;for(let Fn=0;Fn=this.screenRightBoundary||ythis.screenBottomBoundary}isInsideGrid(a,h,m,y){return m>=0&&a=0&&hm.collisionGroupID===h}}return this.collisionGroups[a]}}function nn(g,a,h,m,y){const{horizontalAlign:w,verticalAlign:S}=b.getAnchorAlignment(g),T=-(w-.5)*a,k=-(S-.5)*h,R=b.evaluateVariableOffset(g,m);return new b.pointGeometry(T+R[0]*y,k+R[1]*y)}function an(g,a,h,m,y,w){const{x1:S,x2:T,y1:k,y2:R,anchorPointX:z,anchorPointY:L}=g,j=new b.pointGeometry(a,h);return m&&j._rotate(y?w:-w),{x1:S+j.x,y1:k+j.y,x2:T+j.x,y2:R+j.y,anchorPointX:z,anchorPointY:L}}class qn{constructor(a,h,m,y,w){this.transform=a.clone(),this.terrain=h,this.collisionIndex=new je(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new Gn(y),this.collisionCircleArrays={},this.prevPlacement=w,w&&(w.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(a,h,m,y){const w=m.getBucket(h),S=m.latestFeatureIndex;if(!w||!S||h.id!==w.layerIds[0])return;const T=m.collisionBoxArray,k=w.layers[0].layout,R=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),z=m.tileSize/b.EXTENT,L=this.transform.calculatePosMatrix(m.tileID.toUnwrapped()),j="map"===k.get("text-pitch-alignment"),Q="map"===k.get("text-rotation-alignment"),ee=Ie(m,1,this.transform.zoom),Y=Vr(L,j,Q,this.transform,ee);let ae=null;if(j){const ye=pi(L,j,Q,this.transform,ee);ae=b.multiply([],this.transform.labelPlaneMatrix,ye)}this.retainedQueryData[w.bucketInstanceId]=new ln(w.bucketInstanceId,S,w.sourceLayerIndex,w.index,m.tileID);const _e={bucket:w,layout:k,posMatrix:L,textLabelPlaneMatrix:Y,labelToScreenMatrix:ae,scale:R,textPixelRatio:z,holdingForFade:m.holdingForFade(),collisionBoxArray:T,partiallyEvaluatedTextSize:b.evaluateSizeForZoom(w.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(w.sourceID)};if(y)for(const ye of w.sortKeyRanges){const{sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De}=ye;a.push({sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De,parameters:_e})}else a.push({symbolInstanceStart:0,symbolInstanceEnd:w.symbolInstances.length,parameters:_e})}attemptAnchorPlacement(a,h,m,y,w,S,T,k,R,z,L,j,Q,ee,Y,ae){const _e=[j.textOffset0,j.textOffset1],ye=nn(a,m,y,_e,w),ie=this.collisionIndex.placeCollisionBox(an(h,ye.x,ye.y,S,T,this.transform.angle),L,k,R,z.predicate,ae);if((!Y||0!==this.collisionIndex.placeCollisionBox(an(Y,ye.x,ye.y,S,T,this.transform.angle),L,k,R,z.predicate,ae).box.length)&&ie.box.length>0){let we;if(this.prevPlacement&&this.prevPlacement.variableOffsets[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID].text&&(we=this.prevPlacement.variableOffsets[j.crossTileID].anchor),0===j.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[j.crossTileID]={textOffset:_e,width:m,height:y,anchor:a,textBoxScale:w,prevAnchor:we},this.markUsedJustification(Q,a,j,ee),Q.allowVerticalPlacement&&(this.markUsedOrientation(Q,ee,j),this.placedOrientations[j.crossTileID]=ee),{shift:ye,placedGlyphBoxes:ie}}}placeLayerBucketPart(a,h,m){const{bucket:y,layout:w,posMatrix:S,textLabelPlaneMatrix:T,labelToScreenMatrix:k,textPixelRatio:R,holdingForFade:z,collisionBoxArray:L,partiallyEvaluatedTextSize:j,collisionGroup:Q}=a.parameters,ee=w.get("text-optional"),Y=w.get("icon-optional"),ae=b.getOverlapMode(w,"text-overlap","text-allow-overlap"),_e="always"===ae,ye=b.getOverlapMode(w,"icon-overlap","icon-allow-overlap"),ie="always"===ye,we="map"===w.get("text-rotation-alignment"),De="map"===w.get("text-pitch-alignment"),Se="none"!==w.get("icon-text-fit"),ke="viewport-y"===w.get("symbol-z-order"),Be=_e&&(ie||!y.hasIconData()||Y),Le=ie&&(_e||!y.hasTextData()||ee);!y.collisionArrays&&L&&y.deserializeCollisionBoxes(L);const Ne=(ze,ht)=>{if(h[ze.crossTileID])return;if(z)return void(this.placements[ze.crossTileID]=new ft(!1,!1,!1));let Pt=!1,zt=!1,mt=!0,Tn=null,An={box:null,offscreen:null},Ht={box:null,offscreen:null},on=null,Fn=null,_n=null,yo=0,Ro=0,br=0;ht.textFeatureIndex?yo=ht.textFeatureIndex:ze.useRuntimeCollisionCircles&&(yo=ze.featureIndex),ht.verticalTextFeatureIndex&&(Ro=ht.verticalTextFeatureIndex);const li=this.retainedQueryData[y.bucketInstanceId].tileID,Ii=this.terrain?(Rr,hr)=>this.terrain.getElevation(li,Rr,hr):null;for(const Rr of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const hr=ht[Rr];hr&&(hr.elevation=Ii?Ii(hr.anchorPointX,hr.anchorPointY):0)}const Jo=ht.textBox;if(Jo){const Rr=On=>{let qi=b.WritingMode.horizontal;if(y.allowVerticalPlacement&&!On&&this.prevPlacement){const Yr=this.prevPlacement.placedOrientations[ze.crossTileID];Yr&&(this.placedOrientations[ze.crossTileID]=Yr,qi=Yr,this.markUsedOrientation(y,qi,ze))}return qi},hr=(On,qi)=>{if(y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&ht.verticalTextBox){for(const Yr of y.writingModes)if(Yr===b.WritingMode.vertical?(An=qi(),Ht=An):An=On(),An&&An.box&&An.box.length)break}else An=On()};if(w.get("text-variable-anchor")){let On=w.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[ze.crossTileID]){const tr=this.prevPlacement.variableOffsets[ze.crossTileID];On.indexOf(tr.anchor)>0&&(On=On.filter(Qo=>Qo!==tr.anchor),On.unshift(tr.anchor))}const qi=(tr,Qo,Zi)=>{const sh=tr.x2-tr.x1,ya=tr.y2-tr.y1,Zs=ze.textBoxScale,ah=Se&&"never"===ye?Qo:null;let Cs={box:[],offscreen:!1};const Md="never"!==ae?2*On.length:On.length;for(let Mr=0;Mr=On.length?ae:"never",ze,y,Zi,ah,Ii);if(tl&&(Cs=tl.placedGlyphBoxes,Cs&&Cs.box&&Cs.box.length)){Pt=!0,Tn=tl.shift;break}}return Cs};hr(()=>qi(Jo,ht.iconBox,b.WritingMode.horizontal),()=>{const tr=ht.verticalTextBox;return y.allowVerticalPlacement&&!(An&&An.box&&An.box.length)&&ze.numVerticalGlyphVertices>0&&tr?qi(tr,ht.verticalIconBox,b.WritingMode.vertical):{box:null,offscreen:null}}),An&&(Pt=An.box,mt=An.offscreen);const Yr=Rr(An&&An.box);if(!Pt&&this.prevPlacement){const tr=this.prevPlacement.variableOffsets[ze.crossTileID];tr&&(this.variableOffsets[ze.crossTileID]=tr,this.markUsedJustification(y,tr.anchor,ze,Yr))}}else{const On=(qi,Yr)=>{const tr=this.collisionIndex.placeCollisionBox(qi,ae,R,S,Q.predicate,Ii);return tr&&tr.box&&tr.box.length&&(this.markUsedOrientation(y,Yr,ze),this.placedOrientations[ze.crossTileID]=Yr),tr};hr(()=>On(Jo,b.WritingMode.horizontal),()=>{const qi=ht.verticalTextBox;return y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&qi?On(qi,b.WritingMode.vertical):{box:null,offscreen:null}}),Rr(An&&An.box&&An.box.length)}}if(on=An,Pt=on&&on.box&&on.box.length>0,mt=on&&on.offscreen,ze.useRuntimeCollisionCircles){const Rr=y.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex),hr=b.evaluateSizeForFeature(y.textSizeData,j,Rr),On=w.get("text-padding");Fn=this.collisionIndex.placeCollisionCircles(ae,Rr,y.lineVertexArray,y.glyphOffsetArray,hr,S,T,k,m,De,Q.predicate,ze.collisionCircleDiameter,On,Ii),Fn.circles.length&&Fn.collisionDetected&&!m&&b.warnOnce("Collisions detected, but collision boxes are not shown"),Pt=_e||Fn.circles.length>0&&!Fn.collisionDetected,mt=mt&&Fn.offscreen}if(ht.iconFeatureIndex&&(br=ht.iconFeatureIndex),ht.iconBox){const Rr=hr=>{const On=Se&&Tn?an(hr,Tn.x,Tn.y,we,De,this.transform.angle):hr;return this.collisionIndex.placeCollisionBox(On,ye,R,S,Q.predicate,Ii)};Ht&&Ht.box&&Ht.box.length&&ht.verticalIconBox?(_n=Rr(ht.verticalIconBox),zt=_n.box.length>0):(_n=Rr(ht.iconBox),zt=_n.box.length>0),mt=mt&&_n.offscreen}const Fo=ee||0===ze.numHorizontalGlyphVertices&&0===ze.numVerticalGlyphVertices,Yl=Y||0===ze.numIconVertices;if(Fo||Yl?Yl?Fo||(zt=zt&&Pt):Pt=zt&&Pt:zt=Pt=zt&&Pt,Pt&&on&&on.box&&this.collisionIndex.insertCollisionBox(on.box,ae,w.get("text-ignore-placement"),y.bucketInstanceId,Ht&&Ht.box&&Ro?Ro:yo,Q.ID),zt&&_n&&this.collisionIndex.insertCollisionBox(_n.box,ye,w.get("icon-ignore-placement"),y.bucketInstanceId,br,Q.ID),Fn&&(Pt&&this.collisionIndex.insertCollisionCircles(Fn.circles,ae,w.get("text-ignore-placement"),y.bucketInstanceId,yo,Q.ID),m)){const Rr=y.bucketInstanceId;let hr=this.collisionCircleArrays[Rr];void 0===hr&&(hr=this.collisionCircleArrays[Rr]=new xt);for(let On=0;On=0;--ht){const Pt=ze[ht];Ne(y.symbolInstances.get(Pt),y.collisionArrays[Pt])}}else for(let ze=a.symbolInstanceStart;ze=0&&(a.text.placedSymbolArray.get(T).crossTileID=w>=0&&T!==w?0:m.crossTileID)}markUsedOrientation(a,h,m){const y=h===b.WritingMode.horizontal||h===b.WritingMode.horizontalOnly?h:0,w=h===b.WritingMode.vertical?h:0,S=[m.leftJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.rightJustifiedTextSymbolIndex];for(const T of S)a.text.placedSymbolArray.get(T).placedOrientation=y;m.verticalPlacedTextSymbolIndex&&(a.text.placedSymbolArray.get(m.verticalPlacedTextSymbolIndex).placedOrientation=w)}commit(a){this.commitTime=a,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let m=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const y=h?h.symbolFadeChange(a):1,w=h?h.opacities:{},S=h?h.variableOffsets:{},T=h?h.placedOrientations:{};for(const k in this.placements){const R=this.placements[k],z=w[k];z?(this.opacities[k]=new dt(z,y,R.text,R.icon),m=m||R.text!==z.text.placed||R.icon!==z.icon.placed):(this.opacities[k]=new dt(null,y,R.text,R.icon,R.skipFade),m=m||R.text||R.icon)}for(const k in w){const R=w[k];if(!this.opacities[k]){const z=new dt(R,y,!1,!1);z.isHidden()||(this.opacities[k]=z,m=m||R.text.placed||R.icon.placed)}}for(const k in S)this.variableOffsets[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.variableOffsets[k]=S[k]);for(const k in T)this.placedOrientations[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.placedOrientations[k]=T[k]);if(h&&void 0===h.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");m?this.lastPlacementChangeTime=a:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:a)}updateLayerOpacities(a,h){const m={};for(const y of h){const w=y.getBucket(a);w&&y.latestFeatureIndex&&a.id===w.layerIds[0]&&this.updateBucketOpacities(w,m,y.collisionBoxArray)}}updateBucketOpacities(a,h,m){a.hasTextData()&&(a.text.opacityVertexArray.clear(),a.text.hasVisibleVertices=!1),a.hasIconData()&&(a.icon.opacityVertexArray.clear(),a.icon.hasVisibleVertices=!1),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexArray.clear(),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexArray.clear();const y=a.layers[0].layout,w=new dt(null,0,!1,!1,!0),S=y.get("text-allow-overlap"),T=y.get("icon-allow-overlap"),k=y.get("text-variable-anchor"),R="map"===y.get("text-rotation-alignment"),z="map"===y.get("text-pitch-alignment"),L="none"!==y.get("icon-text-fit"),j=new dt(null,0,S&&(T||!a.hasIconData()||y.get("icon-optional")),T&&(S||!a.hasTextData()||y.get("text-optional")),!0);!a.collisionArrays&&m&&(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData())&&a.deserializeCollisionBoxes(m);const Q=(ee,Y,ae)=>{for(let _e=0;_e0,De=this.placedOrientations[Y.crossTileID],Se=De===b.WritingMode.vertical,ke=De===b.WritingMode.horizontal||De===b.WritingMode.horizontalOnly;if(ae>0||_e>0){const Be=ja(ie.text);Q(a.text,ae,Se?aa:Be),Q(a.text,_e,ke?aa:Be);const Le=ie.text.isHidden();[Y.rightJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.leftJustifiedTextSymbolIndex].forEach(ht=>{ht>=0&&(a.text.placedSymbolArray.get(ht).hidden=Le||Se?1:0)}),Y.verticalPlacedTextSymbolIndex>=0&&(a.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).hidden=Le||ke?1:0);const Ne=this.variableOffsets[Y.crossTileID];Ne&&this.markUsedJustification(a,Ne.anchor,Y,De);const ze=this.placedOrientations[Y.crossTileID];ze&&(this.markUsedJustification(a,"left",Y,ze),this.markUsedOrientation(a,ze,Y))}if(we){const Be=ja(ie.icon),Le=!(L&&Y.verticalPlacedIconSymbolIndex&&Se);Y.placedIconSymbolIndex>=0&&(Q(a.icon,Y.numIconVertices,Le?Be:aa),a.icon.placedSymbolArray.get(Y.placedIconSymbolIndex).hidden=ie.icon.isHidden()),Y.verticalPlacedIconSymbolIndex>=0&&(Q(a.icon,Y.numVerticalIconVertices,Le?aa:Be),a.icon.placedSymbolArray.get(Y.verticalPlacedIconSymbolIndex).hidden=ie.icon.isHidden())}if(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData()){const Be=a.collisionArrays[ee];if(Be){let Le=new b.pointGeometry(0,0);if(Be.textBox||Be.verticalTextBox){let ze=!0;if(k){const ht=this.variableOffsets[ye];ht?(Le=nn(ht.anchor,ht.width,ht.height,ht.textOffset,ht.textBoxScale),R&&Le._rotate(z?this.transform.angle:-this.transform.angle)):ze=!1}Be.textBox&&ar(a.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||Se,Le.x,Le.y),Be.verticalTextBox&&ar(a.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||ke,Le.x,Le.y)}const Ne=Boolean(!ke&&Be.verticalIconBox);Be.iconBox&&ar(a.iconCollisionBox.collisionVertexArray,ie.icon.placed,Ne,L?Le.x:0,L?Le.y:0),Be.verticalIconBox&&ar(a.iconCollisionBox.collisionVertexArray,ie.icon.placed,!Ne,L?Le.x:0,L?Le.y:0)}}}if(a.sortFeatures(this.transform.angle),this.retainedQueryData[a.bucketInstanceId]&&(this.retainedQueryData[a.bucketInstanceId].featureSortOrder=a.featureSortOrder),a.hasTextData()&&a.text.opacityVertexBuffer&&a.text.opacityVertexBuffer.updateData(a.text.opacityVertexArray),a.hasIconData()&&a.icon.opacityVertexBuffer&&a.icon.opacityVertexBuffer.updateData(a.icon.opacityVertexArray),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexBuffer&&a.iconCollisionBox.collisionVertexBuffer.updateData(a.iconCollisionBox.collisionVertexArray),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexBuffer&&a.textCollisionBox.collisionVertexBuffer.updateData(a.textCollisionBox.collisionVertexArray),a.text.opacityVertexArray.length!==a.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${a.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${a.text.layoutVertexArray.length}) / 4`);if(a.icon.opacityVertexArray.length!==a.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${a.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${a.icon.layoutVertexArray.length}) / 4`);if(a.bucketInstanceId in this.collisionCircleArrays){const ee=this.collisionCircleArrays[a.bucketInstanceId];a.placementInvProjMatrix=ee.invProjMatrix,a.placementViewportMatrix=ee.viewportMatrix,a.collisionCircleArray=ee.circles,delete this.collisionCircleArrays[a.bucketInstanceId]}}symbolFadeChange(a){return 0===this.fadeDuration?1:(a-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(a){return Math.max(0,(this.transform.zoom-a)/1.5)}hasTransitions(a){return this.stale||a-this.lastPlacementChangeTimea}setStale(){this.stale=!0}}function ar(g,a,h,m,y){g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0),g.emplaceBack(a?1:0,h?1:0,m||0,y||0)}const si=Math.pow(2,25),kr=Math.pow(2,24),Ua=Math.pow(2,17),kf=Math.pow(2,16),Pf=Math.pow(2,9),$a=Math.pow(2,8),Fu=Math.pow(2,1);function ja(g){if(0===g.opacity&&!g.placed)return 0;if(1===g.opacity&&g.placed)return 4294967295;const a=g.placed?1:0,h=Math.floor(127*g.opacity);return h*si+a*kr+h*Ua+a*kf+h*Pf+a*$a+h*Fu+a}const aa=0;class Ou{constructor(a){this._sortAcrossTiles="viewport-y"!==a.layout.get("symbol-z-order")&&!a.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(a,h,m,y,w){const S=this._bucketParts;for(;this._currentTileIndexT.sortKey-k.sortKey));this._currentPartIndex{const S=b.exported.now()-y;return!this._forceFullPlacement&&S>2};for(;this._currentPlacementIndex>=0;){const S=h[a[this._currentPlacementIndex]],T=this.placement.collisionIndex.transform.zoom;if("symbol"===S.type&&(!S.minzoom||S.minzoom<=T)&&(!S.maxzoom||S.maxzoom>T)){if(this._inProgressLayer||(this._inProgressLayer=new Ou(S)),this._inProgressLayer.continuePlacement(m[S.source],this.placement,this._showCollisionBoxes,S,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(a){return this.placement.commit(a),this.placement}}const zl=512/b.EXTENT/2;class Jh{constructor(a,h,m){this.tileID=a,this.bucketInstanceId=m,this._symbolsByKey={};const y=new Map;for(let w=0;w({x:Math.floor(k.anchorX*zl),y:Math.floor(k.anchorY*zl)})),crossTileIDs:S.map(k=>k.crossTileID)};if(T.positions.length>128){const k=new b.KDBush(T.positions,R=>R.x,R=>R.y,16,Uint16Array);delete k.points,delete T.positions,T.index=k}this._symbolsByKey[w]=T}}getScaledCoordinates(a,h){const{x:m,y,z:w}=this.tileID.canonical,{x:S,y:T,z:k}=h.canonical,R=zl/Math.pow(2,k-w),z=(T*b.EXTENT+a.anchorY)*R,L=y*b.EXTENT*zl;return{x:Math.floor((S*b.EXTENT+a.anchorX)*R-m*b.EXTENT*zl),y:Math.floor(z-L)}}findMatches(a,h,m){const y=this.tileID.canonical.za)}}class Bl{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Bn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(a){const h=Math.round((a-this.lng)/360);if(0!==h)for(const m in this.indexes){const y=this.indexes[m],w={};for(const S in y){const T=y[S];T.tileID=T.tileID.unwrapTo(T.tileID.wrap+h),w[T.tileID.key]=T}this.indexes[m]=w}this.lng=a}addBucket(a,h,m){if(this.indexes[a.overscaledZ]&&this.indexes[a.overscaledZ][a.key]){if(this.indexes[a.overscaledZ][a.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(a.overscaledZ,this.indexes[a.overscaledZ][a.key])}for(let w=0;wa.overscaledZ)for(const T in S){const k=S[T];k.tileID.isChildOf(a)&&k.findMatches(h.symbolInstances,a,y)}else{const T=S[a.scaledTo(Number(w)).key];T&&T.findMatches(h.symbolInstances,a,y)}}for(let w=0;w{h[m]=!0});for(const m in this.layerIndexes)h[m]||delete this.layerIndexes[m]}}const Mn=(g,a)=>b.emitValidationErrors(g,a&&a.filter(h=>"source.canvas"!==h.identifier)),Lu=b.pick(mn,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Rf=b.pick(mn,["setCenter","setZoom","setBearing","setPitch"]),Yn=function(){const g={},a=b.spec.$version;for(const h in b.spec.$root){const m=b.spec.$root[h];if(m.required){let y=null;y="version"===h?a:"array"===m.type?[]:{},null!=y&&(g[h]=y)}}return g}();class Mt extends b.Evented{constructor(a,h={}){super(),this.map=a,this.dispatcher=new oi(Fc(),this,a._getMapId()),this.imageManager=new Tt,this.imageManager.setEventedParent(this),this.glyphManager=new Nn(a._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Rc(256,512),this.crossTileSymbolIndex=new Xn,this._spritesImagesIds={},this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new b.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",b.getReferrer());const m=this;this._rtlTextPluginCallback=Mt.registerForPluginStateChange(y=>{m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},(w,S)=>{if(b.triggerPluginCompletionEvent(w),S&&S.every(T=>T))for(const T in m.sourceCaches)m.sourceCaches[T].reload()})}),this.on("data",y=>{if("source"!==y.dataType||"metadata"!==y.sourceDataType)return;const w=this.sourceCaches[y.sourceId];if(!w)return;const S=w.getSource();if(S&&S.vectorLayerIds)for(const T in this._layers){const k=this._layers[T];k.source===S.id&&this._validateLayer(k)}})}loadURL(a,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),h.validate="boolean"!=typeof h.validate||h.validate;const y=this.map._requestManager.transformRequest(a,pn.Style);this._request=b.getJSON(y,(w,S)=>{this._request=null,w?this.fire(new b.ErrorEvent(w)):S&&this._load(S,h,m)})}loadJSON(a,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),this._request=b.exported.frame(()=>{this._request=null,h.validate=!1!==h.validate,this._load(a,h,m)})}loadEmpty(){this.fire(new b.Event("dataloading",{dataType:"style"})),this._load(Yn,{validate:!1})}_load(a,h,m){const y=h.transformStyle?h.transformStyle(m,a):a;if(h.validate&&Mn(this,b.validateStyle(y)))return;this._loaded=!0,this.stylesheet=y;for(const S in y.sources)this.addSource(S,y.sources[S],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs);const w=Ll(this.stylesheet.layers);this._order=w.map(S=>S.id),this._layers={},this._serializedLayers={};for(let S of w)S=b.createStyleLayer(S),S.setEventedParent(this,{layer:{id:S.id}}),this._layers[S.id]=S,this._serializedLayers[S.id]=S.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new La(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new b.Event("data",{dataType:"style"})),this.fire(new b.Event("style.load"))}_loadSprite(a,h=!1,m){this.imageManager.setLoaded(!1),this._spriteRequest=function(y,w,S,T){const k=fs(y),R=S>1?"@2x":"";let z;const L=[],j=[],Q={},ee={};for(const{id:ae,url:_e}of k){const ye=L.push(b.getJSON(w.transformRequest(w.normalizeSpriteURL(_e,R,".json"),pn.SpriteJSON),(we,De)=>{L.splice(ye,1),z||(z=we,Q[ae]=De,Y())})),ie=j.push(ii.getImage(w.transformRequest(w.normalizeSpriteURL(_e,R,".png"),pn.SpriteImage),(we,De)=>{j.splice(ie,1),z||(z=we,ee[ae]=De,Y())}))}function Y(){const ae=Object.values(Q).length,_e=Object.values(ee).length;if(z)T(z);else if(k.length===ae&&ae===_e){const ye={};for(const ie in Q){ye[ie]={};const we=b.exported.getImageCanvasContext(ee[ie]),De=Q[ie];for(const Se in De){const{width:ke,height:Be,x:Le,y:Ne,sdf:ze,pixelRatio:ht,stretchX:Pt,stretchY:zt,content:mt}=De[Se];ye[ie][Se]={data:null,pixelRatio:ht,sdf:ze,stretchX:Pt,stretchY:zt,content:mt,spriteData:{width:ke,height:Be,x:Le,y:Ne,context:we}}}}T(null,ye)}}return{cancel(){if(L.length)for(const ae of L)ae.cancel(),L.splice(L.indexOf(ae),1);if(j.length)for(const ae of j)ae.cancel(),j.splice(j.indexOf(ae),1)}}}(a,this.map._requestManager,this.map.getPixelRatio(),(y,w)=>{if(this._spriteRequest=null,y)this.fire(new b.ErrorEvent(y));else if(w)for(const S in w){this._spritesImagesIds[S]=[];const T=this._spritesImagesIds[S]?this._spritesImagesIds[S].filter(k=>!(k in w)):[];for(const k of T)this.imageManager.removeImage(k),this._changedImages[k]=!0;for(const k in w[S]){const R="default"===S?k:`${S}:${k}`;this._spritesImagesIds[S].push(R),R in this.imageManager.images?this.imageManager.updateImage(R,w[S][k],!1):this.imageManager.addImage(R,w[S][k]),h&&(this._changedImages[R]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"})),m&&m(y)})}_unloadSprite(){for(const a of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(a),this._changedImages[a]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}_validateLayer(a){const h=this.sourceCaches[a.source];if(!h)return;const m=a.sourceLayer;if(!m)return;const y=h.getSource();("geojson"===y.type||y.vectorLayerIds&&-1===y.vectorLayerIds.indexOf(m))&&this.fire(new b.ErrorEvent(new Error(`Source layer "${m}" does not exist on source "${y.id}" as specified by style layer "${a.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const a in this.sourceCaches)if(!this.sourceCaches[a].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(a){const h=[];for(const m of a){const y=this._layers[m];"custom"!==y.type&&h.push(y.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const a in this.sourceCaches)if(this.sourceCaches[a].hasTransition())return!0;for(const a in this._layers)if(this._layers[a].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(a){if(!this._loaded)return;const h=this._changed;if(this._changed){const y=Object.keys(this._updatedLayers),w=Object.keys(this._removedLayers);(y.length||w.length)&&this._updateWorkerLayers(y,w);for(const S in this._updatedSources){const T=this._updatedSources[S];if("reload"===T)this._reloadSource(S);else{if("clear"!==T)throw new Error(`Invalid action ${T}`);this._clearSource(S)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const S in this._updatedPaintProps)this._layers[S].updateTransitions(a);this.light.updateTransitions(a),this._resetUpdates()}const m={};for(const y in this.sourceCaches){const w=this.sourceCaches[y];m[y]=w.used,w.used=!1}for(const y of this._order){const w=this._layers[y];w.recalculate(a,this._availableImages),!w.isHidden(a.zoom)&&w.source&&(this.sourceCaches[w.source].used=!0)}for(const y in m){const w=this.sourceCaches[y];m[y]!==w.used&&w.fire(new b.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:y}))}this.light.recalculate(a),this.z=a.zoom,h&&this.fire(new b.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const a=Object.keys(this._changedImages);if(a.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],a);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(a,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(a),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(a,h={}){if(this._checkLoaded(),a=h.transformStyle?h.transformStyle(this.serialize(),a):a,Mn(this,b.validateStyle(a)))return!1;(a=b.clone$1(a)).layers=Ll(a.layers);const m=function(w,S){if(!w)return[{command:mn.setStyle,args:[S]}];let T=[];try{if(!Zt(w.version,S.version))return[{command:mn.setStyle,args:[S]}];Zt(w.center,S.center)||T.push({command:mn.setCenter,args:[S.center]}),Zt(w.zoom,S.zoom)||T.push({command:mn.setZoom,args:[S.zoom]}),Zt(w.bearing,S.bearing)||T.push({command:mn.setBearing,args:[S.bearing]}),Zt(w.pitch,S.pitch)||T.push({command:mn.setPitch,args:[S.pitch]}),Zt(w.sprite,S.sprite)||T.push({command:mn.setSprite,args:[S.sprite]}),Zt(w.glyphs,S.glyphs)||T.push({command:mn.setGlyphs,args:[S.glyphs]}),Zt(w.transition,S.transition)||T.push({command:mn.setTransition,args:[S.transition]}),Zt(w.light,S.light)||T.push({command:mn.setLight,args:[S.light]});const k={},R=[];!function(L,j,Q,ee){let Y;for(Y in j=j||{},L=L||{})Object.prototype.hasOwnProperty.call(L,Y)&&(Object.prototype.hasOwnProperty.call(j,Y)||Oc(Y,Q,ee));for(Y in j)Object.prototype.hasOwnProperty.call(j,Y)&&(Object.prototype.hasOwnProperty.call(L,Y)?Zt(L[Y],j[Y])||("geojson"===L[Y].type&&"geojson"===j[Y].type&&Ru(L,j,Y)?Q.push({command:mn.setGeoJSONSourceData,args:[Y,j[Y].data]}):Ba(Y,j,Q,ee)):oa(Y,j,Q))}(w.sources,S.sources,R,k);const z=[];w.layers&&w.layers.forEach(L=>{k[L.source]?T.push({command:mn.removeLayer,args:[L.id]}):z.push(L)}),T=T.concat(R),function(L,j,Q){j=j||[];const ee=(L=L||[]).map(Va),Y=j.map(Va),ae=L.reduce(Sn,{}),_e=j.reduce(Sn,{}),ye=ee.slice(),ie=Object.create(null);let we,De,Se,ke,Be,Le,Ne;for(we=0,De=0;we!(w.command in Rf));if(0===m.length)return!1;const y=m.filter(w=>!(w.command in Lu));if(y.length>0)throw new Error(`Unimplemented: ${y.map(w=>w.command).join(", ")}.`);return m.forEach(w=>{"setTransition"!==w.command&&this[w.command].apply(this,w.args)}),this.stylesheet=a,!0}addImage(a,h){if(this.getImage(a))return this.fire(new b.ErrorEvent(new Error(`An image named "${a}" already exists.`)));this.imageManager.addImage(a,h),this._afterImageUpdated(a)}updateImage(a,h){this.imageManager.updateImage(a,h)}getImage(a){return this.imageManager.getImage(a)}removeImage(a){if(!this.getImage(a))return this.fire(new b.ErrorEvent(new Error(`An image named "${a}" does not exist.`)));this.imageManager.removeImage(a),this._afterImageUpdated(a)}_afterImageUpdated(a){this._availableImages=this.imageManager.listImages(),this._changedImages[a]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(a,h,m={}){if(this._checkLoaded(),void 0!==this.sourceCaches[a])throw new Error(`Source "${a}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(b.validateStyle.source,`sources.${a}`,h,null,m))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const y=this.sourceCaches[a]=new At(a,h,this.dispatcher);y.style=this,y.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:y.serialize(),sourceId:a})),y.onAdd(this.map),this._changed=!0}removeSource(a){if(this._checkLoaded(),void 0===this.sourceCaches[a])throw new Error("There is no source with this ID");for(const m in this._layers)if(this._layers[m].source===a)return this.fire(new b.ErrorEvent(new Error(`Source "${a}" cannot be removed while layer "${m}" is using it.`)));const h=this.sourceCaches[a];delete this.sourceCaches[a],delete this._updatedSources[a],h.fire(new b.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:a})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(a,h){if(this._checkLoaded(),void 0===this.sourceCaches[a])throw new Error(`There is no source with this ID=${a}`);const m=this.sourceCaches[a].getSource();if("geojson"!==m.type)throw new Error(`geojsonSource.type is ${m.type}, which is !== 'geojson`);m.setData(h),this._changed=!0}getSource(a){return this.sourceCaches[a]&&this.sourceCaches[a].getSource()}addLayer(a,h,m={}){this._checkLoaded();const y=a.id;if(this.getLayer(y))return void this.fire(new b.ErrorEvent(new Error(`Layer "${y}" already exists on this map.`)));let w;if("custom"===a.type){if(Mn(this,b.validateCustomStyleLayer(a)))return;w=b.createStyleLayer(a)}else{if("object"==typeof a.source&&(this.addSource(y,a.source),a=b.clone$1(a),a=b.extend(a,{source:y})),this._validate(b.validateStyle.layer,`layers.${y}`,a,{arrayIndex:-1},m))return;w=b.createStyleLayer(a),this._validateLayer(w),w.setEventedParent(this,{layer:{id:y}}),this._serializedLayers[w.id]=w.serialize()}const S=h?this._order.indexOf(h):this._order.length;if(h&&-1===S)this.fire(new b.ErrorEvent(new Error(`Cannot add layer "${y}" before non-existing layer "${h}".`)));else{if(this._order.splice(S,0,y),this._layerOrderChanged=!0,this._layers[y]=w,this._removedLayers[y]&&w.source&&"custom"!==w.type){const T=this._removedLayers[y];delete this._removedLayers[y],T.type!==w.type?this._updatedSources[w.source]="clear":(this._updatedSources[w.source]="reload",this.sourceCaches[w.source].pause())}this._updateLayer(w),w.onAdd&&w.onAdd(this.map)}}moveLayer(a,h){if(this._checkLoaded(),this._changed=!0,!this._layers[a])return void this.fire(new b.ErrorEvent(new Error(`The layer '${a}' does not exist in the map's style and cannot be moved.`)));if(a===h)return;const m=this._order.indexOf(a);this._order.splice(m,1);const y=h?this._order.indexOf(h):this._order.length;h&&-1===y?this.fire(new b.ErrorEvent(new Error(`Cannot move layer "${a}" before non-existing layer "${h}".`))):(this._order.splice(y,0,a),this._layerOrderChanged=!0)}removeLayer(a){this._checkLoaded();const h=this._layers[a];if(!h)return void this.fire(new b.ErrorEvent(new Error(`Cannot remove non-existing layer "${a}".`)));h.setEventedParent(null);const m=this._order.indexOf(a);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[a]=h,delete this._layers[a],delete this._serializedLayers[a],delete this._updatedLayers[a],delete this._updatedPaintProps[a],h.onRemove&&h.onRemove(this.map)}getLayer(a){return this._layers[a]}hasLayer(a){return a in this._layers}setLayerZoomRange(a,h,m){this._checkLoaded();const y=this.getLayer(a);y?y.minzoom===h&&y.maxzoom===m||(null!=h&&(y.minzoom=h),null!=m&&(y.maxzoom=m),this._updateLayer(y)):this.fire(new b.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${a}".`)))}setFilter(a,h,m={}){this._checkLoaded();const y=this.getLayer(a);if(y){if(!Zt(y.filter,h))return null==h?(y.filter=void 0,void this._updateLayer(y)):void(this._validate(b.validateStyle.filter,`layers.${y.id}.filter`,h,null,m)||(y.filter=b.clone$1(h),this._updateLayer(y)))}else this.fire(new b.ErrorEvent(new Error(`Cannot filter non-existing layer "${a}".`)))}getFilter(a){return b.clone$1(this.getLayer(a).filter)}setLayoutProperty(a,h,m,y={}){this._checkLoaded();const w=this.getLayer(a);w?Zt(w.getLayoutProperty(h),m)||(w.setLayoutProperty(h,m,y),this._updateLayer(w)):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${a}".`)))}getLayoutProperty(a,h){const m=this.getLayer(a);if(m)return m.getLayoutProperty(h);this.fire(new b.ErrorEvent(new Error(`Cannot get style of non-existing layer "${a}".`)))}setPaintProperty(a,h,m,y={}){this._checkLoaded();const w=this.getLayer(a);w?Zt(w.getPaintProperty(h),m)||(w.setPaintProperty(h,m,y)&&this._updateLayer(w),this._changed=!0,this._updatedPaintProps[a]=!0):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${a}".`)))}getPaintProperty(a,h){return this.getLayer(a).getPaintProperty(h)}setFeatureState(a,h){this._checkLoaded();const m=a.source,y=a.sourceLayer,w=this.sourceCaches[m];if(void 0===w)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const S=w.getSource().type;"geojson"===S&&y?this.fire(new b.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==S||y?(void 0===a.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),w.setFeatureState(y,a.id,h)):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(a,h){this._checkLoaded();const m=a.source,y=this.sourceCaches[m];if(void 0===y)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const w=y.getSource().type,S="vector"===w?a.sourceLayer:void 0;"vector"!==w||S?h&&"string"!=typeof a.id&&"number"!=typeof a.id?this.fire(new b.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):y.removeFeatureState(S,a.id,h):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(a){this._checkLoaded();const h=a.source,m=a.sourceLayer,y=this.sourceCaches[h];if(void 0!==y)return"vector"!==y.getSource().type||m?(void 0===a.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),y.getFeatureState(m,a.id)):void this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new b.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return b.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return b.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:b.mapObject(this.sourceCaches,a=>a.serialize()),layers:this._serializeLayers(this._order)},a=>void 0!==a)}_updateLayer(a){this._updatedLayers[a.id]=!0,a.source&&!this._updatedSources[a.source]&&"raster"!==this.sourceCaches[a.source].getSource().type&&(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(a){const h=S=>"fill-extrusion"===this._layers[S].type,m={},y=[];for(let S=this._order.length-1;S>=0;S--){const T=this._order[S];if(h(T)){m[T]=S;for(const k of a){const R=k[T];if(R)for(const z of R)y.push(z)}}}y.sort((S,T)=>T.intersectionZ-S.intersectionZ);const w=[];for(let S=this._order.length-1;S>=0;S--){const T=this._order[S];if(h(T))for(let k=y.length-1;k>=0;k--){const R=y[k].feature;if(m[R.layer.id]{const ke=ae.featureSortOrder;if(ke){const Be=ke.indexOf(De.featureIndex);return ke.indexOf(Se.featureIndex)-Be}return Se.featureIndex-De.featureIndex});for(const De of we)ie.push(De)}}for(const ae in Q)Q[ae].forEach(_e=>{const ye=_e.feature,ie=k[S[ae].source].getFeatureState(ye.layer["source-layer"],ye.id);ye.source=ye.layer.source,ye.layer["source-layer"]&&(ye.sourceLayer=ye.layer["source-layer"]),ye.state=ie});return Q}(this._layers,this._serializedLayers,this.sourceCaches,a,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(w)}querySourceFeatures(a,h){h&&h.filter&&this._validate(b.validateStyle.filter,"querySourceFeatures.filter",h.filter,null,h);const m=this.sourceCaches[a];return m?function(y,w){const S=y.getRenderableIds().map(R=>y.getTileByID(R)),T=[],k={};for(let R=0;Rj.getTileByID(Q)).sort((Q,ee)=>ee.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(ee.tileID)?-1:1))}const L=this.crossTileSymbolIndex.addLayer(z,k[z.source],a.center.lng);S=S||L}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((w=w||this._layerOrderChanged||0===m)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(b.exported.now(),a.zoom))&&(this.pauseablePlacement=new Cr(a,this.map.terrain,this._order,w,h,m,y,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,k),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(b.exported.now()),T=!0),S&&this.pauseablePlacement.placement.setStale()),T||S)for(const R of this._order){const z=this._layers[R];"symbol"===z.type&&this.placement.updateLayerOpacities(z,k[z.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(b.exported.now())}_releaseSymbolFadeTiles(){for(const a in this.sourceCaches)this.sourceCaches[a].releaseSymbolFadeTiles()}getImages(a,h,m){this.imageManager.getImages(h.icons,m),this._updateTilesForChangedImages();const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,h.icons)}getGlyphs(a,h,m){this.glyphManager.getGlyphs(h.stacks,m);const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,[""])}getResource(a,h,m){return b.makeRequest(h,m)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(a,h={}){this._checkLoaded(),a&&this._validate(b.validateStyle.glyphs,"glyphs",a,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=a,this.glyphManager.entries={},this.glyphManager.setURL(a))}addSprite(a,h,m={},y){this._checkLoaded();const w=[{id:a,url:h}],S=[...fs(this.stylesheet.sprite),...w];this._validate(b.validateStyle.sprite,"sprite",S,null,m)||(this.stylesheet.sprite=S,this._loadSprite(w,!0,y))}removeSprite(a){this._checkLoaded();const h=fs(this.stylesheet.sprite);if(h.find(m=>m.id===a)){if(this._spritesImagesIds[a])for(const m of this._spritesImagesIds[a])this.imageManager.removeImage(m),this._changedImages[m]=!0;h.splice(h.findIndex(m=>m.id===a),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[a],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}else this.fire(new b.ErrorEvent(new Error(`Sprite "${a}" doesn't exists on this map.`)))}getSprite(){return fs(this.stylesheet.sprite)}setSprite(a,h={},m){this._checkLoaded(),a&&this._validate(b.validateStyle.sprite,"sprite",a,null,h)||(this.stylesheet.sprite=a,a?this._loadSprite(a,!0,m):(this._unloadSprite(),m(null)))}}Mt.getSourceType=function(g){return Ol[g]},Mt.setSourceType=function(g,a){Ol[g]=a},Mt.registerForPluginStateChange=b.registerForPluginStateChange;var Vl=b.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ff="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const nt={prelude:wn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:wn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying 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=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;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;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);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:wn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);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;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:wn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:wn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying 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:wn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;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;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:wn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:wn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:wn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:wn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(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=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);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;}"),fillPattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);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:wn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:wn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(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=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;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 vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*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:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:wn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:wn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:wn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying 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=texture2D(u_image0,v_pos0);vec4 color1=texture2D(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:wn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);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:wn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float 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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;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:wn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;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:wn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ff),terrainDepth:wn("varying 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() {gl_FragColor=pack(v_depth);}",Ff),terrainCoords:wn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ff)};function wn(g,a){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=a.match(/attribute ([\w]+) ([\w]+)/g),y=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=a.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),S=w?w.concat(y):y,T={};return{fragmentSource:g=g.replace(h,(k,R,z,L,j)=>(T[j]=!0,"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = u_${j};\n#endif\n`)),vertexSource:a=a.replace(h,(k,R,z,L,j)=>{const Q="float"===L?"vec2":"vec4",ee=j.match(/color/)?"color":Q;return T[j]?"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`}),staticAttributes:m,staticUniforms:S}}class $t{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(a,h,m,y,w,S,T,k,R){this.context=a;let z=this.boundPaintVertexBuffers.length!==y.length;for(let L=0;!z&&L>16,T>>16],u_pixel_coord_lower:[65535&S,65535&T]}}const ed=(g,a,h,m)=>{const y=a.style.light,w=y.properties.get("position"),S=[w.x,w.y,w.z],T=(R=new b.ARRAY_TYPE(9),b.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,R);var R;"viewport"===y.properties.get("anchor")&&function(R,z){var L=Math.sin(z),j=Math.cos(z);R[0]=j,R[1]=L,R[2]=0,R[3]=-L,R[4]=j,R[5]=0,R[6]=0,R[7]=0,R[8]=1}(T,-a.transform.angle),function(R,z,L){var j=z[0],Q=z[1],ee=z[2];R[0]=j*L[0]+Q*L[3]+ee*L[6],R[1]=j*L[1]+Q*L[4]+ee*L[7],R[2]=j*L[2]+Q*L[5]+ee*L[8]}(S,S,T);const k=y.properties.get("color");return{u_matrix:g,u_lightpos:S,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[k.r,k.g,k.b],u_vertical_gradient:+h,u_opacity:m}},Nu=(g,a,h,m,y,w,S)=>b.extend(ed(g,a,h,m),Of(w,a,S),{u_height_factor:-Math.pow(2,y.overscaledZ)/S.tileSize/8}),Wr=g=>({u_matrix:g}),Lc=(g,a,h,m)=>b.extend(Wr(g),Of(h,a,m)),Lf=(g,a)=>({u_matrix:g,u_world:a}),Io=(g,a,h,m,y)=>b.extend(Lc(g,a,h,m),{u_world:y}),Zo=(g,a,h,m)=>{const y=g.transform;let w,S;if("map"===m.paint.get("circle-pitch-alignment")){const T=Ie(h,1,y.zoom);w=!0,S=[T,T]}else w=!1,S=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+("map"===m.paint.get("circle-pitch-scale")),u_matrix:g.translatePosMatrix(a.posMatrix,h,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_pitch_with_map:+w,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:S}},td=(g,a,h)=>{const m=Ie(h,1,a.zoom),y=Math.pow(2,a.zoom-h.tileID.overscaledZ),w=h.tileID.overscaleFactor();return{u_matrix:g,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:m,u_extrude_scale:[a.pixelsToGLUnits[0]/(m*y),a.pixelsToGLUnits[1]/(m*y)],u_overscale_factor:w}},zu=(g,a,h=1)=>({u_matrix:g,u_color:a,u_overlay:0,u_overlay_scale:h}),nd=g=>({u_matrix:g}),Nf=(g,a,h,m)=>({u_matrix:g,u_extrude_scale:Ie(a,1,h),u_intensity:m});function Bu(g,a){const h=Math.pow(2,a.canonical.z),m=a.canonical.y;return[new b.MercatorCoordinate(0,m/h).toLngLat().lat,new b.MercatorCoordinate(0,(m+1)/h).toLngLat().lat]}const Vu=(g,a,h,m)=>{const y=g.transform;return{u_matrix:Ul(g,a,h,m),u_ratio:1/Ie(a,1,y.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},rd=(g,a,h,m,y)=>b.extend(Vu(g,a,h,y),{u_image:0,u_image_height:m}),id=(g,a,h,m,y)=>{const w=g.transform,S=Rn(a,w);return{u_matrix:Ul(g,a,h,y),u_texsize:a.imageAtlasTexture.size,u_ratio:1/Ie(a,1,w.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[S,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/w.pixelsToGLUnits[0],1/w.pixelsToGLUnits[1]]}},$i=(g,a,h,m,y,w)=>{const S=g.lineAtlas,T=Rn(a,g.transform),k="round"===h.layout.get("line-cap"),R=S.getDash(m.from,k),z=S.getDash(m.to,k),L=R.width*y.fromScale,j=z.width*y.toScale;return b.extend(Vu(g,a,h,w),{u_patternscale_a:[T/L,-R.height/2],u_patternscale_b:[T/j,-z.height/2],u_sdfgamma:S.width/(256*Math.min(L,j)*g.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:z.y,u_mix:y.t})};function Rn(g,a){return 1/Ie(g,1,a.tileZoom)}function Ul(g,a,h,m){return g.translatePosMatrix(m?m.posMatrix:a.tileID.posMatrix,a,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const T_=(g,a,h,m,y)=>{return{u_matrix:g,u_tl_parent:a,u_scale_parent:h,u_buffer_scale:1,u_fade_t:m.mix,u_opacity:m.opacity*y.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:y.paint.get("raster-brightness-min"),u_brightness_high:y.paint.get("raster-brightness-max"),u_saturation_factor:(S=y.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(w=y.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:A_(y.paint.get("raster-hue-rotate"))};var w,S};function A_(g){g*=Math.PI/180;const a=Math.sin(g),h=Math.cos(g);return[(2*h+1)/3,(-Math.sqrt(3)*a-h+1)/3,(Math.sqrt(3)*a-h+1)/3]}const Ot=(g,a,h,m,y,w,S,T,k,R)=>{const z=y.transform;return{u_is_size_zoom_constant:+("constant"===g||"source"===g),u_is_size_feature_constant:+("constant"===g||"camera"===g),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:z.width/z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:S,u_coord_matrix:T,u_is_text:+k,u_pitch_with_map:+m,u_texsize:R,u_texture:0}},$m=(g,a,h,m,y,w,S,T,k,R,z)=>{const L=y.transform;return b.extend(Ot(g,a,h,m,y,w,S,T,k,R),{u_gamma_scale:m?Math.cos(L._pitch)*L.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:+z})},Ei=(g,a,h,m,y,w,S,T,k,R)=>b.extend($m(g,a,h,m,y,w,S,T,!0,k,!0),{u_texsize_icon:R,u_texture_icon:1}),Uu=(g,a,h)=>({u_matrix:g,u_opacity:a,u_color:h}),od=(g,a,h,m,y,w)=>b.extend(function(S,T,k,R){const z=k.imageManager.getPattern(S.from.toString()),L=k.imageManager.getPattern(S.to.toString()),{width:j,height:Q}=k.imageManager.getPixelSize(),ee=Math.pow(2,R.tileID.overscaledZ),Y=R.tileSize*Math.pow(2,k.transform.tileZoom)/ee,ae=Y*(R.tileID.canonical.x+R.tileID.wrap*ee),_e=Y*R.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:L.tl,u_pattern_br_b:L.br,u_texsize:[j,Q],u_mix:T.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:L.displaySize,u_scale_a:T.fromScale,u_scale_b:T.toScale,u_tile_units_to_pixels:1/Ie(R,1,k.transform.tileZoom),u_pixel_coord_upper:[ae>>16,_e>>16],u_pixel_coord_lower:[65535&ae,65535&_e]}}(m,w,h,y),{u_matrix:g,u_opacity:a}),Nc={fillExtrusion:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_lightpos:new b.Uniform3f(g,a.u_lightpos),u_lightintensity:new b.Uniform1f(g,a.u_lightintensity),u_lightcolor:new b.Uniform3f(g,a.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,a.u_vertical_gradient),u_opacity:new b.Uniform1f(g,a.u_opacity)}),fillExtrusionPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_lightpos:new b.Uniform3f(g,a.u_lightpos),u_lightintensity:new b.Uniform1f(g,a.u_lightintensity),u_lightcolor:new b.Uniform3f(g,a.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,a.u_vertical_gradient),u_height_factor:new b.Uniform1f(g,a.u_height_factor),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade),u_opacity:new b.Uniform1f(g,a.u_opacity)}),fill:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),fillPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),fillOutline:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world)}),fillOutlinePattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world),u_image:new b.Uniform1i(g,a.u_image),u_texsize:new b.Uniform2f(g,a.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),circle:(g,a)=>({u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_scale_with_map:new b.Uniform1i(g,a.u_scale_with_map),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_extrude_scale:new b.Uniform2f(g,a.u_extrude_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),collisionBox:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pixels_to_tile_units:new b.Uniform1f(g,a.u_pixels_to_tile_units),u_extrude_scale:new b.Uniform2f(g,a.u_extrude_scale),u_overscale_factor:new b.Uniform1f(g,a.u_overscale_factor)}),collisionCircle:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_inv_matrix:new b.UniformMatrix4f(g,a.u_inv_matrix),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_viewport_size:new b.Uniform2f(g,a.u_viewport_size)}),debug:(g,a)=>({u_color:new b.UniformColor(g,a.u_color),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_overlay:new b.Uniform1i(g,a.u_overlay),u_overlay_scale:new b.Uniform1f(g,a.u_overlay_scale)}),clippingMask:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),heatmap:(g,a)=>({u_extrude_scale:new b.Uniform1f(g,a.u_extrude_scale),u_intensity:new b.Uniform1f(g,a.u_intensity),u_matrix:new b.UniformMatrix4f(g,a.u_matrix)}),heatmapTexture:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_world:new b.Uniform2f(g,a.u_world),u_image:new b.Uniform1i(g,a.u_image),u_color_ramp:new b.Uniform1i(g,a.u_color_ramp),u_opacity:new b.Uniform1f(g,a.u_opacity)}),hillshade:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_latrange:new b.Uniform2f(g,a.u_latrange),u_light:new b.Uniform2f(g,a.u_light),u_shadow:new b.UniformColor(g,a.u_shadow),u_highlight:new b.UniformColor(g,a.u_highlight),u_accent:new b.UniformColor(g,a.u_accent)}),hillshadePrepare:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_image:new b.Uniform1i(g,a.u_image),u_dimension:new b.Uniform2f(g,a.u_dimension),u_zoom:new b.Uniform1f(g,a.u_zoom),u_unpack:new b.Uniform4f(g,a.u_unpack)}),line:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels)}),lineGradient:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_image:new b.Uniform1i(g,a.u_image),u_image_height:new b.Uniform1f(g,a.u_image_height)}),linePattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texsize:new b.Uniform2f(g,a.u_texsize),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_image:new b.Uniform1i(g,a.u_image),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_scale:new b.Uniform3f(g,a.u_scale),u_fade:new b.Uniform1f(g,a.u_fade)}),lineSDF:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ratio:new b.Uniform1f(g,a.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,a.u_units_to_pixels),u_patternscale_a:new b.Uniform2f(g,a.u_patternscale_a),u_patternscale_b:new b.Uniform2f(g,a.u_patternscale_b),u_sdfgamma:new b.Uniform1f(g,a.u_sdfgamma),u_image:new b.Uniform1i(g,a.u_image),u_tex_y_a:new b.Uniform1f(g,a.u_tex_y_a),u_tex_y_b:new b.Uniform1f(g,a.u_tex_y_b),u_mix:new b.Uniform1f(g,a.u_mix)}),raster:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_tl_parent:new b.Uniform2f(g,a.u_tl_parent),u_scale_parent:new b.Uniform1f(g,a.u_scale_parent),u_buffer_scale:new b.Uniform1f(g,a.u_buffer_scale),u_fade_t:new b.Uniform1f(g,a.u_fade_t),u_opacity:new b.Uniform1f(g,a.u_opacity),u_image0:new b.Uniform1i(g,a.u_image0),u_image1:new b.Uniform1i(g,a.u_image1),u_brightness_low:new b.Uniform1f(g,a.u_brightness_low),u_brightness_high:new b.Uniform1f(g,a.u_brightness_high),u_saturation_factor:new b.Uniform1f(g,a.u_saturation_factor),u_contrast_factor:new b.Uniform1f(g,a.u_contrast_factor),u_spin_weights:new b.Uniform3f(g,a.u_spin_weights)}),symbolIcon:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texture:new b.Uniform1i(g,a.u_texture)}),symbolSDF:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texture:new b.Uniform1i(g,a.u_texture),u_gamma_scale:new b.Uniform1f(g,a.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,a.u_is_halo)}),symbolTextAndIcon:(g,a)=>({u_is_size_zoom_constant:new b.Uniform1i(g,a.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,a.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,a.u_size_t),u_size:new b.Uniform1f(g,a.u_size),u_camera_to_center_distance:new b.Uniform1f(g,a.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,a.u_pitch),u_rotate_symbol:new b.Uniform1i(g,a.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,a.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,a.u_fade_change),u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,a.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,a.u_coord_matrix),u_is_text:new b.Uniform1i(g,a.u_is_text),u_pitch_with_map:new b.Uniform1i(g,a.u_pitch_with_map),u_texsize:new b.Uniform2f(g,a.u_texsize),u_texsize_icon:new b.Uniform2f(g,a.u_texsize_icon),u_texture:new b.Uniform1i(g,a.u_texture),u_texture_icon:new b.Uniform1i(g,a.u_texture_icon),u_gamma_scale:new b.Uniform1f(g,a.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,a.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,a.u_is_halo)}),background:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_opacity:new b.Uniform1f(g,a.u_opacity),u_color:new b.UniformColor(g,a.u_color)}),backgroundPattern:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_opacity:new b.Uniform1f(g,a.u_opacity),u_image:new b.Uniform1i(g,a.u_image),u_pattern_tl_a:new b.Uniform2f(g,a.u_pattern_tl_a),u_pattern_br_a:new b.Uniform2f(g,a.u_pattern_br_a),u_pattern_tl_b:new b.Uniform2f(g,a.u_pattern_tl_b),u_pattern_br_b:new b.Uniform2f(g,a.u_pattern_br_b),u_texsize:new b.Uniform2f(g,a.u_texsize),u_mix:new b.Uniform1f(g,a.u_mix),u_pattern_size_a:new b.Uniform2f(g,a.u_pattern_size_a),u_pattern_size_b:new b.Uniform2f(g,a.u_pattern_size_b),u_scale_a:new b.Uniform1f(g,a.u_scale_a),u_scale_b:new b.Uniform1f(g,a.u_scale_b),u_pixel_coord_upper:new b.Uniform2f(g,a.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,a.u_pixel_coord_lower),u_tile_units_to_pixels:new b.Uniform1f(g,a.u_tile_units_to_pixels)}),terrain:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texture:new b.Uniform1i(g,a.u_texture),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)}),terrainDepth:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)}),terrainCoords:(g,a)=>({u_matrix:new b.UniformMatrix4f(g,a.u_matrix),u_texture:new b.Uniform1i(g,a.u_texture),u_terrain_coords_id:new b.Uniform1f(g,a.u_terrain_coords_id),u_ele_delta:new b.Uniform1f(g,a.u_ele_delta)})};class sd{constructor(a,h,m){this.context=a;const y=a.gl;this.buffer=y.createBuffer(),this.dynamicDraw=Boolean(m),this.context.unbindVAO(),a.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(a){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,a.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ad={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ha{constructor(a,h,m,y){this.length=h.length,this.attributes=m,this.itemSize=h.bytesPerElement,this.dynamicDraw=y,this.context=a;const w=a.gl;this.buffer=w.createBuffer(),a.bindVertexBuffer.set(this.buffer),w.bufferData(w.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?w.DYNAMIC_DRAW:w.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(a){if(a.length!==this.length)throw new Error(`Length of new data is ${a.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,a.arrayBuffer)}enableAttributes(a,h){for(let m=0;m0){const Ne=b.create(),ze=ke;b.mul(Ne,Se.placementInvProjMatrix,g.transform.glCoordMatrix),b.mul(Ne,Ne,Se.placementViewportMatrix),z.push({circleArray:Le,circleOffset:j,transform:ze,invTransform:Ne,coord:we}),L+=Le.length/4,j=L}Be&&R.draw(T,k.LINES,kt.disabled,cn.disabled,g.colorModeForRenderPass(),rn.disabled,td(ke,g.transform,De),g.style.map.terrain&&g.style.map.terrain.getTerrainData(we),h.id,Be.layoutVertexBuffer,Be.indexBuffer,Be.segments,null,g.transform.zoom,null,null,Be.collisionVertexBuffer)}if(!S||!z.length)return;const Q=g.useProgram("collisionCircle"),ee=new b.CollisionCircleLayoutArray;ee.resize(4*L),ee._trim();let Y=0;for(const ie of z)for(let we=0;we=0&&(ee[ae.associatedIconIndex]={shiftedAnchor:ht,angle:Pt})}else ue(ae.numGlyphs,j)}if(R){Q.clear();const Y=g.icon.placedSymbolArray;for(let ae=0;aeg.style.map.terrain.getElevation(Be,sh,ya):null,Zi="map"===h.layout.get("text-rotation-alignment");V(Ne,Be.posMatrix,g,y,Ii,Jo,ae,R,Zi,Qo)}const Rr=g.translatePosMatrix(Be.posMatrix,Le,w,S),hr=_e||y&&Se||Yl?lr:Ii,On=g.translatePosMatrix(Jo,Le,w,S,!0),qi=Pt&&0!==h.paint.get(y?"text-halo-width":"icon-halo-width").constantOr(1);let Yr;Yr=Pt?Ne.iconsInText?Ei(zt.kind,An,ye,ae,g,Rr,hr,On,on,Ro):$m(zt.kind,An,ye,ae,g,Rr,hr,On,y,on,!0):Ot(zt.kind,An,ye,ae,g,Rr,hr,On,y,on);const tr={program:Tn,buffers:ze,uniformValues:Yr,atlasTexture:Fn,atlasTextureIcon:br,atlasInterpolation:_n,atlasInterpolationIcon:yo,isSDF:Pt,hasHalo:qi};if(ie&&Ne.canOverlap){we=!0;const Qo=ze.segments.get();for(const Zi of Qo)ke.push({segments:new b.SegmentVector([Zi]),sortKey:Zi.sortKey,state:tr,terrainData:Ht})}else ke.push({segments:ze.segments,sortKey:0,state:tr,terrainData:Ht})}we&&ke.sort((Be,Le)=>Be.sortKey-Le.sortKey);for(const Be of ke){const Le=Be.state;if(j.activeTexture.set(Q.TEXTURE0),Le.atlasTexture.bind(Le.atlasInterpolation,Q.CLAMP_TO_EDGE),Le.atlasTextureIcon&&(j.activeTexture.set(Q.TEXTURE1),Le.atlasTextureIcon&&Le.atlasTextureIcon.bind(Le.atlasInterpolationIcon,Q.CLAMP_TO_EDGE)),Le.isSDF){const Ne=Le.uniformValues;Le.hasHalo&&(Ne.u_is_halo=1,_r(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Ne,Be.terrainData)),Ne.u_is_halo=0}_r(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Le.uniformValues,Be.terrainData)}}function _r(g,a,h,m,y,w,S,T,k,R){const z=m.context;y.draw(z,z.gl.TRIANGLES,w,S,T,rn.disabled,k,R,h.id,g.layoutVertexBuffer,g.indexBuffer,a,h.paint,m.transform.zoom,g.programConfigurations.get(h.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function Wa(g,a,h,m,y){if(!h||!m||!m.imageAtlas)return;const w=m.imageAtlas.patternPositions;let S=w[h.to.toString()],T=w[h.from.toString()];if(!S||!T){const k=y.getPaintProperty(a);S=w[k],T=w[k]}S&&T&&g.setConstantPatternPositions(S,T)}function Xa(g,a,h,m,y,w,S){const T=g.context.gl,k="fill-pattern",R=h.paint.get(k),z=R&&R.constantOr(1),L=h.getCrossfadeParameters();let j,Q,ee,Y,ae;S?(Q=z&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",j=T.LINES):(Q=z?"fillPattern":"fill",j=T.TRIANGLES);const _e=R.constantOr(null);for(const ye of m){const ie=a.getTile(ye);if(z&&!ie.patternsLoaded())continue;const we=ie.getBucket(h);if(!we)continue;const De=we.programConfigurations.get(h.id),Se=g.useProgram(Q,De),ke=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ye);z&&(g.context.activeTexture.set(T.TEXTURE0),ie.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),De.updatePaintBuffers(L)),Wa(De,k,_e,ie,h);const Be=ke?ye:null,Le=g.translatePosMatrix(Be?Be.posMatrix:ye.posMatrix,ie,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(S){Y=we.indexBuffer2,ae=we.segments2;const Ne=[T.drawingBufferWidth,T.drawingBufferHeight];ee="fillOutlinePattern"===Q&&z?Io(Le,g,L,ie,Ne):Lf(Le,Ne)}else Y=we.indexBuffer,ae=we.segments,ee=z?Lc(Le,g,L,ie):Wr(Le);Se.draw(g.context,j,y,g.stencilModeForClipping(ye),w,rn.disabled,ee,ke,h.id,we.layoutVertexBuffer,Y,ae,h.paint,g.transform.zoom,De)}}function Xt(g,a,h,m,y,w,S){const T=g.context,k=T.gl,R="fill-extrusion-pattern",z=h.paint.get(R),L=z.constantOr(1),j=h.getCrossfadeParameters(),Q=h.paint.get("fill-extrusion-opacity"),ee=z.constantOr(null);for(const Y of m){const ae=a.getTile(Y),_e=ae.getBucket(h);if(!_e)continue;const ye=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Y),ie=_e.programConfigurations.get(h.id),we=g.useProgram(L?"fillExtrusionPattern":"fillExtrusion",ie);L&&(g.context.activeTexture.set(k.TEXTURE0),ae.imageAtlasTexture.bind(k.LINEAR,k.CLAMP_TO_EDGE),ie.updatePaintBuffers(j)),Wa(ie,R,ee,ae,h);const De=g.translatePosMatrix(Y.posMatrix,ae,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Se=h.paint.get("fill-extrusion-vertical-gradient"),ke=L?Nu(De,g,Se,Q,Y,j,ae):ed(De,g,Se,Q);we.draw(T,T.gl.TRIANGLES,y,w,S,rn.backCCW,ke,ye,h.id,_e.layoutVertexBuffer,_e.indexBuffer,_e.segments,h.paint,g.transform.zoom,ie,g.style.map.terrain&&_e.centroidVertexBuffer)}}function Vc(g,a,h,m,y,w,S){const T=g.context,k=T.gl,R=h.fbo;if(!R)return;const z=g.useProgram("hillshade"),L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(a);T.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,R.colorAttachment.get()),z.draw(T,k.TRIANGLES,y,w,S,rn.disabled,((j,Q,ee,Y)=>{const ae=ee.paint.get("hillshade-shadow-color"),_e=ee.paint.get("hillshade-highlight-color"),ye=ee.paint.get("hillshade-accent-color");let ie=ee.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ee.paint.get("hillshade-illumination-anchor")&&(ie-=j.transform.angle);const we=!j.options.moving;return{u_matrix:Y?Y.posMatrix:j.transform.calculatePosMatrix(Q.tileID.toUnwrapped(),we),u_image:0,u_latrange:Bu(0,Q.tileID),u_light:[ee.paint.get("hillshade-exaggeration"),ie],u_shadow:ae,u_highlight:_e,u_accent:ye}})(g,h,m,L?a:null),L,m.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments)}function Ya(g,a,h,m,y,w){const S=g.context,T=S.gl,k=a.dem;if(k&&k.data){const R=k.dim,z=k.stride,L=k.getPixels();if(S.activeTexture.set(T.TEXTURE1),S.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||g.getTileTexture(z),a.demTexture){const Q=a.demTexture;Q.update(L,{premultiply:!1}),Q.bind(T.NEAREST,T.CLAMP_TO_EDGE)}else a.demTexture=new Hn(S,L,T.RGBA,{premultiply:!1}),a.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE);S.activeTexture.set(T.TEXTURE0);let j=a.fbo;if(!j){const Q=new Hn(S,{width:R,height:R,data:null},T.RGBA);Q.bind(T.LINEAR,T.CLAMP_TO_EDGE),j=a.fbo=S.createFramebuffer(R,R,!0),j.colorAttachment.set(Q.texture)}S.bindFramebuffer.set(j.framebuffer),S.viewport.set([0,0,R,R]),g.useProgram("hillshadePrepare").draw(S,T.TRIANGLES,m,y,w,rn.disabled,((Q,ee)=>{const Y=ee.stride,ae=b.create();return b.ortho(ae,0,b.EXTENT,-b.EXTENT,0,0,1),b.translate(ae,ae,[0,-b.EXTENT,0]),{u_matrix:ae,u_image:1,u_dimension:[Y,Y],u_zoom:Q.overscaledZ,u_unpack:ee.getUnpackVector()}})(a.tileID,k),null,h.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function Ka(g,a,h,m,y,w){const S=m.paint.get("raster-fade-duration");if(!w&&S>0){const T=b.exported.now(),k=(T-g.timeAdded)/S,R=a?(T-a.timeAdded)/S:-1,z=h.getSource(),L=y.coveringZoomLevel({tileSize:z.tileSize,roundZoom:z.roundZoom}),j=!a||Math.abs(a.tileID.overscaledZ-L)>Math.abs(g.tileID.overscaledZ-L),Q=j&&g.refreshedUponExpiration?1:b.clamp(j?k:1-R,0,1);return g.refreshedUponExpiration&&k>=1&&(g.refreshedUponExpiration=!1),a?{opacity:1,mix:1-Q}:{opacity:Q,mix:0}}return{opacity:1,mix:0}}const da=new b.Color(1,0,0,1),cr=new b.Color(0,1,0,1),ho=new b.Color(0,0,1,1),Ja=new b.Color(1,0,1,1),$r=new b.Color(0,1,1,1);function Yo(g,a,h,m){$n(g,0,a+h/2,g.transform.width,h,m)}function hd(g,a,h,m){$n(g,a-h/2,0,h,g.transform.height,m)}function $n(g,a,h,m,y,w){const S=g.context,T=S.gl;T.enable(T.SCISSOR_TEST),T.scissor(a*g.pixelRatio,h*g.pixelRatio,m*g.pixelRatio,y*g.pixelRatio),S.clear({color:w}),T.disable(T.SCISSOR_TEST)}function Gm(g,a,h){const m=g.context,y=m.gl,w=h.posMatrix,S=g.useProgram("debug"),T=kt.disabled,k=cn.disabled,R=g.colorModeForRenderPass(),z="$debug",L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(h);m.activeTexture.set(y.TEXTURE0),g.emptyTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE);const j=a.getTileByID(h.key).latestRawTileData,Q=Math.floor((j&&j.byteLength||0)/1024),ee=a.getTile(h).tileSize,Y=512/Math.min(ee,512)*(h.overscaledZ/g.transform.zoom)*.5;let ae=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(ae+=` => ${h.overscaledZ}`),function(_e,ye){_e.initDebugOverlayCanvas();const ie=_e.debugOverlayCanvas,we=_e.context.gl,De=_e.debugOverlayCanvas.getContext("2d");De.clearRect(0,0,ie.width,ie.height),De.shadowColor="white",De.shadowBlur=2,De.lineWidth=1.5,De.strokeStyle="white",De.textBaseline="top",De.font="bold 36px Open Sans, sans-serif",De.fillText(ye,5,5),De.strokeText(ye,5,5),_e.debugOverlayTexture.update(ie),_e.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}(g,`${ae} ${Q}kB`),S.draw(m,y.TRIANGLES,T,k,Nt.alphaBlended,rn.disabled,zu(w,b.Color.transparent,Y),null,z,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),S.draw(m,y.LINE_STRIP,T,k,R,rn.disabled,zu(w,b.Color.red),L,z,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function dd(g,a,h){const m=g.context,y=m.gl,w=g.colorModeForRenderPass(),S=new kt(y.LEQUAL,kt.ReadWrite,g.depthRangeFor3D),T=g.useProgram("terrain"),k=a.getTerrainMesh();m.bindFramebuffer.set(null),m.viewport.set([0,0,g.width,g.height]);for(const R of h){const z=g.renderToTexture.getTexture(R),L=a.getTerrainData(R.tileID);m.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,z.texture);const j={u_matrix:g.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_texture:0,u_ele_delta:a.getMeshFrameDelta(g.transform.zoom)};T.draw(m,y.TRIANGLES,S,cn.disabled,w,rn.backCCW,j,L,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}const $s={symbol:function(g,a,h,m,y){if("translucent"!==g.renderPass)return;const w=cn.disabled,S=g.colorModeForRenderPass();h.layout.get("text-variable-anchor")&&function(T,k,R,z,L,j,Q){const ee=k.transform,Y="map"===L,ae="map"===j;for(const _e of T){const ye=z.getTile(_e),ie=ye.getBucket(R);if(!ie||!ie.text||!ie.text.segments.get().length)continue;const we=b.evaluateSizeForZoom(ie.textSizeData,ee.zoom),De=Ie(ye,1,k.transform.zoom),Se=Vr(_e.posMatrix,ae,Y,k.transform,De),ke="none"!==R.layout.get("icon-text-fit")&&ie.hasIconData();if(we){const Be=Math.pow(2,ee.zoom-ye.tileID.overscaledZ);ha(ie,Y,ae,Q,ee,Se,_e.posMatrix,Be,we,ke,k.style.map.terrain?(Le,Ne)=>k.style.map.terrain.getElevation(_e,Le,Ne):null)}}}(m,g,h,a,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),y),0!==h.paint.get("icon-opacity").constantOr(1)&&Gi(g,a,h,m,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),w,S),0!==h.paint.get("text-opacity").constantOr(1)&&Gi(g,a,h,m,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),w,S),a.map.showCollisionBoxes&&(Wt(g,a,h,m,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Wt(g,a,h,m,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(g,a,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("circle-opacity"),w=h.paint.get("circle-stroke-width"),S=h.paint.get("circle-stroke-opacity"),T=!h.layout.get("circle-sort-key").isConstant();if(0===y.constantOr(1)&&(0===w.constantOr(1)||0===S.constantOr(1)))return;const k=g.context,R=k.gl,z=g.depthModeForSublayer(0,kt.ReadOnly),L=cn.disabled,j=g.colorModeForRenderPass(),Q=[];for(let ee=0;eeee.sortKey-Y.sortKey);for(const ee of Q){const{programConfiguration:Y,program:ae,layoutVertexBuffer:_e,indexBuffer:ye,uniformValues:ie,terrainData:we}=ee.state;ae.draw(k,R.TRIANGLES,z,L,j,rn.disabled,ie,we,h.id,_e,ye,ee.segments,h.paint,g.transform.zoom,Y)}},heatmap:function(g,a,h,m){if(0!==h.paint.get("heatmap-opacity"))if("offscreen"===g.renderPass){const y=g.context,w=y.gl,S=cn.disabled,T=new Nt([w.ONE,w.ONE],b.Color.transparent,[!0,!0,!0,!0]);(function(k,R,z){const L=k.gl;k.activeTexture.set(L.TEXTURE1),k.viewport.set([0,0,R.width/4,R.height/4]);let j=z.heatmapFbo;if(j)L.bindTexture(L.TEXTURE_2D,j.colorAttachment.get()),k.bindFramebuffer.set(j.framebuffer);else{const Q=L.createTexture();L.bindTexture(L.TEXTURE_2D,Q),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MIN_FILTER,L.LINEAR),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MAG_FILTER,L.LINEAR),j=z.heatmapFbo=k.createFramebuffer(R.width/4,R.height/4,!1),function(ee,Y,ae,_e){const ye=ee.gl;ye.texImage2D(ye.TEXTURE_2D,0,ye.RGBA,Y.width/4,Y.height/4,0,ye.RGBA,ee.extRenderToTextureHalfFloat?ee.extTextureHalfFloat.HALF_FLOAT_OES:ye.UNSIGNED_BYTE,null),_e.colorAttachment.set(ae)}(k,R,Q,j)}})(y,g,h),y.clear({color:b.Color.transparent});for(let k=0;k{const ee=b.create();b.ortho(ee,0,z.width,z.height,0,0,1);const Y=z.context.gl;return{u_matrix:ee,u_world:[Y.drawingBufferWidth,Y.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:L.paint.get("heatmap-opacity")}})(y,w),null,w.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,w.paint,y.transform.zoom)}(g,h))},line:function(g,a,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("line-opacity"),w=h.paint.get("line-width");if(0===y.constantOr(1)||0===w.constantOr(1))return;const S=g.depthModeForSublayer(0,kt.ReadOnly),T=g.colorModeForRenderPass(),k=h.paint.get("line-dasharray"),R=h.paint.get("line-pattern"),z=R.constantOr(1),L=h.paint.get("line-gradient"),j=h.getCrossfadeParameters(),Q=z?"linePattern":k?"lineSDF":L?"lineGradient":"line",ee=g.context,Y=ee.gl;let ae=!0;for(const _e of m){const ye=a.getTile(_e);if(z&&!ye.patternsLoaded())continue;const ie=ye.getBucket(h);if(!ie)continue;const we=ie.programConfigurations.get(h.id),De=g.context.program.get(),Se=g.useProgram(Q,we),ke=ae||Se.program!==De,Be=g.style.map.terrain&&g.style.map.terrain.getTerrainData(_e),Le=R.constantOr(null);if(Le&&ye.imageAtlas){const ht=ye.imageAtlas,Pt=ht.patternPositions[Le.to.toString()],zt=ht.patternPositions[Le.from.toString()];Pt&&zt&&we.setConstantPatternPositions(Pt,zt)}const Ne=Be?_e:null,ze=z?id(g,ye,h,j,Ne):k?$i(g,ye,h,k,j,Ne):L?rd(g,ye,h,ie.lineClipsArray.length,Ne):Vu(g,ye,h,Ne);if(z)ee.activeTexture.set(Y.TEXTURE0),ye.imageAtlasTexture.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),we.updatePaintBuffers(j);else if(k&&(ke||g.lineAtlas.dirty))ee.activeTexture.set(Y.TEXTURE0),g.lineAtlas.bind(ee);else if(L){const ht=ie.gradients[h.id];let Pt=ht.texture;if(h.gradientVersion!==ht.version){let zt=256;if(h.stepInterpolant){const mt=a.getSource().maxzoom,Tn=_e.canonical.z===mt?Math.ceil(1<256&&this.clearStencil(),m.setColorMode(Nt.disabled),m.setDepthMode(kt.disabled);const w=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of h){const T=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,k=this.style.map.terrain&&this.style.map.terrain.getTerrainData(S);w.draw(m,y.TRIANGLES,kt.disabled,new cn({func:y.ALWAYS,mask:0},T,255,y.KEEP,y.KEEP,y.REPLACE),Nt.disabled,rn.disabled,nd(S.posMatrix),k,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const a=this.nextStencilID++,h=this.context.gl;return new cn({func:h.NOTEQUAL,mask:255},a,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(a){const h=this.context.gl;return new cn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[a.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(a){const h=this.context.gl,m=a.sort((S,T)=>T.overscaledZ-S.overscaledZ),y=m[m.length-1].overscaledZ,w=m[0].overscaledZ-y+1;if(w>1){this.currentStencilSource=void 0,this.nextStencilID+w>256&&this.clearStencil();const S={};for(let T=0;T=0;this.currentLayer--){const k=this.style._layers[m[this.currentLayer]],R=y[k.source],z=w[k.source];this._renderTileClippingMasks(k,z),this.renderLayer(this,R,k,z)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerae.source&&!ae.isHidden(z)?[R.sourceCaches[ae.source]]:[]),Q=j.filter(ae=>"vector"===ae.getSource().type),ee=j.filter(ae=>"vector"!==ae.getSource().type),Y=ae=>{(!L||L.getSource().maxzoomY(ae)),L||ee.forEach(ae=>Y(ae)),L}(this.style,this.transform.zoom);k&&$s.debug(this,k,k.getVisibleCoordinates())}this.options.showPadding&&function(k){const R=k.transform.padding;Yo(k,k.transform.height-(R.top||0),3,da),Yo(k,R.bottom||0,3,cr),hd(k,R.left||0,3,ho),hd(k,k.transform.width-(R.right||0),3,Ja);const z=k.transform.centerPoint;var L,j,Q,ee;$n(L=k,(j=z.x)-1,(Q=k.transform.height-z.y)-10,2,20,ee=$r),$n(L,j-10,Q-1,20,2,ee)}(this),this.context.setDefault()}renderLayer(a,h,m,y){m.isHidden(this.transform.zoom)||("background"===m.type||"custom"===m.type||(y||[]).length)&&(this.id=m.id,this.gpuTimingStart(m),$s[m.type](a,h,m,y,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(a){if(!this.options.gpuTiming)return;const h=this.context.extTimerQuery;let m=this.gpuTimers[a.id];m||(m=this.gpuTimers[a.id]={calls:0,cpuTime:0,query:h.createQueryEXT()}),m.calls++,h.beginQueryEXT(h.TIME_ELAPSED_EXT,m.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const a=this.context.extTimerQuery;a.endQueryEXT(a.TIME_ELAPSED_EXT)}collectGpuTimers(){const a=this.gpuTimers;return this.gpuTimers={},a}queryGpuTimers(a){const h={};for(const m in a){const y=a[m],w=this.context.extTimerQuery,S=w.getQueryObjectEXT(y.query,w.QUERY_RESULT_EXT)/1e6;w.deleteQueryEXT(y.query),h[m]=S}return h}translatePosMatrix(a,h,m,y,w){if(!m[0]&&!m[1])return a;const S=w?"map"===y?this.transform.angle:0:"viewport"===y?-this.transform.angle:0;if(S){const R=Math.sin(S),z=Math.cos(S);m=[m[0]*z-m[1]*R,m[0]*R+m[1]*z]}const T=[w?m[0]:Ie(h,m[0],this.transform.zoom),w?m[1]:Ie(h,m[1],this.transform.zoom),0],k=new Float32Array(16);return b.translate(k,a,T),k}saveTileTexture(a){const h=this._tileTextures[a.size[0]];h?h.push(a):this._tileTextures[a.size[0]]=[a]}getTileTexture(a){const h=this._tileTextures[a];return h&&h.length>0?h.pop():null}isPatternMissing(a){if(!a)return!1;if(!a.from||!a.to)return!0;const h=this.imageManager.getPattern(a.from.toString()),m=this.imageManager.getPattern(a.to.toString());return!h||!m}useProgram(a,h){this.cache=this.cache||{};const m=a+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[m]||(this.cache[m]=new Qh(this.context,a,nt[a],h,Nc[a],this._showOverdrawInspector,this.style.map.terrain)),this.cache[m]}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 a=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(a.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Hn(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class ct{constructor(a,h){this.points=a,this.planes=h}static fromInvProjectionMatrix(a,h,m){const y=Math.pow(2,m),w=[[-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(T=>{const k=1/(T=b.transformMat4([],T,a))[3]/h*y;return b.mul$1(T,T,[k,k,1/T[3],k])}),S=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(T=>{const k=function(j,Q){var ee=Q[0],Y=Q[1],ae=Q[2],_e=ee*ee+Y*Y+ae*ae;return _e>0&&(_e=1/Math.sqrt(_e)),j[0]=Q[0]*_e,j[1]=Q[1]*_e,j[2]=Q[2]*_e,j}([],(j=[],Q=oo([],w[T[0]],w[T[1]]),ee=oo([],w[T[2]],w[T[1]]),Y=Q[0],ye=ee[0],j[0]=(ae=Q[1])*(we=ee[2])-(_e=Q[2])*(ie=ee[1]),j[1]=_e*ye-Y*we,j[2]=Y*ie-ae*ye,j)),R=-((z=k)[0]*(L=w[T[1]])[0]+z[1]*L[1]+z[2]*L[2]);var j,Q,ee,Y,ae,_e,ye,ie,we,z,L;return k.concat(R)});return new ct(w,S)}}class fa{constructor(a,h){var m,y,w;this.min=a,this.max=h,this.center=function(m,y,w){return m[0]=.5*y[0],m[1]=.5*y[1],m[2]=.5*y[2],m}([],((m=[])[0]=(y=this.min)[0]+(w=this.max)[0],m[1]=y[1]+w[1],m[2]=y[2]+w[2],m))}quadrant(a){const h=[a%2==0,a<2],m=na(this.min),y=na(this.max);for(let w=0;w=0&&S++;if(0===S)return 0;S!==h.length&&(m=!1)}if(m)return 2;for(let y=0;y<3;y++){let w=Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let T=0;Tthis.max[y]-this.min[y])return 0}return 1}}class fo{constructor(a=0,h=0,m=0,y=0){if(isNaN(a)||a<0||isNaN(h)||h<0||isNaN(m)||m<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=a,this.bottom=h,this.left=m,this.right=y}interpolate(a,h,m){return null!=h.top&&null!=a.top&&(this.top=b.number(a.top,h.top,m)),null!=h.bottom&&null!=a.bottom&&(this.bottom=b.number(a.bottom,h.bottom,m)),null!=h.left&&null!=a.left&&(this.left=b.number(a.left,h.left,m)),null!=h.right&&null!=a.right&&(this.right=b.number(a.right,h.right,m)),this}getCenter(a,h){const m=b.clamp((this.left+a-this.right)/2,0,a),y=b.clamp((this.top+h-this.bottom)/2,0,h);return new b.pointGeometry(m,y)}equals(a){return this.top===a.top&&this.bottom===a.bottom&&this.left===a.left&&this.right===a.right}clone(){return new fo(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Er{constructor(a,h,m,y,w){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=void 0===w||!!w,this._minZoom=a||0,this._maxZoom=h||22,this._minPitch=m??0,this._maxPitch=y??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new b.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new fo,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const a=new Er(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return a.tileSize=this.tileSize,a.latRange=this.latRange,a.width=this.width,a.height=this.height,a._center=this._center,a._elevation=this._elevation,a.zoom=this.zoom,a.angle=this.angle,a._fov=this._fov,a._pitch=this._pitch,a._unmodified=this._unmodified,a._edgeInsets=this._edgeInsets.clone(),a._calcMatrices(),a}get minZoom(){return this._minZoom}set minZoom(a){this._minZoom!==a&&(this._minZoom=a,this.zoom=Math.max(this.zoom,a))}get maxZoom(){return this._maxZoom}set maxZoom(a){this._maxZoom!==a&&(this._maxZoom=a,this.zoom=Math.min(this.zoom,a))}get minPitch(){return this._minPitch}set minPitch(a){this._minPitch!==a&&(this._minPitch=a,this.pitch=Math.max(this.pitch,a))}get maxPitch(){return this._maxPitch}set maxPitch(a){this._maxPitch!==a&&(this._maxPitch=a,this.pitch=Math.min(this.pitch,a))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(a){void 0===a?a=!0:null===a&&(a=!1),this._renderWorldCopies=a}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new b.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(a){const h=-b.wrap(a,-180,180)*Math.PI/180;var m;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(m=new b.ARRAY_TYPE(4),b.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m),function(m,y,w){var S=y[0],T=y[1],k=y[2],R=y[3],z=Math.sin(w),L=Math.cos(w);m[0]=S*L+k*z,m[1]=T*L+R*z,m[2]=S*-z+k*L,m[3]=T*-z+R*L}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(a){const h=b.clamp(a,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(a){a=Math.max(.01,Math.min(60,a)),this._fov!==a&&(this._unmodified=!1,this._fov=a/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(a){const h=Math.min(Math.max(a,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(a){a.lat===this._center.lat&&a.lng===this._center.lng||(this._unmodified=!1,this._center=a,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(a){a!==this._elevation&&(this._elevation=a,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(a){this._edgeInsets.equals(a)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,a,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(a){return this._edgeInsets.equals(a)}interpolatePadding(a,h,m){this._unmodified=!1,this._edgeInsets.interpolate(a,h,m),this._constrain(),this._calcMatrices()}coveringZoomLevel(a){const h=(a.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/a.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(a){const h=[new b.UnwrappedTileID(0,a)];if(this._renderWorldCopies){const m=this.pointCoordinate(new b.pointGeometry(0,0)),y=this.pointCoordinate(new b.pointGeometry(this.width,0)),w=this.pointCoordinate(new b.pointGeometry(this.width,this.height)),S=this.pointCoordinate(new b.pointGeometry(0,this.height)),T=Math.floor(Math.min(m.x,y.x,w.x,S.x)),k=Math.floor(Math.max(m.x,y.x,w.x,S.x)),R=1;for(let z=T-R;z<=k+R;z++)0!==z&&h.push(new b.UnwrappedTileID(z,a))}return h}coveringTiles(a){var h,m;let y=this.coveringZoomLevel(a);const w=y;if(void 0!==a.minzoom&&ya.maxzoom&&(y=a.maxzoom);const S=this.pointCoordinate(this.getCameraPoint()),T=b.MercatorCoordinate.fromLngLat(this.center),k=Math.pow(2,y),R=[k*S.x,k*S.y,0],z=[k*T.x,k*T.y,0],L=ct.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,y);let j=a.minzoom||0;!a.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(j=y);const Q=a.terrain?2/Math.min(this.tileSize,a.tileSize)*this.tileSize:3,ee=ie=>({aabb:new fa([ie*k,0,0],[(ie+1)*k,k,0]),zoom:0,x:0,y:0,wrap:ie,fullyVisible:!1}),Y=[],ae=[],_e=y,ye=a.reparseOverscaled?w:y;if(this._renderWorldCopies)for(let ie=1;ie<=3;ie++)Y.push(ee(-ie)),Y.push(ee(ie));for(Y.push(ee(0));Y.length>0;){const ie=Y.pop(),we=ie.x,De=ie.y;let Se=ie.fullyVisible;if(!Se){const ze=ie.aabb.intersects(L);if(0===ze)continue;Se=2===ze}const ke=a.terrain?R:z,Be=ie.aabb.distanceX(ke),Le=ie.aabb.distanceY(ke),Ne=Math.max(Math.abs(Be),Math.abs(Le));if(ie.zoom===_e||Ne>Q+(1<<_e-ie.zoom)-2&&ie.zoom>=j){const ze=_e-ie.zoom,ht=R[0]-.5-(we<>1),zt=ie.zoom+1;let mt=ie.aabb.quadrant(ze);if(a.terrain){const Tn=new b.OverscaledTileID(zt,ie.wrap,zt,ht,Pt),An=a.terrain.getMinMaxElevation(Tn),Ht=null!==(h=An.minElevation)&&void 0!==h?h:this.elevation,on=null!==(m=An.maxElevation)&&void 0!==m?m:this.elevation;mt=new fa([mt.min[0],mt.min[1],Ht],[mt.max[0],mt.max[1],on])}Y.push({aabb:mt,zoom:zt,x:ht,y:Pt,wrap:ie.wrap,fullyVisible:Se})}}return ae.sort((ie,we)=>ie.distanceSq-we.distanceSq).map(ie=>ie.tileID)}resize(a,h){this.width=a,this.height=h,this.pixelsToGLUnits=[2/a,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(a){return Math.pow(2,a)}scaleZoom(a){return Math.log(a)/Math.LN2}project(a){const h=b.clamp(a.lat,-this.maxValidLatitude,this.maxValidLatitude);return new b.pointGeometry(b.mercatorXfromLng(a.lng)*this.worldSize,b.mercatorYfromLat(h)*this.worldSize)}unproject(a){return new b.MercatorCoordinate(a.x/this.worldSize,a.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(a){this.freezeElevation||(this.elevation=a?this.getElevation(this._center,a):0)}getElevation(a,h){const m=b.MercatorCoordinate.fromLngLat(a),y=(1<S&&(y=S-ee)}if(this.lngRange){const Q=(T+k)/2,ee=b.wrap(L.x,Q-this.worldSize/2,Q+this.worldSize/2),Y=R.x/2;ee-Yk&&(m=k-Y)}void 0===m&&void 0===y||(this.center=this.unproject(new b.pointGeometry(void 0!==m?m:L.x,void 0!==y?y:L.y)).wrap()),this._unmodified=z,this._constraining=!1}_calcMatrices(){if(!this.height)return;const a=this.centerOffset,h=this.point.x,m=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=b.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let y=b.identity(new Float64Array(16));b.scale(y,y,[this.width/2,-this.height/2,1]),b.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=b.identity(new Float64Array(16)),b.scale(y,y,[1,-1,1]),b.translate(y,y,[-1,-1,0]),b.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const w=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,S=Math.PI/2+this._pitch,T=this._fov*(.5+a.y/this.height),k=Math.sin(T)*w/Math.sin(b.clamp(Math.PI-S-T,.01,Math.PI-.01)),R=this.getHorizon(),z=2*Math.atan(R/this.cameraToCenterDistance)*(.5+a.y/(2*R)),L=Math.sin(z)*w/Math.sin(b.clamp(Math.PI-S-z,.01,Math.PI-.01)),j=Math.min(k,L),Q=1.01*(Math.cos(Math.PI/2-this._pitch)*j+w),ee=this.height/50;y=new Float64Array(16),b.perspective(y,this._fov,this.width/this.height,ee,Q),y[8]=2*-a.x/this.width,y[9]=2*a.y/this.height,b.scale(y,y,[1,-1,1]),b.translate(y,y,[0,0,-this.cameraToCenterDistance]),b.rotateX(y,y,this._pitch),b.rotateZ(y,y,this.angle),b.translate(y,y,[-h,-m,0]),this.mercatorMatrix=b.scale([],y,[this.worldSize,this.worldSize,this.worldSize]),b.scale(y,y,[1,1,this._pixelPerMeter]),this.pixelMatrix=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y),b.translate(y,y,[0,0,-this.elevation]),this.projMatrix=y,this.invProjMatrix=b.invert([],y),this.pixelMatrix3D=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y);const Y=this.width%2/2,ae=this.height%2/2,_e=Math.cos(this.angle),ye=Math.sin(this.angle),ie=h-Math.round(h)+_e*Y+ye*ae,we=m-Math.round(m)+_e*ae+ye*Y,De=new Float64Array(y);if(b.translate(De,De,[ie>.5?ie-1:ie,we>.5?we-1:we,0]),this.alignedProjMatrix=De,y=b.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");this.pixelMatrixInverse=y,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const a=this.pointCoordinate(new b.pointGeometry(0,0)),h=[a.x*this.worldSize,a.y*this.worldSize,0,1];return b.transformMat4(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const a=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new b.pointGeometry(0,a))}getCameraQueryGeometry(a){const h=this.getCameraPoint();if(1===a.length)return[a[0],h];{let m=h.x,y=h.y,w=h.x,S=h.y;for(const T of a)m=Math.min(m,T.x),y=Math.min(y,T.y),w=Math.max(w,T.x),S=Math.max(S,T.y);return[new b.pointGeometry(m,y),new b.pointGeometry(w,y),new b.pointGeometry(w,S),new b.pointGeometry(m,S),new b.pointGeometry(m,y)]}}}class Bf{constructor(a){this._hashName=a&&encodeURIComponent(a),b.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,m){let y=!1,w=null;const S=()=>{w=null,y&&(h(),w=setTimeout(S,300),y=!1)};return()=>(y=!0,w||S(),w)}(this._updateHashUnthrottled.bind(this))}addTo(a){return this._map=a,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()),delete this._map,this}getHashString(a){const h=this._map.getCenter(),m=Math.round(100*this._map.getZoom())/100,y=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),w=Math.pow(10,y),S=Math.round(h.lng*w)/w,T=Math.round(h.lat*w)/w,k=this._map.getBearing(),R=this._map.getPitch();let z="";if(z+=a?`/${S}/${T}/${m}`:`${m}/${T}/${S}`,(k||R)&&(z+="/"+Math.round(10*k)/10),R&&(z+=`/${Math.round(R)}`),this._hashName){const L=this._hashName;let j=!1;const Q=window.location.hash.slice(1).split("&").map(ee=>{const Y=ee.split("=")[0];return Y===L?(j=!0,`${Y}=${z}`):ee}).filter(ee=>ee);return j||Q.push(`${L}=${z}`),`#${Q.join("&")}`}return`#${z}`}_getCurrentHash(){const a=window.location.hash.replace("#","");if(this._hashName){let h;return a.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(h=m)}),(h&&h[1]||"").split("/")}return a.split("/")}_onHashChange(){const a=this._getCurrentHash();if(a.length>=3&&!a.some(h=>isNaN(h))){const h=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:h,pitch:+(a[4]||0)}),!0}return!1}_updateHashUnthrottled(){const a=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,a)}catch{}}}const Xe={linearity:.3,easing:b.bezier(0,0,.3,1)},po=b.extend({deceleration:2500,maxSpeed:1400},Xe),fd=b.extend({deceleration:20,maxSpeed:1400},Xe),Zu=b.extend({deceleration:1e3,maxSpeed:360},Xe),jl=b.extend({deceleration:1e3,maxSpeed:90},Xe);class ko{constructor(a){this._map=a,this.clear()}clear(){this._inertiaBuffer=[]}record(a){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:b.exported.now(),settings:a})}_drainInertiaBuffer(){const a=this._inertiaBuffer,h=b.exported.now();for(;a.length>0&&h-a[0].time>160;)a.shift()}_onMoveEnd(a){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new b.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:w}of this._inertiaBuffer)h.zoom+=w.zoomDelta||0,h.bearing+=w.bearingDelta||0,h.pitch+=w.pitchDelta||0,w.panDelta&&h.pan._add(w.panDelta),w.around&&(h.around=w.around),w.pinchAround&&(h.pinchAround=w.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(h.pan.mag()){const w=pd(h.pan.mag(),m,b.extend({},po,a||{}));y.offset=h.pan.mult(w.amount/h.pan.mag()),y.center=this._map.transform.center,Uc(y,w)}if(h.zoom){const w=pd(h.zoom,m,fd);y.zoom=this._map.transform.zoom+w.amount,Uc(y,w)}if(h.bearing){const w=pd(h.bearing,m,Zu);y.bearing=this._map.transform.bearing+b.clamp(w.amount,-179,179),Uc(y,w)}if(h.pitch){const w=pd(h.pitch,m,jl);y.pitch=this._map.transform.pitch+w.amount,Uc(y,w)}if(y.zoom||y.bearing){const w=void 0===h.pinchAround?h.around:h.pinchAround;y.around=w?this._map.unproject(w):this._map.getCenter()}return this.clear(),b.extend(y,{noMoveStart:!0})}}function Uc(g,a){(!g.duration||g.durationh.unproject(k)),T=w.reduce((k,R,z,L)=>k.add(R.div(L.length)),new b.pointGeometry(0,0));super(a,{points:w,point:T,lngLats:S,lngLat:h.unproject(T),originalEvent:m}),this._defaultPrevented=!1}}class Vf extends b.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(a,h,m){super(a,{originalEvent:m}),this._defaultPrevented=!1}}class Uf{constructor(a,h){this._map=a,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(a){return this._firePreventable(new Vf(a.type,this._map,a))}mousedown(a,h){return this._mousedownPos=h,this._firePreventable(new Po(a.type,this._map,a))}mouseup(a){this._map.fire(new Po(a.type,this._map,a))}click(a,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Po(a.type,this._map,a))}dblclick(a){return this._firePreventable(new Po(a.type,this._map,a))}mouseover(a){this._map.fire(new Po(a.type,this._map,a))}mouseout(a){this._map.fire(new Po(a.type,this._map,a))}touchstart(a){return this._firePreventable(new Hl(a.type,this._map,a))}touchmove(a){this._map.fire(new Hl(a.type,this._map,a))}touchend(a){this._map.fire(new Hl(a.type,this._map,a))}touchcancel(a){this._map.fire(new Hl(a.type,this._map,a))}_firePreventable(a){if(this._map.fire(a),a.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class $f{constructor(a){this._map=a}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(a){this._map.fire(new Po(a.type,this._map,a))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Po("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(a){this._delayContextMenu?this._contextMenuEvent=a:this._ignoreContextMenu||this._map.fire(new Po(a.type,this._map,a)),this._map.listens("contextmenu")&&a.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class mo{constructor(a,h){this._map=a,this._el=a.getCanvasContainer(),this._container=a.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(a,h){this.isEnabled()&&a.shiftKey&&0===a.button&&(Te.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(a,h){if(!this._active)return;const m=h;if(this._lastPos.equals(m)||!this._box&&m.dist(this._startPos)w.fitScreenCoordinates(m,y,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",a)}keydown(a){this._active&&27===a.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",a))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Te.remove(this._box),this._box=null),Te.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(a,h){return this._map.fire(new b.Event(a,{originalEvent:h}))}}function js(g,a){if(g.length!==a.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${a.length}`);const h={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=a.timeStamp),m.length===this.numTouches&&(this.centroid=function(y){const w=new b.pointGeometry(0,0);for(const S of y)w._add(S);return w.div(y.length)}(h),this.touches=js(m,h)))}touchmove(a,h,m){if(this.aborted||!this.centroid)return;const y=js(m,h);for(const w in this.touches){const S=y[w];(!S||S.dist(this.touches[w])>30)&&(this.aborted=!0)}}touchend(a,h,m){if((!this.centroid||a.timeStamp-this.startTime>500)&&(this.aborted=!0),0===m.length){const y=!this.aborted&&this.centroid;if(this.reset(),y)return y}}}class Wu{constructor(a){this.singleTap=new qm(a),this.numTaps=a.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(a,h,m){this.singleTap.touchstart(a,h,m)}touchmove(a,h,m){this.singleTap.touchmove(a,h,m)}touchend(a,h,m){const y=this.singleTap.touchend(a,h,m);if(y){const w=a.timeStamp-this.lastTime<500,S=!this.lastTap||this.lastTap.dist(y)<30;if(w&&S||this.reset(),this.count++,this.lastTime=a.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}}}class jf{constructor(){this._zoomIn=new Wu({numTouches:1,numTaps:2}),this._zoomOut=new Wu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(a,h,m){this._zoomIn.touchstart(a,h,m),this._zoomOut.touchstart(a,h,m)}touchmove(a,h,m){this._zoomIn.touchmove(a,h,m),this._zoomOut.touchmove(a,h,m)}touchend(a,h,m){const y=this._zoomIn.touchend(a,h,m),w=this._zoomOut.touchend(a,h,m);return y?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()+1,around:S.unproject(y)},{originalEvent:a})}):w?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()-1,around:S.unproject(w)},{originalEvent:a})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gl{constructor(a){this._enabled=!!a.enable,this._moveStateManager=a.moveStateManager,this._clickTolerance=a.clickTolerance||1,this._moveFunction=a.move,this._activateOnStart=!!a.activateOnStart,a.assignEvents(this),this.reset()}reset(a){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(a)}_move(...a){const h=this._moveFunction(...a);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(a,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(a)&&(this._moveStateManager.startMove(a),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(a,h){if(!this.isEnabled())return;const m=this._lastPoint;if(!m)return;if(a.preventDefault(),!this._moveStateManager.isValidMoveEvent(a))return void this.reset(a);const y=h.length?h[0]:h;return!this._moved&&y.dist(m){g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=function(a){a.preventDefault()}},md=({enable:g,clickTolerance:a,bearingDegreesPerPixelMoved:h=.8})=>{const m=new go({checkCorrectEvent:y=>0===Te.mouseButton(y)&&y.ctrlKey||2===Te.mouseButton(y)});return new Gl({clickTolerance:a,move:(y,w)=>({bearingDelta:(w.x-y.x)*h}),moveStateManager:m,enable:g,assignEvents:$c})},Xu=({enable:g,clickTolerance:a,pitchDegreesPerPixelMoved:h=-.5})=>{const m=new go({checkCorrectEvent:y=>0===Te.mouseButton(y)&&y.ctrlKey||2===Te.mouseButton(y)});return new Gl({clickTolerance:a,move:(y,w)=>({pitchDelta:(w.y-y.y)*h}),moveStateManager:m,enable:g,assignEvents:$c})};class Yu{constructor(a,h){this._minTouches=a.cooperativeGestures?2:1,this._clickTolerance=a.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new b.pointGeometry(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(a,h,m){return this._calculateTransform(a,h,m)}touchmove(a,h,m){if(this._map._cooperativeGestures&&(2===this._minTouches&&m.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(a,!1,m.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(m.length0&&(this._active=!0);const y=js(m,h),w=new b.pointGeometry(0,0),S=new b.pointGeometry(0,0);let T=0;for(const R in y){const z=y[R],L=this._touches[R];L&&(w._add(z),S._add(z.sub(L)),T++,y[R]=z)}if(this._touches=y,TMath.abs(g.x)}class _d extends gd{constructor(a){super(),this._map=a}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(a,h,m){super.touchstart(a,h,m),this._currentTouchCount=m.length}_start(a){this._lastPoints=a,Qa(a[0].sub(a[1]))&&(this._valid=!1)}_move(a,h,m){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const y=a[0].sub(this._lastPoints[0]),w=a[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(y,w,m.timeStamp),this._valid?(this._lastPoints=a,this._active=!0,{pitchDelta:(y.y+w.y)/2*-.5}):void 0}gestureBeginsVertically(a,h,m){if(void 0!==this._valid)return this._valid;const y=a.mag()>=2,w=h.mag()>=2;if(!y&&!w)return;if(!y||!w)return void 0===this._firstMove&&(this._firstMove=m),m-this._firstMove<100&&void 0;const S=a.y>0==h.y>0;return Qa(a)&&Qa(h)&&S}}const vd={panStep:100,bearingStep:15,pitchStep:10};class Di{constructor(){const a=vd;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(a){if(a.altKey||a.ctrlKey||a.metaKey)return;let h=0,m=0,y=0,w=0,S=0;switch(a.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:a.shiftKey?m=-1:(a.preventDefault(),w=-1);break;case 39:a.shiftKey?m=1:(a.preventDefault(),w=1);break;case 38:a.shiftKey?y=1:(a.preventDefault(),S=-1);break;case 40:a.shiftKey?y=-1:(a.preventDefault(),S=1);break;default:return}return this._rotationDisabled&&(m=0,y=0),{cameraAnimation:T=>{const k=T.getZoom();T.easeTo({duration:300,easeId:"keyboardHandler",easing:jc,zoom:h?Math.round(k)+h*(a.shiftKey?2:1):k,bearing:T.getBearing()+m*this._bearingStep,pitch:T.getPitch()+y*this._pitchStep,offset:[-w*this._panStep,-S*this._panStep],center:T.getCenter()},{originalEvent:a})}}}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 jc(g){return g*(2-g)}const Ko=4.000244140625;class bd{constructor(a,h){this._map=a,this._el=a.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,b.bindAll(["_onTimeout"],this)}setZoomRate(a){this._defaultZoomRate=a}setWheelZoomRate(a){this._wheelZoomRate=a}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(a){this.isEnabled()||(this._enabled=!0,this._aroundCenter=a&&"center"===a.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(a){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;a.preventDefault()}let h=a.deltaMode===WheelEvent.DOM_DELTA_LINE?40*a.deltaY:a.deltaY;const m=b.exported.now(),y=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,0!==h&&h%Ko==0?this._type="wheel":0!==h&&Math.abs(h)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,a)):this._type||(this._type=Math.abs(y*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),a.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=a,this._delta-=h,this._active||this._start(a)),a.preventDefault()}_onTimeout(a){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)}_start(a){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 h=Te.mousePos(this._el,a);this._around=b.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(h)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const a=this._map.transform;if(0!==this._delta){const T="wheel"===this._type&&Math.abs(this._delta)>Ko?this._wheelZoomRate:this._defaultZoomRate;let k=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&0!==k&&(k=1/k);const R="number"==typeof this._targetZoom?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(R*k))),"wheel"===this._type&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h="number"==typeof this._targetZoom?this._targetZoom:a.zoom,m=this._startZoom,y=this._easing;let w,S=!1;if("wheel"===this._type&&m&&y){const T=Math.min((b.exported.now()-this._lastWheelEventTime)/200,1),k=y(T);w=b.number(m,h,k),T<1?this._frameId||(this._frameId=!0):S=!0}else w=h,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:w-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(a){let h=b.ease;if(this._prevEase){const m=this._prevEase,y=(b.exported.now()-m.start)/m.duration,w=m.easing(y+.01)-m.easing(y),S=.27/Math.sqrt(w*w+1e-4)*.01,T=Math.sqrt(.0729-S*S);h=b.bezier(S,T,.25,1)}return this._prevEase={start:b.exported.now(),duration:a,easing:h},h}reset(){this._active=!1}}class Ku{constructor(a,h){this._clickZoom=a,this._tapZoom=h}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 In{constructor(){this.reset()}reset(){this._active=!1}dblclick(a,h){return a.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:m.getZoom()+(a.shiftKey?-1:1),around:m.unproject(h)},{originalEvent:a})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dr{constructor(){this._tap=new Wu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(a,h,m){this._swipePoint||(this._tapTime&&a.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?m.length>0&&(this._swipePoint=h[0],this._swipeTouch=m[0].identifier):this._tap.touchstart(a,h,m))}touchmove(a,h,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const y=h[0],w=y.y-this._swipePoint.y;return this._swipePoint=y,a.preventDefault(),this._active=!0,{zoomDelta:w/128}}}else this._tap.touchmove(a,h,m)}touchend(a,h,m){this._tapTime?this._swipePoint&&0===m.length&&this.reset():this._tap.touchend(a,h,m)&&(this._tapTime=a.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hf{constructor(a,h,m){this._el=a,this._mousePan=h,this._touchPan=m}enable(a){this._inertiaOptions=a||{},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 el{constructor(a,h,m){this._pitchWithRotate=a.pitchWithRotate,this._mouseRotate=h,this._mousePitch=m}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ju{constructor(a,h,m,y){this._el=a,this._touchZoom=h,this._touchRotate=m,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0}enable(a){this._touchZoom.enable(a),this._rotationDisabled||this._touchRotate.enable(a),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()}}const Hc=g=>g.zoom||g.drag||g.pitch||g.rotate;class Sr extends b.Event{}function Gc(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta}class Qu{constructor(a,h){this._map=a,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ko(a),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h),b.bindAll(["handleEvent","handleWindowEvent"],this);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[window,"blur",void 0]];for(const[y,w,S]of this._listeners)Te.addEventListener(y,w,y===document?this.handleWindowEvent:this.handleEvent,S)}destroy(){for(const[a,h,m]of this._listeners)Te.removeEventListener(a,h,a===document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(a){const h=this._map,m=h.getCanvasContainer();this._add("mapEvent",new Uf(h,a));const y=h.boxZoom=new mo(h,a);this._add("boxZoom",y);const w=new jf,S=new In;h.doubleClickZoom=new Ku(S,w),this._add("tapZoom",w),this._add("clickZoom",S);const T=new Dr;this._add("tapDragZoom",T);const k=h.touchPitch=new _d(h);this._add("touchPitch",k);const R=md(a),z=Xu(a);h.dragRotate=new el(a,R,z),this._add("mouseRotate",R,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]);const L=(({enable:_e,clickTolerance:ye})=>{const ie=new go({checkCorrectEvent:we=>0===Te.mouseButton(we)&&!we.ctrlKey});return new Gl({clickTolerance:ye,move:(we,De)=>({around:De,panDelta:De.sub(we)}),activateOnStart:!0,moveStateManager:ie,enable:_e,assignEvents:$c})})(a),j=new Yu(a,h);h.dragPan=new Hf(m,L,j),this._add("mousePan",L),this._add("touchPan",j,["touchZoom","touchRotate"]);const Q=new yt,ee=new bs;h.touchZoomRotate=new Ju(m,ee,Q,T),this._add("touchRotate",Q,["touchPan","touchZoom"]),this._add("touchZoom",ee,["touchPan","touchRotate"]);const Y=h.scrollZoom=new bd(h,this);this._add("scrollZoom",Y,["mousePan"]);const ae=h.keyboard=new Di;this._add("keyboard",ae),this._add("blockableMapEvent",new $f(h));for(const _e of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])a.interactive&&a[_e]&&h[_e].enable(a[_e])}_add(a,h,m){this._handlers.push({handlerName:a,handler:h,allowed:m}),this._handlersById[a]=h}stop(a){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},a),this._changes=[]}}isActive(){for(const{handler:a}of this._handlers)if(a.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Hc(this._eventsInProgress))||this.isZooming()}_blockedByActive(a,h,m){for(const y in a)if(y!==m&&(!h||h.indexOf(y)<0))return!0;return!1}handleWindowEvent(a){this.handleEvent(a,`${a.type}Window`)}_getMapTouches(a){const h=[];for(const m of a)this._el.contains(m.target)&&h.push(m);return h}handleEvent(a,h){if("blur"===a.type)return void this.stop(!0);this._updatingCamera=!0;const m="renderFrame"===a.type?void 0:a,y={needsRenderFrame:!1},w={},S={},T=a.touches,k=T?this._getMapTouches(T):void 0,R=k?Te.touchPos(this._el,k):Te.mousePos(this._el,a);for(const{handlerName:j,handler:Q,allowed:ee}of this._handlers){if(!Q.isEnabled())continue;let Y;this._blockedByActive(S,ee,j)?Q.reset():Q[h||a.type]&&(Y=Q[h||a.type](a,R,k),this.mergeHandlerResult(y,w,Y,j,m),Y&&Y.needsRenderFrame&&this._triggerRenderFrame()),(Y||Q.isActive())&&(S[j]=Q)}const z={};for(const j in this._previousActiveHandlers)S[j]||(z[j]=m);this._previousActiveHandlers=S,(Object.keys(z).length||Gc(y))&&(this._changes.push([y,w,z]),this._triggerRenderFrame()),(Object.keys(S).length||Gc(y))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:L}=y;L&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],L(this._map))}mergeHandlerResult(a,h,m,y,w){if(!m)return;b.extend(a,m);const S={handlerName:y,originalEvent:m.originalEvent||w};void 0!==m.zoomDelta&&(h.zoom=S),void 0!==m.panDelta&&(h.drag=S),void 0!==m.pitchDelta&&(h.pitch=S),void 0!==m.bearingDelta&&(h.rotate=S)}_applyChanges(){const a={},h={},m={};for(const[y,w,S]of this._changes)y.panDelta&&(a.panDelta=(a.panDelta||new b.pointGeometry(0,0))._add(y.panDelta)),y.zoomDelta&&(a.zoomDelta=(a.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(a.bearingDelta=(a.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(a.pitchDelta=(a.pitchDelta||0)+y.pitchDelta),void 0!==y.around&&(a.around=y.around),void 0!==y.pinchAround&&(a.pinchAround=y.pinchAround),y.noInertia&&(a.noInertia=y.noInertia),b.extend(h,w),b.extend(m,S);this._updateMapTransform(a,h,m),this._changes=[]}_updateMapTransform(a,h,m){const y=this._map,w=y.transform,S=y.terrain;if(!(Gc(a)||S&&this._terrainMovement))return this._fireEvents(h,m,!0);let{panDelta:T,zoomDelta:k,bearingDelta:R,pitchDelta:z,around:L,pinchAround:j}=a;void 0!==j&&(L=j),y._stop(!0),L=L||y.transform.centerPoint;const Q=w.pointLocation(T?L.sub(T):L);R&&(w.bearing+=R),z&&(w.pitch+=z),k&&(w.zoom+=k),S?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?w.center=w.pointLocation(w.centerPoint.sub(T)):w.setLocationAtPoint(Q,L):(this._terrainMovement=!0,w.freezeElevation=!0,w.setLocationAtPoint(Q,L),this._map.once("moveend",()=>{w.freezeElevation=!1,this._terrainMovement=!1,w.recalculateZoom(y.terrain)})):w.setLocationAtPoint(Q,L),this._map._update(),a.noInertia||this._inertia.record(a),this._fireEvents(h,m,!0)}_fireEvents(a,h,m){const y=Hc(this._eventsInProgress),w=Hc(a),S={};for(const z in a){const{originalEvent:L}=a[z];this._eventsInProgress[z]||(S[`${z}start`]=L),this._eventsInProgress[z]=a[z]}!y&&w&&this._fireEvent("movestart",w.originalEvent);for(const z in S)this._fireEvent(z,S[z]);w&&this._fireEvent("move",w.originalEvent);for(const z in a){const{originalEvent:L}=a[z];this._fireEvent(z,L)}const T={};let k;for(const z in this._eventsInProgress){const{handlerName:L,originalEvent:j}=this._eventsInProgress[z];this._handlersById[L].isActive()||(delete this._eventsInProgress[z],k=h[L]||j,T[`${z}end`]=k)}for(const z in T)this._fireEvent(z,T[z]);const R=Hc(this._eventsInProgress);if(m&&(y||w)&&!R){this._updatingCamera=!0;const z=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),L=j=>0!==j&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Sr("renderFrame",{timeStamp:a})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const ql={extend:(g,...a)=>b.extend(g,...a),run(g){g()},logToElement(g,a=!1,h="log"){const m=window.document.getElementById(h);m&&(a&&(m.innerHTML=""),m.innerHTML+=`
${g}`)}};class Si extends b.Evented{constructor(a,h){super(),this._moving=!1,this._zooming=!1,this.transform=a,this._bearingSnap=h.bearingSnap,b.bindAll(["_renderFrameCallback"],this)}getCenter(){return new b.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(a,h){return this.jumpTo({center:a},h)}panBy(a,h,m){return a=b.pointGeometry.convert(a).mult(-1),this.panTo(this.transform.center,b.extend({offset:a},h),m)}panTo(a,h,m){return this.easeTo(b.extend({center:a},h),m)}getZoom(){return this.transform.zoom}setZoom(a,h){return this.jumpTo({zoom:a},h),this}zoomTo(a,h,m){return this.easeTo(b.extend({zoom:a},h),m)}zoomIn(a,h){return this.zoomTo(this.getZoom()+1,a,h),this}zoomOut(a,h){return this.zoomTo(this.getZoom()-1,a,h),this}getBearing(){return this.transform.bearing}setBearing(a,h){return this.jumpTo({bearing:a},h),this}getPadding(){return this.transform.padding}setPadding(a,h){return this.jumpTo({padding:a},h),this}rotateTo(a,h,m){return this.easeTo(b.extend({bearing:a},h),m)}resetNorth(a,h){return this.rotateTo(0,b.extend({duration:1e3},a),h),this}resetNorthPitch(a,h){return this.easeTo(b.extend({bearing:0,pitch:0,duration:1e3},a),h),this}snapToNorth(a,h){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=b.number(y,k,Se)),this._rotating&&(m.bearing=b.number(w,R,Se)),this._pitching&&(m.pitch=b.number(S,z,Se)),this._padding&&(m.interpolatePadding(T,L,Se),Q=m.centerPoint.add(j)),this.terrain&&!a.freezeElevation&&this._updateElevation(Se),ie)m.setLocationAtPoint(ie,we);else{const ke=m.zoomScale(m.zoom-y),Be=k>y?Math.min(2,ye):Math.max(.5,ye),Le=Math.pow(Be,1-Se),Ne=m.unproject(ae.add(_e.mult(Se*Le)).mult(ke));m.setLocationAtPoint(m.renderWorldCopies?Ne.wrap():Ne,Q)}this._fireMoveEvents(h)},Se=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Se)},a),this}_prepareEase(a,h,m={}){this._moving=!0,h||m.moving||this.fire(new b.Event("movestart",a)),this._zooming&&!m.zooming&&this.fire(new b.Event("zoomstart",a)),this._rotating&&!m.rotating&&this.fire(new b.Event("rotatestart",a)),this._pitching&&!m.pitching&&this.fire(new b.Event("pitchstart",a))}_prepareElevation(a){this._elevationCenter=a,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(a,this.terrain),this.transform.freezeElevation=!0}_updateElevation(a){const h=this.transform.getElevation(this._elevationCenter,this.terrain);if(a<1&&h!==this._elevationTarget){const m=this._elevationTarget-this._elevationStart;this._elevationStart+=a*(m-(h-(m*a+this._elevationStart))/(1-a)),this._elevationTarget=h}this.transform.elevation=b.number(this._elevationStart,this._elevationTarget,a)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_fireMoveEvents(a){this.fire(new b.Event("move",a)),this._zooming&&this.fire(new b.Event("zoom",a)),this._rotating&&this.fire(new b.Event("rotate",a)),this._pitching&&this.fire(new b.Event("pitch",a))}_afterEase(a,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const m=this._zooming,y=this._rotating,w=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new b.Event("zoomend",a)),y&&this.fire(new b.Event("rotateend",a)),w&&this.fire(new b.Event("pitchend",a)),this.fire(new b.Event("moveend",a))}flyTo(a,h){if(!a.essential&&b.exported.prefersReducedMotion){const mt=b.pick(a,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mt,h)}this.stop(),a=b.extend({offset:[0,0],speed:1.2,curve:1.42,easing:b.ease},a);const m=this.transform,y=this.getZoom(),w=this.getBearing(),S=this.getPitch(),T=this.getPadding(),k="zoom"in a?b.clamp(+a.zoom,m.minZoom,m.maxZoom):y,R="bearing"in a?this._normalizeBearing(a.bearing,w):w,z="pitch"in a?+a.pitch:S,L="padding"in a?a.padding:m.padding,j=m.zoomScale(k-y),Q=b.pointGeometry.convert(a.offset);let ee=m.centerPoint.add(Q);const Y=m.pointLocation(ee),ae=b.LngLat.convert(a.center||Y);this._normalizeCenter(ae);const _e=m.project(Y),ye=m.project(ae).sub(_e);let ie=a.curve;const we=Math.max(m.width,m.height),De=we/j,Se=ye.mag();if("minZoom"in a){const mt=b.clamp(Math.min(a.minZoom,y,k),m.minZoom,m.maxZoom),Tn=we/m.zoomScale(mt-y);ie=Math.sqrt(Tn/Se*2)}const ke=ie*ie;function Be(mt){const Tn=(De*De-we*we+(mt?-1:1)*ke*ke*Se*Se)/(2*(mt?De:we)*ke*Se);return Math.log(Math.sqrt(Tn*Tn+1)-Tn)}function Le(mt){return(Math.exp(mt)-Math.exp(-mt))/2}function Ne(mt){return(Math.exp(mt)+Math.exp(-mt))/2}const ze=Be(0);let ht=function(mt){return Ne(ze)/Ne(ze+ie*mt)},Pt=function(mt){return we*((Ne(ze)*(Le(Tn=ze+ie*mt)/Ne(Tn))-Le(ze))/ke)/Se;var Tn},zt=(Be(1)-ze)/ie;if(Math.abs(Se)<1e-6||!isFinite(zt)){if(Math.abs(we-De)<1e-6)return this.easeTo(a,h);const mt=Dea.maxDuration&&(a.duration=0),this._zooming=!0,this._rotating=w!==R,this._pitching=z!==S,this._padding=!m.isPaddingEqual(L),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(ae),this._ease(mt=>{const Tn=mt*zt,An=1/ht(Tn);m.zoom=1===mt?k:y+m.scaleZoom(An),this._rotating&&(m.bearing=b.number(w,R,mt)),this._pitching&&(m.pitch=b.number(S,z,mt)),this._padding&&(m.interpolatePadding(T,L,mt),ee=m.centerPoint.add(Q)),this.terrain&&!a.freezeElevation&&this._updateElevation(mt);const Ht=1===mt?ae:m.unproject(_e.add(ye.mult(Pt(Tn))).mult(An));m.setLocationAtPoint(m.renderWorldCopies?Ht.wrap():Ht,ee),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},a),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(a,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,h)}if(!a){const m=this.handlers;m&&m.stop(!1)}return this}_ease(a,h,m){!1===m.animate||0===m.duration?(a(1),h()):(this._easeStart=b.exported.now(),this._easeOptions=m,this._onEaseFrame=a,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const a=Math.min((b.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(a,h){a=b.wrap(a,-180,180);const m=Math.abs(a-h);return Math.abs(a-360-h)180?-360:m<-180?360:0}}class eh{constructor(a={}){this.options=a,b.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(a){return this._map=a,this._compact=this.options&&this.options.compact,this._container=Te.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Te.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Te.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(){Te.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(a,h){const m=this._map._getUIString(`AttributionControl.${h}`);a.title=m,a.setAttribute("aria-label",m)}_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")))}_updateData(a){!a||"metadata"!==a.sourceDataType&&"visibility"!==a.sourceDataType&&"style"!==a.dataType&&"terrain"!==a.type||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let a=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?a=a.concat(this.options.customAttribution.map(y=>"string"!=typeof y?"":y)):"string"==typeof this.options.customAttribution&&a.push(this.options.customAttribution)),this._map.style.stylesheet){const y=this._map.style.stylesheet;this.styleOwner=y.owner,this.styleId=y.id}const h=this._map.style.sourceCaches;for(const y in h){const w=h[y];if(w.used||w.usedForTerrain){const S=w.getSource();S.attribution&&a.indexOf(S.attribution)<0&&a.push(S.attribution)}}a=a.filter(y=>String(y).trim()),a.sort((y,w)=>y.length-w.length),a=a.filter((y,w)=>{for(let S=w+1;S=0)return!1;return!0});const m=a.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,a.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class Zl{constructor(a={}){this.options=a,b.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(a){this._map=a,this._compact=this.options&&this.options.compact,this._container=Te.create("div","maplibregl-ctrl");const h=Te.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Te.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const a=this._container.children;if(a.length){const h=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&h.classList.add("maplibregl-compact"):h.classList.remove("maplibregl-compact")}}}class pa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(a){const h=++this._id;return this._queue.push({callback:a,id:h,cancelled:!1}),h}remove(a){const h=this._currentlyRunning,m=h?this._queue.concat(h):this._queue;for(const y of m)if(y.id===a)return void(y.cancelled=!0)}run(a=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const m of h)if(!m.cancelled&&(m.callback(a),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Mi={"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":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var xd=b.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class Wl extends b.Evented{constructor(a){super(),this.sourceCache=a,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,a.usedForTerrain=!0,a.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(a,h){this.sourceCache.update(a,h),this._renderableTilesKeys=[];const m={};for(const y of a.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))m[y.key]=!0,this._renderableTilesKeys.push(y.key),this._tiles[y.key]||(y.posMatrix=new Float64Array(16),b.ortho(y.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),this._tiles[y.key]=new jt(y,this.tileSize));for(const y in this._tiles)m[y]||delete this._tiles[y]}freeRtt(a){for(const h in this._tiles){const m=this._tiles[h];(!a||m.tileID.equals(a)||m.tileID.isChildOf(a)||a.isChildOf(m.tileID))&&(m.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(a=>this.getTileByID(a))}getTileByID(a){return this._tiles[a]}getTerrainCoords(a){const h={};for(const m of this._renderableTilesKeys){const y=this._tiles[m].tileID;if(y.canonical.equals(a.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16),b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),h[m]=w}else if(y.canonical.isChildOf(a.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16);const S=y.canonical.z-a.canonical.z,T=y.canonical.x-(y.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,R,0,R,0,1),b.translate(w.posMatrix,w.posMatrix,[-T*R,-k*R,0]),h[m]=w}else if(a.canonical.isChildOf(y.canonical)){const w=a.clone();w.posMatrix=new Float64Array(16);const S=a.canonical.z-y.canonical.z,T=a.canonical.x-(a.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),b.translate(w.posMatrix,w.posMatrix,[T*R,k*R,0]),b.scale(w.posMatrix,w.posMatrix,[1/2**S,1/2**S,0]),h[m]=w}}return h}getSourceTile(a,h){const m=this.sourceCache._source;let y=a.overscaledZ-this.deltaZoom;if(y>m.maxzoom&&(y=m.maxzoom),y=m.minzoom&&(!w||!w.dem);)w=this.sourceCache.getTileByID(a.scaledTo(y--).key);return w}tilesAfterTime(a=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=a)}}class th{constructor(a,h,m){this.painter=a,this.sourceCache=new Wl(h),this.options=m,this.exaggeration="number"==typeof m.exaggeration?m.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(a,h,m,y=b.EXTENT){if(!(h>=0&&h=0&&ma.canonical.z&&(a.canonical.z>=y?w=a.canonical.z-y:b.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const S=a.canonical.x-(a.canonical.x>>w<>w<>8<<4|w>>8,h[S+3]=0;const m=new b.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),y=new Hn(a,m,a.gl.RGBA,{premultiply:!1});return y.bind(a.gl.NEAREST,a.gl.CLAMP_TO_EDGE),this._coordsTexture=y,y}pointCoordinate(a){const h=new Uint8Array(4),m=this.painter.context,y=m.gl;m.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),y.readPixels(a.x,this.painter.height/devicePixelRatio-a.y-1,1,1,y.RGBA,y.UNSIGNED_BYTE,h),m.bindFramebuffer.set(null);const w=h[0]+(h[2]>>4<<8),S=h[1]+((15&h[2])<<8),T=this.coordsIndex[255-h[3]],k=T&&this.sourceCache.getTileByID(T);if(!k)return null;const R=this._coordsTextureSize,z=(1<a.id!==h),this._recentlyUsed.push(a.id)}stampObject(a){a.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const a=this._createObject(this._objects.length);return this._objects.push(a),a}freeObject(a){a.inUse=!1}freeAllObjects(){for(const a of this._objects)this.freeObject(a)}isFull(){return!(this._objects.length!a.inUse)}}const Hs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Xl{constructor(a,h){this.painter=a,this.terrain=h,this.pool=new xs(a.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(a){return this.pool.getObjectForId(a.rtt[this._stacks.length-1].id).texture}prepareForRender(a,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=a._order.filter(m=>!a._layers[m].isHidden(h)),this._coordsDescendingInv={};for(const m in a.sourceCaches){this._coordsDescendingInv[m]={};const y=a.sourceCaches[m].getVisibleCoordinates();for(const w of y){const S=this.terrain.sourceCache.getTerrainCoords(w);for(const T in S)this._coordsDescendingInv[m][T]||(this._coordsDescendingInv[m][T]=[]),this._coordsDescendingInv[m][T].push(S[T])}}this._coordsDescendingInvStr={};for(const m of a._order){const y=a._layers[m],w=y.source;if(Hs[y.type]&&!this._coordsDescendingInvStr[w]){this._coordsDescendingInvStr[w]={};for(const S in this._coordsDescendingInv[w])this._coordsDescendingInvStr[w][S]=this._coordsDescendingInv[w][S].map(T=>T.key).sort().join()}}for(const m of this._renderableTiles)for(const y in this._coordsDescendingInvStr){const w=this._coordsDescendingInvStr[y][m.tileID.key];w&&w!==m.rttCoords[y]&&(m.rtt=[])}}renderLayer(a){if(a.isHidden(this.painter.transform.zoom))return!1;const h=a.type,m=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===a.id;if(Hs[h]&&(this._prevType&&Hs[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(a.id),!y))return!0;if(Hs[this._prevType]||Hs[h]&&y){this._prevType=h;const w=this._stacks.length-1,S=this._stacks[w]||[];for(const T of this._renderableTiles){if(this.pool.isFull()&&(dd(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[w]){const R=this.pool.getObjectForId(T.rtt[w].id);if(R.stamp===T.rtt[w].stamp){this.pool.useObject(R);continue}}const k=this.pool.getOrCreateFreeObject();this.pool.useObject(k),this.pool.stampObject(k),T.rtt[w]={id:k.id,stamp:k.stamp},m.context.bindFramebuffer.set(k.fbo.framebuffer),m.context.clear({color:b.Color.transparent});for(let R=0;R{g.touchstart=g.dragStart,g.touchmoveWindow=g.dragMove,g.touchend=g.dragEnd},Cd={showCompass:!0,showZoom:!0,visualizePitch:!1};class Gf{constructor(a,h,m=!1){this._clickTolerance=10;const y=a.dragRotate._mouseRotate.getClickTolerance(),w=a.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=md({clickTolerance:y,enable:!0}),this.touchRotate=(({enable:S,clickTolerance:T,bearingDegreesPerPixelMoved:k=.8})=>{const R=new ur;return new Gl({clickTolerance:T,move:(z,L)=>({bearingDelta:(L.x-z.x)*k}),moveStateManager:R,enable:S,assignEvents:wd})})({clickTolerance:y,enable:!0}),this.map=a,m&&(this.mousePitch=Xu({clickTolerance:w,enable:!0}),this.touchPitch=(({enable:S,clickTolerance:T,pitchDegreesPerPixelMoved:k=-.5})=>{const R=new ur;return new Gl({clickTolerance:T,move:(z,L)=>({pitchDelta:(L.y-z.y)*k}),moveStateManager:R,enable:S,assignEvents:wd})})({clickTolerance:w,enable:!0})),b.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Te.addEventListener(h,"mousedown",this.mousedown),Te.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),Te.addEventListener(h,"touchcancel",this.reset)}startMouse(a,h){this.mouseRotate.dragStart(a,h),this.mousePitch&&this.mousePitch.dragStart(a,h),Te.disableDrag()}startTouch(a,h){this.touchRotate.dragStart(a,h),this.touchPitch&&this.touchPitch.dragStart(a,h),Te.disableDrag()}moveMouse(a,h){const m=this.map,{bearingDelta:y}=this.mouseRotate.dragMove(a,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.mousePitch){const{pitchDelta:w}=this.mousePitch.dragMove(a,h)||{};w&&m.setPitch(m.getPitch()+w)}}moveTouch(a,h){const m=this.map,{bearingDelta:y}=this.touchRotate.dragMove(a,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.touchPitch){const{pitchDelta:w}=this.touchPitch.dragMove(a,h)||{};w&&m.setPitch(m.getPitch()+w)}}off(){const a=this.element;Te.removeEventListener(a,"mousedown",this.mousedown),Te.removeEventListener(a,"touchstart",this.touchstart,{passive:!1}),Te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.removeEventListener(window,"touchend",this.touchend),Te.removeEventListener(a,"touchcancel",this.reset),this.offTemp()}offTemp(){Te.enableDrag(),Te.removeEventListener(window,"mousemove",this.mousemove),Te.removeEventListener(window,"mouseup",this.mouseup),Te.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.removeEventListener(window,"touchend",this.touchend)}mousedown(a){this.startMouse(b.extend({},a,{ctrlKey:!0,preventDefault:()=>a.preventDefault()}),Te.mousePos(this.element,a)),Te.addEventListener(window,"mousemove",this.mousemove),Te.addEventListener(window,"mouseup",this.mouseup)}mousemove(a){this.moveMouse(a,Te.mousePos(this.element,a))}mouseup(a){this.mouseRotate.dragEnd(a),this.mousePitch&&this.mousePitch.dragEnd(a),this.offTemp()}touchstart(a){1!==a.targetTouches.length?this.reset():(this._startPos=this._lastPos=Te.touchPos(this.element,a.targetTouches)[0],this.startTouch(a,this._startPos),Te.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Te.addEventListener(window,"touchend",this.touchend))}touchmove(a){1!==a.targetTouches.length?this.reset():(this._lastPos=Te.touchPos(this.element,a.targetTouches)[0],this.moveTouch(a,this._lastPos))}touchend(a){0===a.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const m=h.locationPoint(g);if(m.x>=0&&m.y>=0&&m.x<=h.width&&m.y<=h.height)break;g.lng>h.center.lng?g.lng-=360:g.lng+=360}return g}const qc={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 Dd(g,a,h){const m=g.classList;for(const y in qc)m.remove(`maplibregl-${h}-anchor-${y}`);m.add(`maplibregl-${h}-anchor-${a}`)}class rh extends b.Evented{constructor(a,h){if(super(),(a instanceof HTMLElement||h)&&(a=b.extend({element:a},h)),b.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=a&&a.anchor||"center",this._color=a&&a.color||"#3FB1CE",this._scale=a&&a.scale||1,this._draggable=a&&a.draggable||!1,this._clickTolerance=a&&a.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=a&&a.rotation||0,this._rotationAlignment=a&&a.rotationAlignment||"auto",this._pitchAlignment=a&&a.pitchAlignment&&"auto"!==a.pitchAlignment?a.pitchAlignment:this._rotationAlignment,a&&a.element)this._element=a.element,this._offset=b.pointGeometry.convert(a&&a.offset||[0,0]);else{this._defaultMarker=!0,this._element=Te.create("div"),this._element.setAttribute("aria-label","Map marker");const m=Te.createNS("http://www.w3.org/2000/svg","svg"),y=41,w=27;m.setAttributeNS(null,"display","block"),m.setAttributeNS(null,"height",`${y}px`),m.setAttributeNS(null,"width",`${w}px`),m.setAttributeNS(null,"viewBox",`0 0 ${w} ${y}`);const S=Te.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"stroke","none"),S.setAttributeNS(null,"stroke-width","1"),S.setAttributeNS(null,"fill","none"),S.setAttributeNS(null,"fill-rule","evenodd");const T=Te.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill-rule","nonzero");const k=Te.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"transform","translate(3.0, 29.0)"),k.setAttributeNS(null,"fill","#000000");const R=[{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 ye of R){const ie=Te.createNS("http://www.w3.org/2000/svg","ellipse");ie.setAttributeNS(null,"opacity","0.04"),ie.setAttributeNS(null,"cx","10.5"),ie.setAttributeNS(null,"cy","5.80029008"),ie.setAttributeNS(null,"rx",ye.rx),ie.setAttributeNS(null,"ry",ye.ry),k.appendChild(ie)}const z=Te.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"fill",this._color);const L=Te.createNS("http://www.w3.org/2000/svg","path");L.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"),z.appendChild(L);const j=Te.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"fill","#000000");const Q=Te.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"),j.appendChild(Q);const ee=Te.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ee.setAttributeNS(null,"fill","#FFFFFF");const Y=Te.createNS("http://www.w3.org/2000/svg","g");Y.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ae=Te.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#000000"),ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962");const _e=Te.createNS("http://www.w3.org/2000/svg","circle");_e.setAttributeNS(null,"fill","#FFFFFF"),_e.setAttributeNS(null,"cx","5.5"),_e.setAttributeNS(null,"cy","5.5"),_e.setAttributeNS(null,"r","5.4999962"),Y.appendChild(ae),Y.appendChild(_e),T.appendChild(k),T.appendChild(z),T.appendChild(j),T.appendChild(ee),T.appendChild(Y),m.appendChild(T),m.setAttributeNS(null,"height",y*this._scale+"px"),m.setAttributeNS(null,"width",w*this._scale+"px"),this._element.appendChild(m),this._offset=b.pointGeometry.convert(a&&a.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",m=>{m.preventDefault()}),this._element.addEventListener("mousedown",m=>{m.preventDefault()}),Dd(this._element,this._anchor,"marker"),this._popup=null}addTo(a){return this.remove(),this._map=a,a.getCanvasContainer().appendChild(this._element),a.on("move",this._update),a.on("moveend",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("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),Te.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(a){return this._lngLat=b.LngLat.convert(a),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(a){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),a){if(!("offset"in a.options)){const y=Math.sqrt(Math.pow(13.5,2)/2);a.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[y,-1*(24.6+y)],"bottom-right":[-y,-1*(24.6+y)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=a,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(a){const h=a.code,m=a.charCode||a.keyCode;"Space"!==h&&"Enter"!==h&&32!==m&&13!==m||this.togglePopup()}_onMapClick(a){const h=a.originalEvent.target,m=this._element;this._popup&&(h===m||m.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const a=this._popup;return a?(a.isOpen()?a.remove():a.addTo(this._map),this):this}_update(a){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Ed(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?h=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?m="rotateX(0deg)":"map"===this._pitchAlignment&&(m=`rotateX(${this._map.getPitch()}deg)`),a&&"moveend"!==a.type||(this._pos=this._pos.round()),Te.setTransform(this._element,`${qc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${h}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const y=this._map.unproject(this._pos),w=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=y.distanceTo(this._lngLat)>20*w?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(a){return this._offset=b.pointGeometry.convert(a),this._update(),this}_onMove(a){if(!this._isDragging){const h=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=h}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","pending"===this._state&&(this._state="active",this.fire(new b.Event("dragstart"))),this.fire(new b.Event("drag")))}_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),"active"===this._state&&this.fire(new b.Event("dragend")),this._state="inactive"}_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))}setDraggable(a){return this._draggable=!!a,this._map&&(a?(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(a){return this._rotation=a||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(a){return this._rotationAlignment=a||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(a){return this._pitchAlignment=a&&"auto"!==a?a:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const He={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let en,ma=0,Gs=!1;const Pr={maxWidth:100,unit:"metric"};function ih(g,a,h){const m=h&&h.maxWidth||100,y=g._container.clientHeight/2,w=g.unproject([0,y]),S=g.unproject([m,y]),T=w.distanceTo(S);if(h&&"imperial"===h.unit){const k=3.2808*T;k>5280?qs(a,m,k/5280,g._getUIString("ScaleControl.Miles")):qs(a,m,k,g._getUIString("ScaleControl.Feet"))}else h&&"nautical"===h.unit?qs(a,m,T/1852,g._getUIString("ScaleControl.NauticalMiles")):T>=1e3?qs(a,m,T/1e3,g._getUIString("ScaleControl.Kilometers")):qs(a,m,T,g._getUIString("ScaleControl.Meters"))}function qs(g,a,h,m){const y=function(w){const S=Math.pow(10,`${Math.floor(w)}`.length-1);let T=w/S;return T=T>=10?10:T>=5?5:T>=3?3:T>=2?2:T>=1?1:function(k){const R=Math.pow(10,Math.ceil(-Math.log(k)/Math.LN10));return Math.round(k*R)/R}(T),S*T}(h);g.style.width=a*(y/h)+"px",g.innerHTML=`${y} ${m}`}const ws={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Sd=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function oh(g){if(g){if("number"==typeof g){const a=Math.round(Math.sqrt(.5*Math.pow(g,2)));return{center:new b.pointGeometry(0,0),top:new b.pointGeometry(0,g),"top-left":new b.pointGeometry(a,a),"top-right":new b.pointGeometry(-a,a),bottom:new b.pointGeometry(0,-g),"bottom-left":new b.pointGeometry(a,-a),"bottom-right":new b.pointGeometry(-a,-a),left:new b.pointGeometry(g,0),right:new b.pointGeometry(-g,0)}}if(g instanceof b.pointGeometry||Array.isArray(g)){const a=b.pointGeometry.convert(g);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:b.pointGeometry.convert(g.center||[0,0]),top:b.pointGeometry.convert(g.top||[0,0]),"top-left":b.pointGeometry.convert(g["top-left"]||[0,0]),"top-right":b.pointGeometry.convert(g["top-right"]||[0,0]),bottom:b.pointGeometry.convert(g.bottom||[0,0]),"bottom-left":b.pointGeometry.convert(g["bottom-left"]||[0,0]),"bottom-right":b.pointGeometry.convert(g["bottom-right"]||[0,0]),left:b.pointGeometry.convert(g.left||[0,0]),right:b.pointGeometry.convert(g.right||[0,0])}}return oh(new b.pointGeometry(0,0))}const ga={supported:vr,setRTLTextPlugin:b.setRTLTextPlugin,getRTLTextPluginStatus:b.getRTLTextPluginStatus,Map:class extends Si{constructor(g){var a;if(b.PerformanceUtils.mark(b.PerformanceMarkers.create),null!=(g=b.extend({},nh,g)).minZoom&&null!=g.maxZoom&&g.minZoom>g.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=g.minPitch&&null!=g.maxPitch&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=g.minPitch&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=g.maxPitch&&g.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Er(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies),{bearingSnap:g.bearingSnap}),this._interactive=g.interactive,this._cooperativeGestures=g.cooperativeGestures,this._maxTileCacheSize=g.maxTileCacheSize,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new pa,this._controls=[],this._mapId=b.uniqueId(),this._locale=b.extend({},Mi,g.locale),this._clickTolerance=g.clickTolerance,this._pixelRatio=null!==(a=g.pixelRatio)&&void 0!==a?a:devicePixelRatio,this._imageQueueHandle=ii.addThrottleControl(()=>this.isMoving()),this._requestManager=new kc(g.transformRequest),"string"==typeof g.container){if(this._container=document.getElementById(g.container),!this._container)throw new Error(`Container '${g.container}' not found.`)}else{if(!(g.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}g.maxBounds&&this.setMaxBounds(g.maxBounds),b.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),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)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Qu(this,g),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=g.hash&&new Bf("string"==typeof g.hash&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,b.extend({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new eh({customAttribution:g.customAttribution})),g.maplibreLogo&&this.addControl(new Zl,g.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update("style"===h.dataType),this.fire(new b.Event(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new b.Event(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new b.Event("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(g,a){if(void 0===a&&(a=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=g.onAdd(this);this._controls.push(g);const m=this._controlPositions[a];return-1!==a.indexOf("bottom")?m.insertBefore(h,m.firstChild):m.appendChild(h),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const a=this._controls.indexOf(g);return a>-1&&this._controls.splice(a,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}calculateCameraOptionsFromTo(g,a,h,m){return null==m&&this.terrain&&(m=this.transform.getElevation(h,this.terrain)),super.calculateCameraOptionsFromTo(g,a,h,m)}resize(g){const a=this._containerDimensions(),h=a[0],m=a[1];this._resizeCanvas(h,m,this.getPixelRatio()),this.transform.resize(h,m),this.painter.resize(h,m,this.getPixelRatio());const y=!this._moving;return y&&(this.stop(),this.fire(new b.Event("movestart",g)).fire(new b.Event("move",g))),this.fire(new b.Event("resize",g)),y&&this.fire(new b.Event("moveend",g)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(g){const[a,h]=this._containerDimensions();this._pixelRatio=g,this._resizeCanvas(a,h,g),this.painter.resize(a,h,g)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(b.LngLatBounds.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),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)return this.transform.minPitch=g,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),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.renderWorldCopies=g,this._update()}project(g){return this.transform.locationPoint(b.LngLat.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.pointLocation(b.pointGeometry.convert(g),this.terrain)}isMoving(){var g;return this._moving||(null===(g=this.handlers)||void 0===g?void 0:g.isMoving())}isZooming(){var g;return this._zooming||(null===(g=this.handlers)||void 0===g?void 0:g.isZooming())}isRotating(){var g;return this._rotating||(null===(g=this.handlers)||void 0===g?void 0:g.isRotating())}_createDelegatedListener(g,a,h){if("mouseenter"===g||"mouseover"===g){let m=!1;return{layer:a,listener:h,delegates:{mousemove:w=>{const S=this.getLayer(a)?this.queryRenderedFeatures(w.point,{layers:[a]}):[];S.length?m||(m=!0,h.call(this,new Po(g,this,w.originalEvent,{features:S}))):m=!1},mouseout:()=>{m=!1}}}}if("mouseleave"===g||"mouseout"===g){let m=!1;return{layer:a,listener:h,delegates:{mousemove:S=>{(this.getLayer(a)?this.queryRenderedFeatures(S.point,{layers:[a]}):[]).length?m=!0:m&&(m=!1,h.call(this,new Po(g,this,S.originalEvent)))},mouseout:S=>{m&&(m=!1,h.call(this,new Po(g,this,S.originalEvent)))}}}}{const m=y=>{const w=this.getLayer(a)?this.queryRenderedFeatures(y.point,{layers:[a]}):[];w.length&&(y.features=w,h.call(this,y),delete y.features)};return{layer:a,listener:h,delegates:{[g]:m}}}}on(g,a,h){if(void 0===h)return super.on(g,a);const m=this._createDelegatedListener(g,a,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(m);for(const y in m.delegates)this.on(y,m.delegates[y]);return this}once(g,a,h){if(void 0===h)return super.once(g,a);const m=this._createDelegatedListener(g,a,h);for(const y in m.delegates)this.once(y,m.delegates[y]);return this}off(g,a,h){return void 0===h?super.off(g,a):(this._delegatedListeners&&this._delegatedListeners[g]&&(m=>{const y=this._delegatedListeners[g];for(let w=0;wthis._updateStyle(g,a));const h=this.style&&a.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new Mt(this,a||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof g?this.style.loadURL(g,a,h):this.style.loadJSON(g,a,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Mt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,a){if("string"==typeof g){const h=this._requestManager.transformRequest(g,pn.Style);b.getJSON(h,(m,y)=>{m?this.fire(new b.ErrorEvent(m)):y&&this._updateDiff(y,a)})}else"object"==typeof g&&this._updateDiff(g,a)}_updateDiff(g,a){try{this.style.setState(g,a)&&this._update(!0)}catch(h){b.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(g,a)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():b.warnOnce("There is no style added to the map.")}addSource(g,a){return this._lazyInitEmptyStyle(),this.style.addSource(g,a),this._update(!0)}isSourceLoaded(g){const a=this.style&&this.style.sourceCaches[g];if(void 0!==a)return a.loaded();this.fire(new b.ErrorEvent(new Error(`There is no source with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){const a=this.style.sourceCaches[g.source];if(!a)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);this.terrain=new th(this.painter,a,g),this.painter.renderToTexture=new Xl(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=h=>{"style"===h.dataType?this.terrain.sourceCache.freeRtt():"source"===h.dataType&&h.tile&&(h.sourceId===g.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.updateElevation(this.terrain);return this.fire(new b.Event("terrain",{terrain:g})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const g=this.style&&this.style.sourceCaches;for(const a in g){const h=g[a]._tiles;for(const m in h){const y=h[m];if("loaded"!==y.state&&"errored"!==y.state)return!1}}return!0}addSourceType(g,a,h){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,a,h)}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}addImage(g,a,{pixelRatio:h=1,sdf:m=!1,stretchX:y,stretchY:w,content:S}={}){if(this._lazyInitEmptyStyle(),a instanceof HTMLImageElement||b.isImageBitmap(a)){const{width:T,height:k,data:R}=b.exported.getImageData(a);this.style.addImage(g,{data:new b.RGBAImage({width:T,height:k},R),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0})}else{if(void 0===a.width||void 0===a.height)return this.fire(new b.ErrorEvent(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:T,height:k,data:R}=a,z=a;this.style.addImage(g,{data:new b.RGBAImage({width:T,height:k},new Uint8Array(R)),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0,userImage:z}),z.onAdd&&z.onAdd(this,g)}}}updateImage(g,a){const h=this.style.getImage(g);if(!h)return this.fire(new b.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const m=a instanceof HTMLImageElement||b.isImageBitmap(a)?b.exported.getImageData(a):a,{width:y,height:w,data:S}=m;if(void 0===y||void 0===w)return this.fire(new b.ErrorEvent(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(y!==h.data.width||w!==h.data.height)return this.fire(new b.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const T=!(a instanceof HTMLImageElement||b.isImageBitmap(a));h.data.replace(S,T),this.style.updateImage(g,h)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new b.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g,a){ii.getImage(this._requestManager.transformRequest(g,pn.Image),a)}listImages(){return this.style.listImages()}addLayer(g,a){return this._lazyInitEmptyStyle(),this.style.addLayer(g,a),this._update(!0)}moveLayer(g,a){return this.style.moveLayer(g,a),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}setLayerZoomRange(g,a,h){return this.style.setLayerZoomRange(g,a,h),this._update(!0)}setFilter(g,a,h={}){return this.style.setFilter(g,a,h),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,a,h,m={}){return this.style.setPaintProperty(g,a,h,m),this._update(!0)}getPaintProperty(g,a){return this.style.getPaintProperty(g,a)}setLayoutProperty(g,a,h,m={}){return this.style.setLayoutProperty(g,a,h,m),this._update(!0)}getLayoutProperty(g,a){return this.style.getLayoutProperty(g,a)}setGlyphs(g,a={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,a),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,a,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,a,h,m=>{m||this._update(!0)}),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,a={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,a,h=>{h||this._update(!0)}),this}setLight(g,a={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,a),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(g,a){return this.style.setFeatureState(g,a),this._update()}removeFeatureState(g,a){return this.style.removeFeatureState(g,a),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,a=0;return this._container&&(g=this._container.clientWidth||400,a=this._container.clientHeight||300),[g,a]}_setupContainer(){const g=this._container;g.classList.add("maplibregl-map");const a=this._canvasContainer=Te.create("div","maplibregl-canvas-container",g);this._interactive&&a.classList.add("maplibregl-interactive"),this._canvas=Te.create("canvas","maplibregl-canvas",a),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions();this._resizeCanvas(h[0],h[1],this.getPixelRatio());const m=this._controlContainer=Te.create("div","maplibregl-control-container",g),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(w=>{y[w]=Te.create("div",`maplibregl-ctrl-${w} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const g=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=Te.create("div","maplibregl-cooperative-gesture-screen",g);let a="Control",h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",a="Meta"),this._cooperativeGesturesScreen.innerHTML=`\n
${h}
\n
${"boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
\n `,document.addEventListener("keydown",m=>{m.key===a&&(this._metaPress=!0)}),document.addEventListener("keyup",m=>{m.key===a&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",m=>{this._onCooperativeGesture(m,this._metaPress,1)},!1),this._canvasContainer.classList.remove("maplibregl-touch-drag-pan")}_resizeCanvas(g,a,h){this._canvas.width=h*g,this._canvas.height=h*a,this._canvas.style.width=`${g}px`,this._canvas.style.height=`${a}px`}_setupPainter(){const g=b.extend({},vr.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1});let a=null;this._canvas.addEventListener("webglcontextcreationerror",m=>{a={requestedAttributes:g},m&&(a.statusMessage=m.statusMessage,a.type=m.type)},{once:!0});const h=this._canvas.getContext("webgl",g)||this._canvas.getContext("experimental-webgl",g);if(!h){const m="Failed to initialize WebGL";throw a?(a.message=m,new Error(JSON.stringify(a))):new Error(m)}this.painter=new _s(h,this.transform),zi.testSupport(h)}_contextLost(g){g.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new b.Event("webglcontextlost",{originalEvent:g}))}_contextRestored(g){this._setupPainter(),this.resize(),this._update(),this.fire(new b.Event("webglcontextrestored",{originalEvent:g}))}_onMapScroll(g){if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(g,a,h){return!a&&h<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style?(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){let a,h=0;const m=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(a=m.createQueryEXT(),m.beginQueryEXT(m.TIME_ELAPSED_EXT,a),h=b.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let y=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,T=b.exported.now();this.style.zoomHistory.update(S,T);const k=new b.EvaluationParameters(S,{now:T,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=k.crossFadingFactor();1===R&&R===this._crossFadingFactor||(y=!0,this._crossFadingFactor=R),this.style.update(k)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._imageQueueDirty=ii.processQueue()>0,this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new b.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.load),this.fire(new b.Event("load"))),this.style&&(this.style.hasTransitions()||y)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const S=b.exported.now()-h;m.endQueryEXT(m.TIME_ELAPSED_EXT,a),setTimeout(()=>{const T=m.getQueryObjectEXT(a,m.QUERY_RESULT_EXT)/1e6;m.deleteQueryEXT(a),this.fire(new b.Event("gpu-timing-frame",{cpuTime:S,gpuTime:T}))},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const T=this.painter.queryGpuTimers(S);this.fire(new b.Event("gpu-timing-layer",{layerTimes:T}))},50)}const w=this._sourcesDirty||this._styleDirty||this._placementDirty||this._imageQueueDirty;return w||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new b.Event("idle")),!this._loaded||this._fullyLoaded||w||(this._fullyLoaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const a of this._controls)a.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1)),ii.removeThrottleControl(this._imageQueueHandle);const g=this.painter.context.gl.getExtension("WEBGL_lose_context");g&&g.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Te.remove(this._canvasContainer),Te.remove(this._controlContainer),this._cooperativeGestures&&Te.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map"),b.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new b.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=b.exported.frame(g=>{b.PerformanceUtils.frame(g),this._frame=null,this._render(g)}))}_onWindowOnline(){this._update()}_onWindowResize(g){this._trackResize&&this.resize({originalEvent:g})._update()}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"3.0.0-pre.4"}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(g){this.options=b.extend({},Cd,g),this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",a=>a.preventDefault()),this.options.showZoom&&(b.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",a=>this._map.zoomIn({},{originalEvent:a})),Te.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",a=>this._map.zoomOut({},{originalEvent:a})),Te.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(b.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",a=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:a}):this._map.resetNorth({},{originalEvent:a})}),this._compassIcon=Te.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const g=this._map.getZoom(),a=g===this._map.getMaxZoom(),h=g===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const g=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=g}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._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Gf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Te.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._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(g,a){const h=Te.create("button",g,this._container);return h.type="button",h.addEventListener("click",a),h}_setButtonTitle(g,a){const h=this._map._getUIString(`NavigationControl.${a}`);g.title=h,g.setAttribute("aria-label",h)}},GeolocateControl:class extends b.Evented{constructor(g){super(),this.options=b.extend({},He,g),b.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(g){var a;return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),a=this._setupUI,void 0!==en?a(en):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then(h=>{en="denied"!==h.state,a(en)}):(en=!!window.navigator.geolocation,a(en)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),Te.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ma=0,Gs=!1}_isOutOfMapMaxBounds(g){const a=this._map.getMaxBounds(),h=g.coords;return a&&(h.longitudea.getEast()||h.latitudea.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(g){if(this._map){if(this._isOutOfMapMaxBounds(g))return this._setErrorState(),this.fire(new b.Event("outofmaxbounds",g)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=g,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(g),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(g),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new b.Event("geolocate",g)),this._finish()}}_updateCamera(g){const a=new b.LngLat(g.coords.longitude,g.coords.latitude),h=g.coords.accuracy,m=this._map.getBearing(),y=b.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(h),y,{geolocateSource:!0})}_updateMarker(g){if(g){const a=new b.LngLat(g.coords.longitude,g.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=g.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const g=this._map._container.clientHeight/2,a=this._map.unproject([0,g]),h=this._map.unproject([1,g]),m=a.distanceTo(h),y=Math.ceil(2*this._accuracy/m);this._circleElement.style.width=`${y}px`,this._circleElement.style.height=`${y}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(g){if(this._map){if(this.options.trackUserLocation)if(1===g.code){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),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===g.code&&Gs)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new b.Event("error",g)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(g){if(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=Te.create("button","maplibregl-ctrl-geolocate",this._container),Te.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===g){b.warnOnce("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.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=Te.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rh(this._dotElement),this._circleElement=Te.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rh({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",a=>{a.geolocateSource||"ACTIVE_LOCK"!==this._watchState||a.originalEvent&&"resize"===a.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new b.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return b.warnOnce("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 b.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ma--,Gs=!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 b.Event("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 b.Event("trackuserlocationstart"));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("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ma++,ma>1?(g={maximumAge:6e5,timeout:0},Gs=!0):(g=this.options.positionOptions,Gs=!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)}},AttributionControl:eh,LogoControl:Zl,ScaleControl:class{constructor(g){this.options=b.extend({},Pr,g),b.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){ih(this._map,this._container,this.options)}onAdd(g){return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Te.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(g){this.options.unit=g,ih(this._map,this._container,this.options)}},FullscreenControl:class extends b.Evented{constructor(g={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===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:b.warnOnce("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=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Te.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const g=this._fullscreenButton=Te.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Te.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.fire(new b.Event(this._fullscreen?"fullscreenstart":"fullscreenend"))}_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()}},TerrainControl:class{constructor(g){this.options=g,b.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(g){return this._map=g,this._container=Te.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Te.create("button","maplibregl-ctrl-terrain",this._container),Te.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(){Te.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends b.Evented{constructor(g){super(),this.options=b.extend(Object.create(ws),g),b.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}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 b.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Te.remove(this._content),this._container&&(Te.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),delete this._map),this.fire(new b.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=b.LngLat.convert(g),this._pos=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._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 a=document.createDocumentFragment(),h=document.createElement("body");let m;for(h.innerHTML=g;m=h.firstChild,m;)a.appendChild(m);return this.setDOMContent(a)}getMaxWidth(){return this._container&&this._container.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=Te.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){this._container&&this._container.classList.add(g)}removeClassName(g){this._container&&this._container.classList.remove(g)}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Te.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(g){this._update(g.point)}_onMouseMove(g){this._update(g.point)}_onDrag(g){this._update(g.point)}_update(g){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Te.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Te.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(w=>this._container.classList.add(w)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ed(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!g))return;const a=this._pos=this._trackPointer&&g?g:this._map.project(this._lngLat);let h=this.options.anchor;const m=oh(this.options.offset);if(!h){const w=this._container.offsetWidth,S=this._container.offsetHeight;let T;T=a.y+m.bottom.ythis._map.transform.height-S?["bottom"]:[],a.xthis._map.transform.width-w/2&&T.push("right"),h=0===T.length?"bottom":T.join("-")}const y=a.add(m[h]).round();Te.setTransform(this._container,`${qc[h]} translate(${y.x}px,${y.y}px)`),Dd(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const g=this._container.querySelector(Sd);g&&g.focus()}_onClose(){this.remove()}},Marker:rh,Style:Mt,LngLat:b.LngLat,LngLatBounds:b.LngLatBounds,Point:b.pointGeometry,MercatorCoordinate:b.MercatorCoordinate,Evented:b.Evented,AJAXError:b.AJAXError,config:b.config,CanvasSource:Vi,GeoJSONSource:za,ImageSource:Vn,RasterDEMTileSource:Pe,RasterTileSource:Qn,VectorTileSource:yr,VideoSource:ps,prewarm:function(){Fc().acquire(ia)},clearPrewarmedResources:function(){const g=zn;g&&(g.isPreloaded()&&1===g.numActive()?(g.release(ia),zn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"3.0.0-pre.4"},get workerCount(){return ao.workerCount},set workerCount(g){ao.workerCount=g},get maxParallelImageRequests(){return b.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(g){b.config.MAX_PARALLEL_IMAGE_REQUESTS=g},workerUrl:"",addProtocol(g,a){b.config.REGISTERED_PROTOCOLS[g]=a},removeProtocol(g){delete b.config.REGISTERED_PROTOCOLS[g]}};return ql.extend(ga,{isSafari:b.isSafari,getPerformanceMetrics:b.PerformanceUtils.getPerformanceMetrics}),ga}),sr}()}},Vm=>{Vm(Vm.s=418)}]); \ No newline at end of file diff --git a/frontend/dist/frontend/main.7cabd03da8ea8709.js b/frontend/dist/frontend/main.7cabd03da8ea8709.js deleted file mode 100644 index e750694..0000000 --- a/frontend/dist/frontend/main.7cabd03da8ea8709.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[179],{751:(Lm,Au,ku)=>{"use strict";function ar(e){return"function"==typeof e}function qh(e){const n=e(r=>{Error.call(r),r.stack=(new Error).stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}const Nm=qh(e=>function(n){e(this),this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=n});function b(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class wr{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(const a of n)a.remove(this);else n.remove(this);const{initialTeardown:r}=this;if(ar(r))try{r()}catch(a){t=a instanceof Nm?a.errors:[a]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const a of i)try{Il(a)}catch(c){t=t??[],c instanceof Nm?t=[...t,...c.errors]:t.push(c)}}if(t)throw new Nm(t)}}add(t){var n;if(t&&t!==this)if(this.closed)Il(t);else{if(t instanceof wr){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}}_hasParent(t){const{_parentage:n}=this;return n===t||Array.isArray(n)&&n.includes(t)}_addParent(t){const{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t}_removeParent(t){const{_parentage:n}=this;n===t?this._parentage=null:Array.isArray(n)&&b(n,t)}remove(t){const{_finalizers:n}=this;n&&b(n,t),t instanceof wr&&t._removeParent(this)}}wr.EMPTY=(()=>{const e=new wr;return e.closed=!0,e})();const ks=wr.EMPTY;function us(e){return e instanceof wr||e&&"closed"in e&&ar(e.remove)&&ar(e.add)&&ar(e.unsubscribe)}function Il(e){ar(e)?e():e.unsubscribe()}const Zt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ie={setTimeout(e,t,...n){const{delegate:r}=Ie;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=Ie;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Bi(e){Ie.setTimeout(()=>{const{onUnhandledError:t}=Zt;if(!t)throw e;t(e)})}function Ps(){}const Rs=Ci("C",void 0,void 0);function Ci(e,t,n){return{kind:e,value:t,error:n}}let io=null;function fn(e){if(Zt.useDeprecatedSynchronousErrorHandling){const t=!io;if(t&&(io={errorThrown:!1,error:null}),e(),t){const{errorThrown:n,error:r}=io;if(io=null,n)throw r}}else e()}class kc extends wr{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,us(t)&&t.add(this)):this.destination=Pu}static create(t,n,r){return new oo(t,n,r)}next(t){this.isStopped?Gn(function Al(e){return Ci("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Gn(function Pa(e){return Ci("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Gn(Rs,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const To=Function.prototype.bind;function ta(e,t){return To.call(e,t)}class Fs{constructor(t){this.partialObserver=t}next(t){const{partialObserver:n}=this;if(n.next)try{n.next(t)}catch(r){Ra(r)}}error(t){const{partialObserver:n}=this;if(n.error)try{n.error(t)}catch(r){Ra(r)}else Ra(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(n){Ra(n)}}}class oo extends kc{constructor(t,n,r){let i;if(super(),ar(t)||!t)i={next:t??void 0,error:n??void 0,complete:r??void 0};else{let a;this&&Zt.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&ta(t.next,a),error:t.error&&ta(t.error,a),complete:t.complete&&ta(t.complete,a)}):i=t}this.destination=new Fs(i)}}function Ra(e){Zt.useDeprecatedSynchronousErrorHandling?function si(e){Zt.useDeprecatedSynchronousErrorHandling&&io&&(io.errorThrown=!0,io.error=e)}(e):Bi(e)}function Gn(e,t){const{onStoppedNotification:n}=Zt;n&&Ie.setTimeout(()=>n(e,t))}const Pu={closed:!0,next:Ps,error:function hs(e){throw e},complete:Ps},It="function"==typeof Symbol&&Symbol.observable||"@@observable";function Wr(e){return e}function Os(e){return 0===e.length?Wr:1===e.length?e[0]:function(n){return e.reduce((r,i)=>i(r),n)}}let Bn=(()=>{class e{constructor(n){n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,i){const a=function Oa(e){return e&&e instanceof kc||function kl(e){return e&&ar(e.next)&&ar(e.error)&&ar(e.complete)}(e)&&us(e)}(n)?n:new oo(n,r,i);return fn(()=>{const{operator:c,source:d}=this;a.add(c?c.call(a,d):d?this._subscribe(a):this._trySubscribe(a))}),a}_trySubscribe(n){try{return this._subscribe(n)}catch(r){n.error(r)}}forEach(n,r){return new(r=Pc(r))((i,a)=>{const c=new oo({next:d=>{try{n(d)}catch(p){a(p),c.unsubscribe()}},error:a,complete:i});this.subscribe(c)})}_subscribe(n){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(n)}[It](){return this}pipe(...n){return Os(n)(this)}toPromise(n){return new(n=Pc(n))((r,i)=>{let a;this.subscribe(c=>a=c,c=>i(c),()=>r(a))})}}return e.create=t=>new e(t),e})();function Pc(e){var t;return null!==(t=e??Zt.Promise)&&void 0!==t?t:Promise}const Rc=qh(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let pi=(()=>{class e extends Bn{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){const r=new La(this,this);return r.operator=n,r}_throwIfClosed(){if(this.closed)throw new Rc}next(n){fn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(n)}})}error(n){fn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;const{observers:r}=this;for(;r.length;)r.shift().error(n)}})}complete(){fn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return(null===(n=this.observers)||void 0===n?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){const{hasError:r,isStopped:i,observers:a}=this;return r||i?ks:(this.currentObservers=null,a.push(n),new wr(()=>{this.currentObservers=null,b(a,n)}))}_checkFinalizedStatuses(n){const{hasError:r,thrownError:i,isStopped:a}=this;r?n.error(i):a&&n.complete()}asObservable(){const n=new Bn;return n.source=this,n}}return e.create=(t,n)=>new La(t,n),e})();class La extends pi{constructor(t,n){super(),this.destination=t,this.source=n}next(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.next)||void 0===r||r.call(n,t)}error(t){var n,r;null===(r=null===(n=this.destination)||void 0===n?void 0:n.error)||void 0===r||r.call(n,t)}complete(){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===n||n.call(t)}_subscribe(t){var n,r;return null!==(r=null===(n=this.source)||void 0===n?void 0:n.subscribe(t))&&void 0!==r?r:ks}}function na(e){return ar(e?.lift)}function yr(e){return t=>{if(na(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function tr(e,t,n,r,i){return new Ae(e,t,n,r,i)}class Ae extends kc{constructor(t,n,r,i,a,c){super(t),this.onFinalize=a,this.shouldUnsubscribe=c,this._next=n?function(d){try{n(d)}catch(p){t.error(p)}}:super._next,this._error=i?function(d){try{i(d)}catch(p){t.error(p)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(d){t.error(d)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:n}=this;super.unsubscribe(),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Pe(e,t){return yr((n,r)=>{let i=0;n.subscribe(tr(r,a=>{r.next(e.call(t,a,i++))}))})}function lo(e){return this instanceof lo?(this.v=e,this):new lo(e)}function Rl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(T){r[T]&&(i[T]=function(P){return new Promise(function(N,G){a.push([T,P,N,G])>1||d(T,P)})})}function d(T,P){try{!function p(T){T.value instanceof lo?Promise.resolve(T.value.v).then(v,E):D(a[0][2],T)}(r[T](P))}catch(N){D(a[0][3],N)}}function v(T){d("next",T)}function E(T){d("throw",T)}function D(T,P){T(P),a.shift(),a.length&&d(a[0][0],a[0][1])}}function ia(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function ra(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(c){return new Promise(function(d,p){!function i(a,c,d,p){Promise.resolve(p).then(function(v){a({value:v,done:d})},c)}(d,p,(c=e[a](c)).done,c.value)})}}}const co=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function Xr(e){return ar(e?.then)}function $r(e){return ar(e[It])}function mi(e){return Symbol.asyncIterator&&ar(e?.[Symbol.asyncIterator])}function gi(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const J=function Ns(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function V(e){return ar(e?.[J])}function $(e){return Rl(this,arguments,function*(){const n=e.getReader();try{for(;;){const{value:r,done:i}=yield lo(n.read());if(i)return yield lo(void 0);yield yield lo(r)}}finally{n.releaseLock()}})}function K(e){return ar(e?.getReader)}function te(e){if(e instanceof Bn)return e;if(null!=e){if($r(e))return function ce(e){return new Bn(t=>{const n=e[It]();if(ar(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(co(e))return function ge(e){return new Bn(t=>{for(let n=0;n{e.then(n=>{t.closed||(t.next(n),t.complete())},n=>t.error(n)).then(null,Bi)})}(e);if(mi(e))return xe(e);if(V(e))return function ue(e){return new Bn(t=>{for(const n of e)if(t.next(n),t.closed)return;t.complete()})}(e);if(K(e))return function Me(e){return xe($(e))}(e)}throw gi(e)}function xe(e){return new Bn(t=>{(function je(e,t){var n,r,i,a;return function ps(e,t,n,r){return new(n||(n=Promise))(function(a,c){function d(E){try{v(r.next(E))}catch(D){c(D)}}function p(E){try{v(r.throw(E))}catch(D){c(D)}}function v(E){E.done?a(E.value):function i(a){return a instanceof n?a:new n(function(c){c(a)})}(E.value).then(d,p)}v((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(n=ia(e);!(r=yield n.next()).done;)if(t.next(r.value),t.closed)return}catch(c){i={error:c}}finally{try{r&&!r.done&&(a=n.return)&&(yield a.call(n))}finally{if(i)throw i.error}}t.complete()})})(e,t).catch(n=>t.error(n))})}function Te(e,t,n,r=0,i=!1){const a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function ht(e,t,n=1/0){return ar(t)?ht((r,i)=>Pe((a,c)=>t(r,a,i,c))(te(e(r,i))),n):("number"==typeof t&&(n=t),yr((r,i)=>function Dt(e,t,n,r,i,a,c,d){const p=[];let v=0,E=0,D=!1;const T=()=>{D&&!p.length&&!v&&t.complete()},P=G=>v{a&&t.next(G),v++;let U=!1;te(n(G,E++)).subscribe(tr(t,Z=>{i?.(Z),a?P(Z):t.next(Z)},()=>{U=!0},void 0,()=>{if(U)try{for(v--;p.length&&vN(Z)):N(Z)}T()}catch(Z){t.error(Z)}}))};return e.subscribe(tr(t,P,()=>{D=!0,T()})),()=>{d?.()}}(r,i,e,n)))}function dt(e=1/0){return ht(Wr,e)}const xt=new Bn(e=>e.complete());function an(e){return e[e.length-1]}function lr(e){return function sn(e){return e&&ar(e.schedule)}(an(e))?e.pop():void 0}function Pr(e,t=0){return yr((n,r)=>{n.subscribe(tr(r,i=>Te(r,e,()=>r.next(i),t),()=>Te(r,e,()=>r.complete(),t),i=>Te(r,e,()=>r.error(i),t)))})}function Va(e,t=0){return yr((n,r)=>{r.add(e.schedule(()=>n.subscribe(r),t))})}function $a(e,t){if(!e)throw new Error("Iterable cannot be null");return new Bn(n=>{Te(n,t,()=>{const r=e[Symbol.asyncIterator]();Te(n,t,()=>{r.next().then(i=>{i.done?n.complete():n.next(i.value)})},0,!0)})})}function Cr(e,t){return t?function Ou(e,t){if(null!=e){if($r(e))return function kf(e,t){return te(e).pipe(Va(t),Pr(t))}(e,t);if(co(e))return function Ua(e,t){return new Bn(n=>{let r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(Xr(e))return function Pf(e,t){return te(e).pipe(Va(t),Pr(t))}(e,t);if(mi(e))return $a(e,t);if(V(e))return function Fu(e,t){return new Bn(n=>{let r;return Te(n,t,()=>{r=e[J](),Te(n,t,()=>{let i,a;try{({value:i,done:a}=r.next())}catch(c){return void n.error(c)}a?n.complete():n.next(i)},0,!0)}),()=>ar(r?.return)&&r.return()})}(e,t);if(K(e))return function sa(e,t){return $a($(e),t)}(e,t)}throw gi(e)}(e,t):te(e)}function Ll(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new oo({next:()=>{r.unsubscribe(),e()}});return t(...n).subscribe(r)}function zn(e){for(let t in e)if(e[t]===zn)return t;throw Error("Could not find renamed property on target object.")}function Mn(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Mn).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Lu(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Rf=zn({__forward_ref__:zn});function Jn(e){return e.__forward_ref__=Jn,e.toString=function(){return Mn(this())},e}function Mt(e){return function Nl(e){return"function"==typeof e&&e.hasOwnProperty(Rf)&&e.__forward_ref__===Jn}(e)?e():e}class nt extends Error{constructor(t,n){super(function wn(e,t){return`NG0${Math.abs(e)}${t?": "+t.trim():""}`}(t,n)),this.code=t}}function $t(e){return"string"==typeof e?e:null==e?"":String(e)}function Nu(e,t){throw new nt(-201,!1)}function ji(e,t){null==e&&function Rn(e,t,n,r){throw new Error(`ASSERTION ERROR: ${e}`+(null==r?"":` [Expected=> ${n} ${r} ${t} <=Actual]`))}(t,e,null,"!=")}function zt(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Di(e){return{providers:e.providers||[],imports:e.imports||[]}}function Uu(e){return Nc(e,mn)||Nc(e,ju)}function Nc(e,t){return e.hasOwnProperty(t)?e[t]:null}function ja(e){return e&&(e.hasOwnProperty($u)||e.hasOwnProperty(Ha))?e[$u]:null}const mn=zn({\u0275prov:zn}),$u=zn({\u0275inj:zn}),ju=zn({ngInjectableDef:zn}),Ha=zn({ngInjectorDef:zn});var Rt=(()=>((Rt=Rt||{})[Rt.Default=0]="Default",Rt[Rt.Host=1]="Host",Rt[Rt.Self=2]="Self",Rt[Rt.SkipSelf=4]="SkipSelf",Rt[Rt.Optional=8]="Optional",Rt))();let aa;function uo(e){const t=aa;return aa=e,t}function Hu(e,t,n){const r=Uu(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&Rt.Optional?null:void 0!==t?t:void Nu(Mn(e))}function Wo(e){return{toString:e}.toString()}var Xo=(()=>((Xo=Xo||{})[Xo.OnPush=0]="OnPush",Xo[Xo.Default=1]="Default",Xo))(),ms=(()=>{return(e=ms||(ms={}))[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",ms;var e})();const nr=(()=>typeof globalThis<"u"&&globalThis||typeof global<"u"&&global||typeof window<"u"&&window||typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self)(),la={},Cn=[],Ga=zn({\u0275cmp:zn}),zc=zn({\u0275dir:zn}),Bc=zn({\u0275pipe:zn}),rd=zn({\u0275mod:zn}),Ao=zn({\u0275fac:zn}),ca=zn({__NG_ELEMENT_ID__:zn});let ko=0;function zs(e){return Wo(()=>{const n=!0===e.standalone,r={},i={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:r,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===Xo.OnPush,directiveDefs:null,pipeDefs:null,standalone:n,dependencies:n&&e.dependencies||null,getStandaloneInjector:null,selectors:e.selectors||Cn,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||ms.Emulated,id:"c"+ko++,styles:e.styles||Cn,_:null,setInput:null,schemas:e.schemas||null,tView:null},a=e.dependencies,c=e.features;return i.inputs=zf(e.inputs,r),i.outputs=zf(e.outputs),c&&c.forEach(d=>d(i)),i.directiveDefs=a?()=>("function"==typeof a?a():a).map(od).filter(qa):null,i.pipeDefs=a?()=>("function"==typeof a?a():a).map(kt).filter(qa):null,i})}function od(e){return Lt(e)||Kr(e)}function qa(e){return null!==e}function li(e){return Wo(()=>({type:e.type,bootstrap:e.bootstrap||Cn,declarations:e.declarations||Cn,imports:e.imports||Cn,exports:e.exports||Cn,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function zf(e,t){if(null==e)return la;const n={};for(const r in e)if(e.hasOwnProperty(r)){let i=e[r],a=i;Array.isArray(i)&&(a=i[1],i=i[0]),n[i]=r,t&&(t[i]=a)}return n}const Ot=zs;function Hi(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function Lt(e){return e[Ga]||null}function Kr(e){return e[zc]||null}function kt(e){return e[Bc]||null}function cn(e,t){const n=e[rd]||null;if(!n&&!0===t)throw new Error(`Type ${Mn(e)} does not have '\u0275mod' property.`);return n}function Xe(e){return Array.isArray(e)&&"object"==typeof e[1]}function po(e){return Array.isArray(e)&&!0===e[1]}function ld(e){return 0!=(8&e.flags)}function Zu(e){return 2==(2&e.flags)}function Vl(e){return 1==(1&e.flags)}function Po(e){return null!==e.template}function Uc(e){return 0!=(256&e[2])}function _s(e,t){return e.hasOwnProperty(Ao)?e[Ao]:null}class wt{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function yt(){return Ja}function Ja(e){return e.type.prototype.ngOnChanges&&(e.setInput=pd),fd}function fd(){const e=jc(this),t=e?.current;if(t){const n=e.previous;if(n===la)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function pd(e,t,n,r){const i=jc(e)||function Ko(e,t){return e[Si]=t}(e,{previous:la,current:null}),a=i.current||(i.current={}),c=i.previous,d=this.declaredInputs[n],p=c[d];a[d]=new wt(p&&p.currentValue,t,c===la),e[r]=t}yt.ngInherit=!0;const Si="__ngSimpleChanges__";function jc(e){return e[Si]||null}function Sr(e){for(;Array.isArray(e);)e=e[0];return e}function Mi(e,t){return Sr(t[e.index])}function Hl(e,t){return e.data[t]}function Ti(e,t){const n=t[e];return Xe(n)?n:n[0]}function Gl(e){return 64==(64&e[2])}function vs(e,t){return null==t?null:e[t]}function $s(e){e[18]=0}function ql(e,t){e[5]+=t;let n=e,r=e[3];for(;null!==r&&(1===t&&1===n[5]||-1===t&&0===n[5]);)r[5]+=t,n=r,r=r[3]}const Vt={lFrame:ie(null),bindingsEnabled:!0};function qc(){return Vt.bindingsEnabled}function He(){return Vt.lFrame.lView}function en(){return Vt.lFrame.tView}function Rr(){let e=ih();for(;null!==e&&64===e.type;)e=e.parent;return e}function ih(){return Vt.lFrame.currentTNode}function bs(e,t){const n=Vt.lFrame;n.currentTNode=e,n.isParent=t}function xd(){return Vt.lFrame.isParent}function h(){const e=Vt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function w(){return Vt.lFrame.bindingIndex++}function R(e,t){const n=Vt.lFrame;n.bindingIndex=n.bindingRootIndex=e,L(t)}function L(e){Vt.lFrame.currentDirectiveIndex=e}function Q(){return Vt.lFrame.currentQueryIndex}function ee(e){Vt.lFrame.currentQueryIndex=e}function Y(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function ae(e,t,n){if(n&Rt.SkipSelf){let i=t,a=e;for(;!(i=i.parent,null!==i||n&Rt.Host||(i=Y(a),null===i||(a=a[15],10&i.type))););if(null===i)return!1;t=i,e=a}const r=Vt.lFrame=ye();return r.currentTNode=t,r.lView=e,!0}function _e(e){const t=ye(),n=e[1];Vt.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function ye(){const e=Vt.lFrame,t=null===e?null:e.child;return null===t?ie(e):t}function ie(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function we(){const e=Vt.lFrame;return Vt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const De=we;function Se(){const e=we();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Le(){return Vt.lFrame.selectedIndex}function Ne(e){Vt.lFrame.selectedIndex=e}function Ht(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[p]<0&&(e[18]+=65536),(d>11>16&&(3&e[2])===t){e[2]+=2048;try{a.call(d)}finally{}}}else try{a.call(d)}finally{}}class ci{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Jr(e,t,n){let r=0;for(;rt){c=a-1;break}}}for(;a>16}(e),r=t;for(;n>0;)r=r[15],n--;return r}let wd=!0;function Mr(e){const t=wd;return wd=e,t}let Cd=0;const ga={};function lh(e,t){const n=Gm(e,t);if(-1!==n)return n;const r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,Wf(r.data,e),Wf(t,null),Wf(r.blueprint,null));const i=ch(e,t),a=e.injectorIndex;if(ma(i)){const c=Hs(i),d=xs(i,t),p=d[1].data;for(let v=0;v<8;v++)t[a+v]=d[c+v]|p[c+v]}return t[a+8]=i,a}function Wf(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Gm(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function ch(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;null!==i;){if(r=P_(i),null===r)return-1;if(n++,i=i[15],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return-1}function Ed(e,t,n){!function Zf(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(ca)&&(r=n[ca]),null==r&&(r=n[ca]=Cd++);const i=255&r;t.data[e+(i>>5)]|=1<=0?255&t:Gx:t}(n);if("function"==typeof a){if(!ae(t,e,r))return r&Rt.Host?uh(i,0,r):Lo(t,n,r,i);try{const c=a(r);if(null!=c||r&Rt.Optional)return c;Nu()}finally{De()}}else if("number"==typeof a){let c=null,d=Gm(e,t),p=-1,v=r&Rt.Host?t[16][6]:null;for((-1===d||r&Rt.SkipSelf)&&(p=-1===d?ch(e,t):t[d+8],-1!==p&&Xl(r,!1)?(c=t[1],d=Hs(p),t=xs(p,t)):d=-1);-1!==d;){const E=t[1];if(Wm(a,d,E.data)){const D=Hx(d,t,n,c,r,v);if(D!==ga)return D}p=t[d+8],-1!==p&&Xl(r,t[1].data[d+8]===v)&&Wm(a,d,t)?(c=E,d=Hs(p),t=xs(p,t)):d=-1}}return i}function Hx(e,t,n,r,i,a){const c=t[1],d=c.data[e+8],E=Xf(d,c,n,null==r?Zu(d)&&wd:r!=c&&0!=(3&d.type),i&Rt.Host&&a===d);return null!==E?nl(t,c,E,d):ga}function Xf(e,t,n,r,i){const a=e.providerIndexes,c=t.data,d=1048575&a,p=e.directiveStart,E=a>>20,T=i?d+E:e.directiveEnd;for(let P=r?d:d+E;P=p&&N.type===n)return P}if(i){const P=c[p];if(P&&Po(P)&&P.type===n)return p}return null}function nl(e,t,n,r){let i=e[n];const a=t.data;if(function Ii(e){return e instanceof ci}(i)){const c=i;c.resolving&&function Wh(e,t){const n=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new nt(-200,`Circular dependency in DI detected for ${e}${n}`)}(function gn(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():$t(e)}(a[n]));const d=Mr(c.canSeeViewProviders);c.resolving=!0;const p=c.injectImpl?uo(c.injectImpl):null;ae(e,r,Rt.Default);try{i=e[n]=c.factory(void 0,a,e,r),t.firstCreatePass&&n>=r.directiveStart&&function An(e,t,n){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:a}=t.type.prototype;if(r){const c=Ja(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,c),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,c)}i&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,i),a&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,a),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,a))}(n,a[n],t)}finally{null!==p&&uo(p),Mr(d),c.resolving=!1,De()}}return i}function Wm(e,t,n){return!!(n[t+(e>>5)]&1<{const r=function Ym(e){return function(...n){if(e){const r=e(...n);for(const i in r)this[i]=r[i]}}}(t);function i(...a){if(this instanceof i)return r.apply(this,a),this;const c=new i(...a);return d.annotation=c,d;function d(p,v,E){const D=p.hasOwnProperty(Yl)?p[Yl]:Object.defineProperty(p,Yl,{value:[]})[Yl];for(;D.length<=E;)D.push(null);return(D[E]=D[E]||[]).push(c),p}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i})}class Tt{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=zt({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function _o(e,t){void 0===t&&(t=e);for(let n=0;nArray.isArray(n)?rl(n,t):t(n))}function N_(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function ep(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}const il={},np="__NG_DI_FLAG__",rp="ngTempTokenPath",r1=/\n/gm,U_="__source";let Pd;function Xc(e){const t=Pd;return Pd=e,t}function ig(e,t=Rt.Default){if(void 0===Pd)throw new nt(-203,!1);return null===Pd?Hu(e,void 0,t):Pd.get(e,t&Rt.Optional?null:void 0,t)}function St(e,t=Rt.Default){return(function Bl(){return aa}()||ig)(Mt(e),t)}function Or(e,t=Rt.Default){return"number"!=typeof t&&(t=0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)),St(e,t)}function ip(e){const t=[];for(let n=0;n((Yi=Yi||{})[Yi.Important=1]="Important",Yi[Yi.DashCase=2]="DashCase",Yi))();const cp=new Map;let Jl=0;const hp="__ngContext__";function hi(e,t){Xe(t)?(e[hp]=t[20],function Y_(e){cp.set(e[20],e)}(t)):e[hp]=t}function bg(e,t){return undefined(e,t)}function Vd(e){const t=e[3];return po(t)?t[3]:t}function _h(e){return nv(e[13])}function Ud(e){return nv(e[4])}function nv(e){for(;null!==e&&!po(e);)e=e[4];return e}function ec(e,t,n,r,i){if(null!=r){let a,c=!1;po(r)?a=r:Xe(r)&&(c=!0,r=r[0]);const d=Sr(r);0===e&&null!==n?null==i?Sg(t,n,d):rc(t,n,d,i||null,!0):1===e&&null!==n?rc(t,n,d,i||null,!0):2===e?function Gd(e,t,n){const r=vh(e,t);r&&function yp(e,t,n,r){e.removeChild(t,n,r)}(e,r,t,n)}(t,d,c):3===e&&t.destroyNode(d),null!=a&&function T1(e,t,n,r,i){const a=n[7];a!==Sr(n)&&ec(t,e,r,a,i);for(let d=10;d0&&(e[n-1][4]=r[4]);const a=ep(e,10+t);!function mp(e,t){sl(e,t,t[11],2,null,null),t[0]=null,t[6]=null}(r[1],r);const c=a[19];null!==c&&c.detachView(a[1]),r[3]=null,r[4]=null,r[2]&=-65}return r}function br(e,t){if(!(128&t[2])){const n=t[11];n.destroyNode&&sl(e,t,n,3,null,null),function E1(e){let t=e[13];if(!t)return nc(e[1],e);for(;t;){let n=null;if(Xe(t))n=t[13];else{const r=t[10];r&&(n=r)}if(!n){for(;t&&!t[4]&&t!==e;)Xe(t)&&nc(t[1],t),t=t[3];null===t&&(t=e),Xe(t)&&nc(t[1],t),n=t&&t[4]}t=n}}(t)}}function nc(e,t){if(!(128&t[2])){t[2]&=-65,t[2]|=128,function av(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let r=0;r=0?r[i=v]():r[i=-v].unsubscribe(),a+=2}else{const c=r[i=n[a+1]];n[a].call(c)}if(null!==r){for(let a=i+1;a{const c=a;Lg(c,n,[],r)&&(i||(i=[]),i.push(c))}),void 0!==i&&cv(i,n),n}function cv(e,t){for(let n=0;n{t.push(a)})}}function Lg(e,t,n,r){if(!(e=Mt(e)))return!1;let i=null,a=ja(e);const c=!a&&Lt(e);if(a||c){if(c&&!c.standalone)return!1;i=e}else{const p=e.ngModule;if(a=ja(p),!a)return!1;i=p}const d=r.has(i);if(c){if(d)return!1;if(r.add(i),c.dependencies){const p="function"==typeof c.dependencies?c.dependencies():c.dependencies;for(const v of p)Lg(v,t,n,r)}}else{if(!a)return!1;{if(null!=a.imports&&!d){let v;r.add(i);try{rl(a.imports,E=>{Lg(E,t,n,r)&&(v||(v=[]),v.push(E))})}finally{}void 0!==v&&cv(v,t)}if(!d){const v=_s(i)||(()=>new i);t.push({provide:i,useFactory:v,deps:Cn},{provide:Rg,useValue:i,multi:!0},{provide:Zd,useValue:()=>St(i),multi:!0})}const p=a.providers;null==p||d||rl(p,E=>{t.push(E)})}}return i!==e&&void 0!==e.providers}const k1=zn({provide:String,useValue:zn});function Ng(e){return null!==e&&"object"==typeof e&&k1 in e}function eu(e){return"function"==typeof e}const wh=new Tt("Set Injector scope."),Wd={},wo={};let Ss;function oc(){return void 0===Ss&&(Ss=new wp),Ss}class Ms{}class zg extends Ms{constructor(t,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,P1(t,c=>this.processProvider(c)),this.records.set(va,Cp(void 0,this)),i.has("environment")&&this.records.set(Ms,Cp(void 0,this));const a=this.records.get(wh);null!=a&&"string"==typeof a.value&&this.scopes.add(a.value),this.injectorDefTypes=new Set(this.get(Rg.multi,Cn,Rt.Self))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(const t of this._ngOnDestroyHooks)t.ngOnDestroy();for(const t of this._onDestroyHooks)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),this._onDestroyHooks.length=0}}onDestroy(t){this._onDestroyHooks.push(t)}runInContext(t){this.assertNotDestroyed();const n=Xc(this),r=uo(void 0);try{return t()}finally{Xc(n),uo(r)}}get(t,n=il,r=Rt.Default){this.assertNotDestroyed();const i=Xc(this),a=uo(void 0);try{if(!(r&Rt.SkipSelf)){let d=this.records.get(t);if(void 0===d){const p=function Sz(e){return"function"==typeof e||"object"==typeof e&&e instanceof Tt}(t)&&Uu(t);d=p&&this.injectableDefInScope(p)?Cp(cl(t),Wd):null,this.records.set(t,d)}if(null!=d)return this.hydrate(t,d)}return(r&Rt.Self?oc():this.parent).get(t,n=r&Rt.Optional&&n===il?null:n)}catch(c){if("NullInjectorError"===c.name){if((c[rp]=c[rp]||[]).unshift(Mn(t)),i)throw c;return function s1(e,t,n,r){const i=e[rp];throw t[U_]&&i.unshift(t[U_]),e.message=function $_(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let i=Mn(t);if(Array.isArray(t))i=t.map(Mn).join(" -> ");else if("object"==typeof t){let a=[];for(let c in t)if(t.hasOwnProperty(c)){let d=t[c];a.push(c+":"+("string"==typeof d?JSON.stringify(d):Mn(d)))}i=`{${a.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${e.replace(r1,"\n ")}`}("\n"+e.message,i,n,r),e.ngTokenPath=i,e[rp]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{uo(a),Xc(i)}}resolveInjectorInitializers(){const t=Xc(this),n=uo(void 0);try{const r=this.get(Zd.multi,Cn,Rt.Self);for(const i of r)i()}finally{Xc(t),uo(n)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(Mn(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new nt(205,!1)}processProvider(t){let n=eu(t=Mt(t))?t:Mt(t&&t.provide);const r=function Cz(e){return Ng(e)?Cp(void 0,e.useValue):Cp(function k2(e,t,n){let r;if(eu(e)){const i=Mt(e);return _s(i)||cl(i)}if(Ng(e))r=()=>Mt(e.useValue);else if(function hv(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...ip(e.deps||[]));else if(function uv(e){return!(!e||!e.useExisting)}(e))r=()=>St(Mt(e.useExisting));else{const i=Mt(e&&(e.useClass||e.provide));if(!function Ez(e){return!!e.deps}(e))return _s(i)||cl(i);r=()=>new i(...ip(e.deps))}return r}(e),Wd)}(t);if(eu(t)||!0!==t.multi)this.records.get(n);else{let i=this.records.get(n);i||(i=Cp(void 0,Wd,!0),i.factory=()=>ip(i.multi),this.records.set(n,i)),n=t,i.multi.push(t)}this.records.set(n,r)}hydrate(t,n){return n.value===Wd&&(n.value=wo,n.value=n.factory()),"object"==typeof n.value&&n.value&&function Dz(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}injectableDefInScope(t){if(!t.providedIn)return!1;const n=Mt(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}}function cl(e){const t=Uu(e),n=null!==t?t.factory:_s(e);if(null!==n)return n;if(e instanceof Tt)throw new nt(204,!1);if(e instanceof Function)return function wz(e){const t=e.length;if(t>0)throw function Id(e,t){const n=[];for(let r=0;rn.factory(e):()=>new e}(e);throw new nt(204,!1)}function Cp(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function Mz(e){return!!e.\u0275providers}function P1(e,t){for(const n of e)Array.isArray(n)?P1(n,t):Mz(n)?P1(n.\u0275providers,t):t(n)}class P2{}class Az{resolveComponentFactory(t){throw function Iz(e){const t=Error(`No component factory found for ${Mn(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(t)}}let Bg=(()=>{class e{}return e.NULL=new Az,e})();function kz(){return Ep(Rr(),He())}function Ep(e,t){return new qs(Mi(e,t))}let qs=(()=>{class e{constructor(n){this.nativeElement=n}}return e.__NG_ELEMENT_ID__=kz,e})();function Pz(e){return e instanceof qs?e.nativeElement:e}class F2{}let sc=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>function Rz(){const e=He(),n=Ti(Rr().index,e);return(Xe(n)?n:e)[11]}(),e})(),Fz=(()=>{class e{}return e.\u0275prov=zt({token:e,providedIn:"root",factory:()=>null}),e})();class Vg{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Oz=new Vg("14.3.0"),R1={};function O1(e){return e.ngOriginalError}class Dp{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&O1(t);for(;n&&O1(n);)n=O1(n);return n||null}}function tu(e){return e instanceof Function?e():e}function L2(e,t,n){let r=e.length;for(;;){const i=e.indexOf(t,n);if(-1===i)return i;if(0===i||e.charCodeAt(i-1)<=32){const a=t.length;if(i+a===r||e.charCodeAt(i+a)<=32)return i}n=i+1}}const N2="ng-template";function qz(e,t,n){let r=0;for(;ra?"":i[D+1].toLowerCase();const P=8&r?T:null;if(P&&-1!==L2(P,v,0)||2&r&&v!==T){if(ul(r))return!1;c=!0}}}}else{if(!c&&!ul(r)&&!ul(p))return!1;if(c&&ul(p))continue;c=!1,r=p|1&r}}return ul(r)||c}function ul(e){return 0==(1&e)}function Xz(e,t,n,r){if(null===t)return-1;let i=0;if(r||!n){let a=!1;for(;i-1)for(n++;n0?'="'+d+'"':"")+"]"}else 8&r?i+="."+c:4&r&&(i+=" "+c);else""!==i&&!ul(c)&&(t+=V2(a,i),i=""),r=c,a=a||!ul(r);n++}return""!==i&&(t+=V2(a,i)),t}const tn={};function kr(e){U2(en(),He(),Le()+e,!1)}function U2(e,t,n,r){if(!r)if(3==(3&t[2])){const a=e.preOrderCheckHooks;null!==a&&rn(t,a,n)}else{const a=e.preOrderHooks;null!==a&&Fn(t,a,0,n)}Ne(n)}function G2(e,t=null,n=null,r){const i=q2(e,t,n,r);return i.resolveInjectorInitializers(),i}function q2(e,t=null,n=null,r,i=new Set){const a=[n||Cn,Fg(e)];return r=r||("object"==typeof e?void 0:Mn(e)),new zg(a,t||oc(),r||null,i)}let Zs=(()=>{class e{static create(n,r){if(Array.isArray(n))return G2({name:""},r,n,"");{const i=n.name??"";return G2({name:i},n.parent,n.providers,i)}}}return e.THROW_IF_NOT_FOUND=il,e.NULL=new wp,e.\u0275prov=zt({token:e,providedIn:"any",factory:()=>St(va)}),e.__NG_ELEMENT_ID__=-1,e})();function qe(e,t=Rt.Default){const n=He();return null===n?St(e,t):Zm(Rr(),n,Mt(e),t)}function V1(){throw new Error("invalid")}function cM(e,t){const n=e.contentQueries;if(null!==n)for(let r=0;r22&&U2(e,t,22,!1),n(r,i)}finally{Ne(a)}}function Q1(e,t,n){!qc()||(function U6(e,t,n,r){const i=n.directiveStart,a=n.directiveEnd;e.firstCreatePass||lh(n,t),hi(r,t);const c=n.initialInputs;for(let d=i;d0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(d)!=p&&d.push(p),d.push(r,i,c)}}function _M(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function vM(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function G6(e,t,n){if(n){if(t.exportAs)for(let r=0;r0&&iw(n)}}function iw(e){for(let r=_h(e);null!==r;r=Ud(r))for(let i=10;i0&&iw(a)}const n=e[1].components;if(null!==n)for(let r=0;r0&&iw(i)}}function J6(e,t){const n=Ti(t,e),r=n[1];(function Q6(e,t){for(let n=t.length;n-1&&($d(t,r),ep(n,r))}this._attachedToViewContainer=!1}br(this._lView[1],this._lView)}onDestroy(t){fM(this._lView[1],this._lView,null,t)}markForCheck(){ow(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-65}reattach(){this._lView[2]|=64}detectChanges(){vv(this._lView[1],this._lView,this.context)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new nt(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function C1(e,t){sl(e,t,t[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new nt(902,!1);this._appRef=t}}class eB extends Ug{constructor(t){super(t),this._view=t}detectChanges(){const t=this._view;vv(t[1],t,t[8],!1)}checkNoChanges(){}get context(){return null}}class lw extends Bg{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const n=Lt(t);return new $g(n,this.ngModule)}}function MM(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}class nB{constructor(t,n){this.injector=t,this.parentInjector=n}get(t,n,r){const i=this.injector.get(t,R1,r);return i!==R1||n===R1?i:this.parentInjector.get(t,n,r)}}class $g extends P2{constructor(t,n){super(),this.componentDef=t,this.ngModule=n,this.componentType=t.type,this.selector=function t6(e){return e.map(e6).join(",")}(t.selectors),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!n}get inputs(){return MM(this.componentDef.inputs)}get outputs(){return MM(this.componentDef.outputs)}create(t,n,r,i){let a=(i=i||this.ngModule)instanceof Ms?i:i?.injector;a&&null!==this.componentDef.getStandaloneInjector&&(a=this.componentDef.getStandaloneInjector(a)||a);const c=a?new nB(t,a):t,d=c.get(F2,null);if(null===d)throw new nt(407,!1);const p=c.get(Fz,null),v=d.createRenderer(null,this.componentDef),E=this.componentDef.selectors[0][0]||"div",D=r?function O6(e,t,n){return e.selectRootElement(t,n===ms.ShadowDom)}(v,r,this.componentDef.encapsulation):pp(v,E,function tB(e){const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":null}(E)),T=this.componentDef.onPush?288:272,P=tw(0,null,null,1,0,null,null,null,null,null),N=gv(null,P,null,T,null,null,d,v,p,c,null);let G,U;_e(N);try{const Z=function oB(e,t,n,r,i,a){const c=n[1];n[22]=e;const p=Tp(c,22,2,"#host",null),v=p.mergedAttrs=t.hostAttrs;null!==v&&(bv(p,v,!0),null!==e&&(Jr(i,e,v),null!==p.classes&&xh(i,e,p.classes),null!==p.styles&&bp(i,e,p.styles)));const E=r.createRenderer(e,t),D=gv(n,dM(t),null,t.onPush?32:16,n[22],p,r,E,a||null,null,null);return c.firstCreatePass&&(Ed(lh(p,n),c,t.type),vM(c,p),bM(p,n.length,1)),_v(n,D),n[22]=D}(D,this.componentDef,N,d,v);if(D)if(r)Jr(v,D,["ng-version",Oz.full]);else{const{attrs:ne,classes:X}=function n6(e){const t=[],n=[];let r=1,i=2;for(;r0&&xh(v,D,X.join(" "))}if(U=Hl(P,22),void 0!==n){const ne=U.projection=[];for(let X=0;Xd(Sr(fe[r.index])):r.index;let re=null;if(!d&&p&&(re=function EB(e,t,n,r){const i=e.cleanup;if(null!=i)for(let a=0;ap?d[p]:null}"string"==typeof c&&(a+=2)}return null}(e,t,i,r.index)),null!==re)(re.__ngLastListenerFn__||re).__ngNextListenerFn__=a,re.__ngLastListenerFn__=a,P=!1;else{a=HM(r,t,D,a,!1);const fe=n.listen(Z,i,a);T.push(a,fe),E&&E.push(i,X,ne,ne+1)}}else a=HM(r,t,D,a,!1);const N=r.outputs;let G;if(P&&null!==N&&(G=N[i])){const U=G.length;if(U)for(let Z=0;Z0;)t=t[15],e--;return t}(e,Vt.lFrame.contextLView))[8]}(e)}function zr(e,t=""){const n=He(),r=en(),i=e+22,a=r.firstCreatePass?Tp(r,i,1,t,null):r.data[i],c=n[i]=function tc(e,t){return e.createText(t)}(n[11],t);jd(r,n,c,a),bs(a,!1)}function Sh(e){return Kd("",e,""),Sh}function Kd(e,t,n){const r=He(),i=function kp(e,t,n,r){return Vo(e,w(),n)?t+$t(n)+r:tn}(r,e,t,n);return i!==tn&&ru(r,Le(),i),Kd}function yw(e,t,n,r,i){const a=He(),c=Pp(a,e,t,n,r,i);return c!==tn&&ru(a,Le(),c),yw}const Jd=void 0;var h8=["en",[["a","p"],["AM","PM"],Jd],[["AM","PM"],Jd,Jd],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Jd,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Jd,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Jd,"{1} 'at' {0}",Jd],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function u8(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let Vp={};function is(e){const t=function d8(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=RT(t);if(n)return n;const r=t.split("-")[0];if(n=RT(r),n)return n;if("en"===r)return h8;throw new nt(701,!1)}function RT(e){return e in Vp||(Vp[e]=nr.ng&&nr.ng.common&&nr.ng.common.locales&&nr.ng.common.locales[e]),Vp[e]}var vt=(()=>((vt=vt||{})[vt.LocaleId=0]="LocaleId",vt[vt.DayPeriodsFormat=1]="DayPeriodsFormat",vt[vt.DayPeriodsStandalone=2]="DayPeriodsStandalone",vt[vt.DaysFormat=3]="DaysFormat",vt[vt.DaysStandalone=4]="DaysStandalone",vt[vt.MonthsFormat=5]="MonthsFormat",vt[vt.MonthsStandalone=6]="MonthsStandalone",vt[vt.Eras=7]="Eras",vt[vt.FirstDayOfWeek=8]="FirstDayOfWeek",vt[vt.WeekendRange=9]="WeekendRange",vt[vt.DateFormat=10]="DateFormat",vt[vt.TimeFormat=11]="TimeFormat",vt[vt.DateTimeFormat=12]="DateTimeFormat",vt[vt.NumberSymbols=13]="NumberSymbols",vt[vt.NumberFormats=14]="NumberFormats",vt[vt.CurrencyCode=15]="CurrencyCode",vt[vt.CurrencySymbol=16]="CurrencySymbol",vt[vt.CurrencyName=17]="CurrencyName",vt[vt.Currencies=18]="Currencies",vt[vt.Directionality=19]="Directionality",vt[vt.PluralCase=20]="PluralCase",vt[vt.ExtraData=21]="ExtraData",vt))();const Up="en-US";let FT=Up;class Qd{}class sI{}class aI extends Qd{constructor(t,n){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new lw(this);const r=cn(t);this._bootstrapComponents=tu(r.bootstrap),this._r3Injector=q2(t,n,[{provide:Qd,useValue:this},{provide:Bg,useValue:this.componentFactoryResolver}],Mn(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Ew extends sI{constructor(t){super(),this.moduleType=t}create(t){return new aI(this.moduleType,t)}}class hV extends Qd{constructor(t,n,r){super(),this.componentFactoryResolver=new lw(this),this.instance=null;const i=new zg([...t,{provide:Qd,useValue:this},{provide:Bg,useValue:this.componentFactoryResolver}],n||oc(),r,new Set(["environment"]));this.injector=i,i.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function Av(e,t,n=null){return new hV(e,t,n).injector}let dV=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n.id)){const r=Og(0,n.type),i=r.length>0?Av([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n.id,i)}return this.cachedInjectors.get(n.id)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}}return e.\u0275prov=zt({token:e,providedIn:"environment",factory:()=>new e(St(Ms))}),e})();function lI(e){e.getStandaloneInjector=t=>t.get(dV).getOrCreateStandaloneInjector(e)}function ef(e,t,n,r){return function mI(e,t,n,r,i,a){const c=t+n;return Vo(e,c,i)?lc(e,c+1,a?r.call(a,i):r(i)):Qg(e,c+1)}(He(),h(),e,t,n,r)}function Qg(e,t){const n=e[t];return n===tn?void 0:n}function kv(e,t){const n=en();let r;const i=e+22;n.firstCreatePass?(r=function AV(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(i,r.onDestroy)):r=n.data[i];const a=r.factory||(r.factory=_s(r.type)),c=uo(qe);try{const d=Mr(!1),p=a();return Mr(d),function bB(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,He(),i,p),p}finally{uo(c)}}function Pv(e,t,n,r){const i=e+22,a=He(),c=function fa(e,t){return e[t]}(a,i);return function ey(e,t){return e[1].data[t].pure}(a,i)?function gI(e,t,n,r,i,a,c){const d=t+n;return Yd(e,d,i,a)?lc(e,d+2,c?r.call(c,i,a):r(i,a)):Qg(e,d+2)}(a,h(),t,c.transform,n,r,c):c.transform(n,r)}function Sw(e){return t=>{setTimeout(e,void 0,t)}}const ti=class OV extends pi{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,n,r){let i=t,a=n||(()=>null),c=r;if(t&&"object"==typeof t){const p=t;i=p.next?.bind(p),a=p.error?.bind(p),c=p.complete?.bind(p)}this.__isAsync&&(a=Sw(a),i&&(i=Sw(i)),c&&(c=Sw(c)));const d=super.subscribe({next:i,error:a,complete:c});return t instanceof wr&&t.add(d),d}};function LV(){return this._results[Xd()]()}class Mw{constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const n=Xd(),r=Mw.prototype;r[n]||(r[n]=LV)}get changes(){return this._changes||(this._changes=new ti)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){const r=this;r.dirty=!1;const i=_o(t);(this._changesDetected=!function Qm(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r{class e{}return e.__NG_ELEMENT_ID__=BV,e})();const NV=iu,zV=class extends NV{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}createEmbeddedView(t,n){const r=this._declarationTContainer.tViews,i=gv(this._declarationLView,r,t,16,null,r.declTNode,null,null,null,null,n||null);i[17]=this._declarationLView[this._declarationTContainer.index];const c=this._declarationLView[19];return null!==c&&(i[19]=c.createEmbeddedView(r)),J1(r,i,t),new Ug(i)}};function BV(){return Rv(Rr(),He())}function Rv(e,t){return 4&e.type?new zV(t,e,Ep(e,t)):null}let pl=(()=>{class e{}return e.__NG_ELEMENT_ID__=VV,e})();function VV(){return wI(Rr(),He())}const UV=pl,bI=class extends UV{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Ep(this._hostTNode,this._hostLView)}get injector(){return new ya(this._hostTNode,this._hostLView)}get parentInjector(){const t=ch(this._hostTNode,this._hostLView);if(ma(t)){const n=xs(t,this._hostLView),r=Hs(t);return new ya(n[1].data[r+8],n)}return new ya(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=xI(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,n,r){let i,a;"number"==typeof r?i=r:null!=r&&(i=r.index,a=r.injector);const c=t.createEmbeddedView(n||{},a);return this.insert(c,i),c}createComponent(t,n,r,i,a){const c=t&&!function Td(e){return"function"==typeof e}(t);let d;if(c)d=n;else{const D=n||{};d=D.index,r=D.injector,i=D.projectableNodes,a=D.environmentInjector||D.ngModuleRef}const p=c?t:new $g(Lt(t)),v=r||this.parentInjector;if(!a&&null==p.ngModule){const T=(c?v:this.parentInjector).get(Ms,null);T&&(a=T)}const E=p.create(v,i,void 0,a);return this.insert(E.hostView,d),E}insert(t,n){const r=t._lView,i=r[1];if(function th(e){return po(e[3])}(r)){const E=this.indexOf(t);if(-1!==E)this.detach(E);else{const D=r[3],T=new bI(D,D[6],D[3]);T.detach(T.indexOf(t))}}const a=this._adjustIndex(n),c=this._lContainer;!function D1(e,t,n,r){const i=10+r,a=n.length;r>0&&(n[i-1][4]=t),r0)r.push(c[d/2]);else{const v=a[d+1],E=t[-p];for(let D=10;D{class e{constructor(n){this.appInits=n,this.resolve=Lv,this.reject=Lv,this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i})}runInitializers(){if(this.initialized)return;const n=[],r=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let i=0;i{a.subscribe({complete:d,error:p})});n.push(c)}}Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),0===n.length&&r(),this.initialized=!0}}return e.\u0275fac=function(n){return new(n||e)(St(Nv,8))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const ny=new Tt("AppId",{providedIn:"root",factory:function qI(){return`${Bw()}${Bw()}${Bw()}`}});function Bw(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const ZI=new Tt("Platform Initializer"),Vw=new Tt("Platform ID",{providedIn:"platform",factory:()=>"unknown"}),WI=new Tt("appBootstrapListener");let gU=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();const ou=new Tt("LocaleId",{providedIn:"root",factory:()=>Or(ou,Rt.Optional|Rt.SkipSelf)||function yU(){return typeof $localize<"u"&&$localize.locale||Up}()});class vU{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let Uw=(()=>{class e{compileModuleSync(n){return new Ew(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),a=tu(cn(n).declarations).reduce((c,d)=>{const p=Lt(d);return p&&c.push(new $g(p)),c},[]);return new vU(r,a)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const wU=(()=>Promise.resolve(0))();function $w(e){typeof Zone>"u"?wU.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class Oi{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ti(!1),this.onMicrotaskEmpty=new ti(!1),this.onStable=new ti(!1),this.onError=new ti(!1),typeof Zone>"u")throw new nt(908,!1);Zone.assertZonePatched();const i=this;if(i._nesting=0,i._outer=i._inner=Zone.current,Zone.AsyncStackTaggingZoneSpec){const a=Zone.AsyncStackTaggingZoneSpec;i._inner=i._inner.fork(new a("Angular"))}Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!r&&n,i.shouldCoalesceRunChangeDetection=r,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function CU(){let e=nr.requestAnimationFrame,t=nr.cancelAnimationFrame;if(typeof Zone<"u"&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function SU(e){const t=()=>{!function DU(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(nr,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Hw(e),e.isCheckStableRunning=!0,jw(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Hw(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,i,a,c,d)=>{try{return KI(e),n.invokeTask(i,a,c,d)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||e.shouldCoalesceRunChangeDetection)&&t(),JI(e)}},onInvoke:(n,r,i,a,c,d,p)=>{try{return KI(e),n.invoke(i,a,c,d,p)}finally{e.shouldCoalesceRunChangeDetection&&t(),JI(e)}},onHasTask:(n,r,i,a)=>{n.hasTask(i,a),r===i&&("microTask"==a.change?(e._hasPendingMicrotasks=a.microTask,Hw(e),jw(e)):"macroTask"==a.change&&(e.hasPendingMacrotasks=a.macroTask))},onHandleError:(n,r,i,a)=>(n.handleError(i,a),e.runOutsideAngular(()=>e.onError.emit(a)),!1)})}(i)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Oi.isInAngularZone())throw new nt(909,!1)}static assertNotInAngularZone(){if(Oi.isInAngularZone())throw new nt(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,i){const a=this._inner,c=a.scheduleEventTask("NgZoneEvent: "+i,t,EU,Lv,Lv);try{return a.runTask(c,n,r)}finally{a.cancelTask(c)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const EU={};function jw(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Hw(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function KI(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function JI(e){e._nesting--,jw(e)}class MU{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ti,this.onMicrotaskEmpty=new ti,this.onStable=new ti,this.onError=new ti}run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,i){return t.apply(n,r)}}const QI=new Tt(""),Bv=new Tt("");let Zw,Gw=(()=>{class e{constructor(n,r,i){this._ngZone=n,this.registry=r,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,Zw||(function TU(e){Zw=e}(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Oi.assertNotInAngularZone(),$w(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())$w(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb(this._didWork)}this._didWork=!1});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let a=-1;r&&r>0&&(a=setTimeout(()=>{this._callbacks=this._callbacks.filter(c=>c.timeoutId!==a),n(this._didWork,this.getPendingTasks())},r)),this._callbacks.push({doneCb:n,timeoutId:a,updateCb:i})}whenStable(n,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}}return e.\u0275fac=function(n){return new(n||e)(St(Oi),St(qw),St(Bv))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})(),qw=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return Zw?.findTestabilityInTree(this,n,r)??null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})(),Mh=null;const eA=new Tt("AllowMultipleToken"),Ww=new Tt("PlatformDestroyListeners");class tA{constructor(t,n){this.name=t,this.token=n}}function rA(e,t,n=[]){const r=`Platform: ${t}`,i=new Tt(r);return(a=[])=>{let c=Xw();if(!c||c.injector.get(eA,!1)){const d=[...n,...a,{provide:i,useValue:!0}];e?e(d):function kU(e){if(Mh&&!Mh.get(eA,!1))throw new nt(400,!1);Mh=e;const t=e.get(oA);(function nA(e){const t=e.get(ZI,null);t&&t.forEach(n=>n())})(e)}(function iA(e=[],t){return Zs.create({name:t,providers:[{provide:wh,useValue:"platform"},{provide:Ww,useValue:new Set([()=>Mh=null])},...e]})}(d,r))}return function RU(e){const t=Xw();if(!t)throw new nt(401,!1);return t}()}}function Xw(){return Mh?.get(oA)??null}let oA=(()=>{class e{constructor(n){this._injector=n,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(n,r){const i=function aA(e,t){let n;return n="noop"===e?new MU:("zone.js"===e?void 0:e)||new Oi(t),n}(r?.ngZone,function sA(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:!(!e||!e.ngZoneEventCoalescing)||!1,shouldCoalesceRunChangeDetection:!(!e||!e.ngZoneRunCoalescing)||!1}}(r)),a=[{provide:Oi,useValue:i}];return i.run(()=>{const c=Zs.create({providers:a,parent:this.injector,name:n.moduleType.name}),d=n.create(c),p=d.injector.get(Dp,null);if(!p)throw new nt(402,!1);return i.runOutsideAngular(()=>{const v=i.onError.subscribe({next:E=>{p.handleError(E)}});d.onDestroy(()=>{Uv(this._modules,d),v.unsubscribe()})}),function lA(e,t,n){try{const r=n();return Gg(r)?r.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(p,i,()=>{const v=d.injector.get(zv);return v.runInitializers(),v.donePromise.then(()=>(function OT(e){ji(e,"Expected localeId to be defined"),"string"==typeof e&&(FT=e.toLowerCase().replace(/_/g,"-"))}(d.injector.get(ou,Up)||Up),this._moduleDoBootstrap(d),d))})})}bootstrapModule(n,r=[]){const i=cA({},r);return function IU(e,t,n){const r=new Ew(n);return Promise.resolve(r)}(0,0,n).then(a=>this.bootstrapModuleFactory(a,i))}_moduleDoBootstrap(n){const r=n.injector.get(Vv);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!n.instance.ngDoBootstrap)throw new nt(403,!1);n.instance.ngDoBootstrap(r)}this._modules.push(n)}onDestroy(n){this._destroyListeners.push(n)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new nt(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());const n=this._injector.get(Ww,null);n&&(n.forEach(r=>r()),n.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(n){return new(n||e)(St(Zs))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"platform"}),e})();function cA(e,t){return Array.isArray(t)?t.reduce(cA,e):{...e,...t}}let Vv=(()=>{class e{constructor(n,r,i){this._zone=n,this._injector=r,this._exceptionHandler=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this._destroyed=!1,this._destroyListeners=[],this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new Bn(d=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{d.next(this._stable),d.complete()})}),c=new Bn(d=>{let p;this._zone.runOutsideAngular(()=>{p=this._zone.onStable.subscribe(()=>{Oi.assertNotInAngularZone(),$w(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,d.next(!0))})})});const v=this._zone.onUnstable.subscribe(()=>{Oi.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{d.next(!1)}))});return()=>{p.unsubscribe(),v.unsubscribe()}});this.isStable=function Ol(...e){const t=lr(e),n=function ai(e,t){return"number"==typeof an(e)?e.pop():t}(e,1/0),r=e;return r.length?1===r.length?te(r[0]):dt(n)(Cr(r,t)):xt}(a,c.pipe(function Zh(e={}){const{connector:t=(()=>new pi),resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=e;return a=>{let c,d,p,v=0,E=!1,D=!1;const T=()=>{d?.unsubscribe(),d=void 0},P=()=>{T(),c=p=void 0,E=D=!1},N=()=>{const G=c;P(),G?.unsubscribe()};return yr((G,U)=>{v++,!D&&!E&&T();const Z=p=p??t();U.add(()=>{v--,0===v&&!D&&!E&&(d=Ll(N,i))}),Z.subscribe(U),!c&&v>0&&(c=new oo({next:ne=>Z.next(ne),error:ne=>{D=!0,T(),d=Ll(P,n,ne),Z.error(ne)},complete:()=>{E=!0,T(),d=Ll(P,r),Z.complete()}}),te(G).subscribe(c))})(a)}}()))}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(n,r){const i=n instanceof P2;if(!this._injector.get(zv).done)throw!i&&function Bs(e){const t=Lt(e)||Kr(e)||kt(e);return null!==t&&t.standalone}(n),new nt(405,false);let c;c=i?n:this._injector.get(Bg).resolveComponentFactory(n),this.componentTypes.push(c.componentType);const d=function AU(e){return e.isBoundToModule}(c)?void 0:this._injector.get(Qd),v=c.create(Zs.NULL,[],r||c.selector,d),E=v.location.nativeElement,D=v.injector.get(QI,null);return D?.registerApplication(E),v.onDestroy(()=>{this.detachView(v.hostView),Uv(this.components,v),D?.unregisterApplication(E)}),this._loadComponent(v),v}tick(){if(this._runningTick)throw new nt(101,!1);try{this._runningTick=!0;for(let n of this._views)n.detectChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;Uv(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n),this._injector.get(WI,[]).concat(this._bootstrapListeners).forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Uv(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new nt(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}}return e.\u0275fac=function(n){return new(n||e)(St(Oi),St(Ms),St(Dp))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Uv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let hA=!0,$v=(()=>{class e{}return e.__NG_ELEMENT_ID__=LU,e})();function LU(e){return function NU(e,t,n){if(Zu(e)&&!n){const r=Ti(e.index,t);return new Ug(r,r)}return 47&e.type?new Ug(t[16],t):null}(Rr(),He(),16==(16&e))}class gA{constructor(){}supports(t){return jg(t)}create(t){return new jU(t)}}const $U=(e,t)=>t;class jU{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||$U}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,i=0,a=null;for(;n||r;){const c=!r||n&&n.currentIndex<_A(r,i,a)?n:r,d=_A(c,i,a),p=c.currentIndex;if(c===r)i--,r=r._nextRemoved;else if(n=n._next,null==c.previousIndex)i++;else{a||(a=[]);const v=d-i,E=p-i;if(v!=E){for(let T=0;T{c=this._trackByFn(i,d),null!==n&&Object.is(n.trackById,c)?(r&&(n=this._verifyReinsertion(n,d,c,i)),Object.is(n.item,d)||this._addIdentityChange(n,d)):(n=this._mismatch(n,d,c,i),r=!0),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,i){let a;return null===t?a=this._itTail:(a=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,a,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,a,i)):t=this._addAfter(new HU(n,r),a,i),t}_verifyReinsertion(t,n,r,i){let a=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==a?t=this._reinsertAfter(a,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,a=t._nextRemoved;return null===i?this._removalsHead=a:i._nextRemoved=a,null===a?this._removalsTail=i:a._prevRemoved=i,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const i=null===n?this._itHead:n._next;return t._next=i,t._prev=n,null===i?this._itTail=t:i._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new yA),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new yA),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class HU{constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class GU{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class yA{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new GU,this.map.set(n,r)),r.add(t)}get(t,n){const i=this.map.get(t);return i?i.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function _A(e,t,n){const r=e.previousIndex;if(null===r)return r;let i=0;return n&&r{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const a=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,a)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const i=this._records.get(t);this._maybeAddToChanges(i,n);const a=i._prev,c=i._next;return a&&(a._next=c),c&&(c._prev=a),i._next=null,i._prev=null,i}const r=new ZU(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class ZU{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function bA(){return new Gv([new gA])}let Gv=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(null!=r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||bA()),deps:[[e,new Ir,new Fd]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(null!=r)return r;throw new nt(901,!1)}}return e.\u0275prov=zt({token:e,providedIn:"root",factory:bA}),e})();function xA(){return new ry([new vA])}let ry=(()=>{class e{constructor(n){this.factories=n}static create(n,r){if(r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||xA()),deps:[[e,new Ir,new Fd]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(r)return r;throw new nt(901,!1)}}return e.\u0275prov=zt({token:e,providedIn:"root",factory:xA}),e})();const YU=rA(null,"core",[]);let KU=(()=>{class e{constructor(n){}}return e.\u0275fac=function(n){return new(n||e)(St(Vv))},e.\u0275mod=li({type:e}),e.\u0275inj=Di({}),e})(),qv=null;function dc(){return qv}const ss=new Tt("DocumentToken");let eC=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:function(){return function t$(){return St(wA)}()},providedIn:"platform"}),e})();const n$=new Tt("Location Initialized");let wA=(()=>{class e extends eC{constructor(n){super(),this._doc=n,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return dc().getBaseHref(this._doc)}onPopState(n){const r=dc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",n,!1),()=>r.removeEventListener("popstate",n)}onHashChange(n){const r=dc().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",n,!1),()=>r.removeEventListener("hashchange",n)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(n){this.location.pathname=n}pushState(n,r,i){CA()?this._history.pushState(n,r,i):this.location.hash=i}replaceState(n,r,i){CA()?this._history.replaceState(n,r,i):this.location.hash=i}forward(){this._history.forward()}back(){this._history.back()}historyGo(n=0){this._history.go(n)}getState(){return this._history.state}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=zt({token:e,factory:function(){return function r$(){return new wA(St(ss))}()},providedIn:"platform"}),e})();function CA(){return!!window.history.pushState}function tC(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function EA(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function lu(e){return e&&"?"!==e[0]?"?"+e:e}let nf=(()=>{class e{historyGo(n){throw new Error("Not implemented")}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:function(){return Or(SA)},providedIn:"root"}),e})();const DA=new Tt("appBaseHref");let SA=(()=>{class e extends nf{constructor(n,r){super(),this._platformLocation=n,this._removeListenerFns=[],this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Or(ss).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}prepareExternalUrl(n){return tC(this._baseHref,n)}path(n=!1){const r=this._platformLocation.pathname+lu(this._platformLocation.search),i=this._platformLocation.hash;return i&&n?`${r}${i}`:r}pushState(n,r,i,a){const c=this.prepareExternalUrl(i+lu(a));this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,a){const c=this.prepareExternalUrl(i+lu(a));this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(eC),St(DA,8))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),i$=(()=>{class e extends nf{constructor(n,r){super(),this._platformLocation=n,this._baseHref="",this._removeListenerFns=[],null!=r&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(n){this._removeListenerFns.push(this._platformLocation.onPopState(n),this._platformLocation.onHashChange(n))}getBaseHref(){return this._baseHref}path(n=!1){let r=this._platformLocation.hash;return null==r&&(r="#"),r.length>0?r.substring(1):r}prepareExternalUrl(n){const r=tC(this._baseHref,n);return r.length>0?"#"+r:r}pushState(n,r,i,a){let c=this.prepareExternalUrl(i+lu(a));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.pushState(n,r,c)}replaceState(n,r,i,a){let c=this.prepareExternalUrl(i+lu(a));0==c.length&&(c=this._platformLocation.pathname),this._platformLocation.replaceState(n,r,c)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(n=0){this._platformLocation.historyGo?.(n)}}return e.\u0275fac=function(n){return new(n||e)(St(eC),St(DA,8))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})(),nC=(()=>{class e{constructor(n){this._subject=new ti,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=n;const r=this._locationStrategy.getBaseHref();this._baseHref=EA(MA(r)),this._locationStrategy.onPopState(i=>{this._subject.emit({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(n=!1){return this.normalize(this._locationStrategy.path(n))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(n,r=""){return this.path()==this.normalize(n+lu(r))}normalize(n){return e.stripTrailingSlash(function s$(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,MA(n)))}prepareExternalUrl(n){return n&&"/"!==n[0]&&(n="/"+n),this._locationStrategy.prepareExternalUrl(n)}go(n,r="",i=null){this._locationStrategy.pushState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}replaceState(n,r="",i=null){this._locationStrategy.replaceState(i,"",n,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(n+lu(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(n=0){this._locationStrategy.historyGo?.(n)}onUrlChange(n){return this._urlChangeListeners.push(n),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)})),()=>{const r=this._urlChangeListeners.indexOf(n);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(n="",r){this._urlChangeListeners.forEach(i=>i(n,r))}subscribe(n,r,i){return this._subject.subscribe({next:n,error:r,complete:i})}}return e.normalizeQueryParams=lu,e.joinWithSlash=tC,e.stripTrailingSlash=EA,e.\u0275fac=function(n){return new(n||e)(St(nf))},e.\u0275prov=zt({token:e,factory:function(){return function o$(){return new nC(St(nf))}()},providedIn:"root"}),e})();function MA(e){return e.replace(/\/index.html$/,"")}var di=(()=>((di=di||{})[di.Format=0]="Format",di[di.Standalone=1]="Standalone",di))(),kn=(()=>((kn=kn||{})[kn.Narrow=0]="Narrow",kn[kn.Abbreviated=1]="Abbreviated",kn[kn.Wide=2]="Wide",kn[kn.Short=3]="Short",kn))(),qr=(()=>((qr=qr||{})[qr.Short=0]="Short",qr[qr.Medium=1]="Medium",qr[qr.Long=2]="Long",qr[qr.Full=3]="Full",qr))(),Ut=(()=>((Ut=Ut||{})[Ut.Decimal=0]="Decimal",Ut[Ut.Group=1]="Group",Ut[Ut.List=2]="List",Ut[Ut.PercentSign=3]="PercentSign",Ut[Ut.PlusSign=4]="PlusSign",Ut[Ut.MinusSign=5]="MinusSign",Ut[Ut.Exponential=6]="Exponential",Ut[Ut.SuperscriptingExponent=7]="SuperscriptingExponent",Ut[Ut.PerMille=8]="PerMille",Ut[Ut.Infinity=9]="Infinity",Ut[Ut.NaN=10]="NaN",Ut[Ut.TimeSeparator=11]="TimeSeparator",Ut[Ut.CurrencyDecimal=12]="CurrencyDecimal",Ut[Ut.CurrencyGroup=13]="CurrencyGroup",Ut))();function Zv(e,t){return Ca(is(e)[vt.DateFormat],t)}function Wv(e,t){return Ca(is(e)[vt.TimeFormat],t)}function Xv(e,t){return Ca(is(e)[vt.DateTimeFormat],t)}function wa(e,t){const n=is(e),r=n[vt.NumberSymbols][t];if(typeof r>"u"){if(t===Ut.CurrencyDecimal)return n[vt.NumberSymbols][Ut.Decimal];if(t===Ut.CurrencyGroup)return n[vt.NumberSymbols][Ut.Group]}return r}function IA(e){if(!e[vt.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[vt.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Ca(e,t){for(let n=t;n>-1;n--)if(typeof e[n]<"u")return e[n];throw new Error("Locale data API: locale data undefined")}function iC(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const v$=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,iy={},b$=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var Li=(()=>((Li=Li||{})[Li.Short=0]="Short",Li[Li.ShortGMT=1]="ShortGMT",Li[Li.Long=2]="Long",Li[Li.Extended=3]="Extended",Li))(),Gt=(()=>((Gt=Gt||{})[Gt.FullYear=0]="FullYear",Gt[Gt.Month=1]="Month",Gt[Gt.Date=2]="Date",Gt[Gt.Hours=3]="Hours",Gt[Gt.Minutes=4]="Minutes",Gt[Gt.Seconds=5]="Seconds",Gt[Gt.FractionalSeconds=6]="FractionalSeconds",Gt[Gt.Day=7]="Day",Gt))(),un=(()=>((un=un||{})[un.DayPeriods=0]="DayPeriods",un[un.Days=1]="Days",un[un.Months=2]="Months",un[un.Eras=3]="Eras",un))();function x$(e,t,n,r){let i=function A$(e){if(PA(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[i,a=1,c=1]=e.split("-").map(d=>+d);return Yv(i,a-1,c)}const n=parseFloat(e);if(!isNaN(e-n))return new Date(n);let r;if(r=e.match(v$))return function k$(e){const t=new Date(0);let n=0,r=0;const i=e[8]?t.setUTCFullYear:t.setFullYear,a=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const c=Number(e[4]||0)-n,d=Number(e[5]||0)-r,p=Number(e[6]||0),v=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return a.call(t,c,d,p,v),t}(r)}const t=new Date(e);if(!PA(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=cu(n,t)||t;let d,c=[];for(;t;){if(d=b$.exec(t),!d){c.push(t);break}{c=c.concat(d.slice(1));const E=c.pop();if(!E)break;t=E}}let p=i.getTimezoneOffset();r&&(p=kA(r,p),i=function I$(e,t,n){const r=n?-1:1,i=e.getTimezoneOffset();return function T$(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,r*(kA(t,i)-i))}(i,r,!0));let v="";return c.forEach(E=>{const D=function M$(e){if(sC[e])return sC[e];let t;switch(e){case"G":case"GG":case"GGG":t=Tr(un.Eras,kn.Abbreviated);break;case"GGGG":t=Tr(un.Eras,kn.Wide);break;case"GGGGG":t=Tr(un.Eras,kn.Narrow);break;case"y":t=bi(Gt.FullYear,1,0,!1,!0);break;case"yy":t=bi(Gt.FullYear,2,0,!0,!0);break;case"yyy":t=bi(Gt.FullYear,3,0,!1,!0);break;case"yyyy":t=bi(Gt.FullYear,4,0,!1,!0);break;case"Y":t=e0(1);break;case"YY":t=e0(2,!0);break;case"YYY":t=e0(3);break;case"YYYY":t=e0(4);break;case"M":case"L":t=bi(Gt.Month,1,1);break;case"MM":case"LL":t=bi(Gt.Month,2,1);break;case"MMM":t=Tr(un.Months,kn.Abbreviated);break;case"MMMM":t=Tr(un.Months,kn.Wide);break;case"MMMMM":t=Tr(un.Months,kn.Narrow);break;case"LLL":t=Tr(un.Months,kn.Abbreviated,di.Standalone);break;case"LLLL":t=Tr(un.Months,kn.Wide,di.Standalone);break;case"LLLLL":t=Tr(un.Months,kn.Narrow,di.Standalone);break;case"w":t=oC(1);break;case"ww":t=oC(2);break;case"W":t=oC(1,!0);break;case"d":t=bi(Gt.Date,1);break;case"dd":t=bi(Gt.Date,2);break;case"c":case"cc":t=bi(Gt.Day,1);break;case"ccc":t=Tr(un.Days,kn.Abbreviated,di.Standalone);break;case"cccc":t=Tr(un.Days,kn.Wide,di.Standalone);break;case"ccccc":t=Tr(un.Days,kn.Narrow,di.Standalone);break;case"cccccc":t=Tr(un.Days,kn.Short,di.Standalone);break;case"E":case"EE":case"EEE":t=Tr(un.Days,kn.Abbreviated);break;case"EEEE":t=Tr(un.Days,kn.Wide);break;case"EEEEE":t=Tr(un.Days,kn.Narrow);break;case"EEEEEE":t=Tr(un.Days,kn.Short);break;case"a":case"aa":case"aaa":t=Tr(un.DayPeriods,kn.Abbreviated);break;case"aaaa":t=Tr(un.DayPeriods,kn.Wide);break;case"aaaaa":t=Tr(un.DayPeriods,kn.Narrow);break;case"b":case"bb":case"bbb":t=Tr(un.DayPeriods,kn.Abbreviated,di.Standalone,!0);break;case"bbbb":t=Tr(un.DayPeriods,kn.Wide,di.Standalone,!0);break;case"bbbbb":t=Tr(un.DayPeriods,kn.Narrow,di.Standalone,!0);break;case"B":case"BB":case"BBB":t=Tr(un.DayPeriods,kn.Abbreviated,di.Format,!0);break;case"BBBB":t=Tr(un.DayPeriods,kn.Wide,di.Format,!0);break;case"BBBBB":t=Tr(un.DayPeriods,kn.Narrow,di.Format,!0);break;case"h":t=bi(Gt.Hours,1,-12);break;case"hh":t=bi(Gt.Hours,2,-12);break;case"H":t=bi(Gt.Hours,1);break;case"HH":t=bi(Gt.Hours,2);break;case"m":t=bi(Gt.Minutes,1);break;case"mm":t=bi(Gt.Minutes,2);break;case"s":t=bi(Gt.Seconds,1);break;case"ss":t=bi(Gt.Seconds,2);break;case"S":t=bi(Gt.FractionalSeconds,1);break;case"SS":t=bi(Gt.FractionalSeconds,2);break;case"SSS":t=bi(Gt.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=Jv(Li.Short);break;case"ZZZZZ":t=Jv(Li.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=Jv(Li.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=Jv(Li.Long);break;default:return null}return sC[e]=t,t}(E);v+=D?D(i,n,p):"''"===E?"'":E.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),v}function Yv(e,t,n){const r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function cu(e,t){const n=function a$(e){return is(e)[vt.LocaleId]}(e);if(iy[n]=iy[n]||{},iy[n][t])return iy[n][t];let r="";switch(t){case"shortDate":r=Zv(e,qr.Short);break;case"mediumDate":r=Zv(e,qr.Medium);break;case"longDate":r=Zv(e,qr.Long);break;case"fullDate":r=Zv(e,qr.Full);break;case"shortTime":r=Wv(e,qr.Short);break;case"mediumTime":r=Wv(e,qr.Medium);break;case"longTime":r=Wv(e,qr.Long);break;case"fullTime":r=Wv(e,qr.Full);break;case"short":const i=cu(e,"shortTime"),a=cu(e,"shortDate");r=Kv(Xv(e,qr.Short),[i,a]);break;case"medium":const c=cu(e,"mediumTime"),d=cu(e,"mediumDate");r=Kv(Xv(e,qr.Medium),[c,d]);break;case"long":const p=cu(e,"longTime"),v=cu(e,"longDate");r=Kv(Xv(e,qr.Long),[p,v]);break;case"full":const E=cu(e,"fullTime"),D=cu(e,"fullDate");r=Kv(Xv(e,qr.Full),[E,D])}return r&&(iy[n][t]=r),r}function Kv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(n,r){return null!=t&&r in t?t[r]:n})),e}function gl(e,t,n="-",r,i){let a="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,a=n));let c=String(e);for(;c.length0||d>-n)&&(d+=n),e===Gt.Hours)0===d&&-12===n&&(d=12);else if(e===Gt.FractionalSeconds)return function w$(e,t){return gl(e,3).substring(0,t)}(d,t);const p=wa(c,Ut.MinusSign);return gl(d,t,p,r,i)}}function Tr(e,t,n=di.Format,r=!1){return function(i,a){return function E$(e,t,n,r,i,a){switch(n){case un.Months:return function u$(e,t,n){const r=is(e),a=Ca([r[vt.MonthsFormat],r[vt.MonthsStandalone]],t);return Ca(a,n)}(t,i,r)[e.getMonth()];case un.Days:return function c$(e,t,n){const r=is(e),a=Ca([r[vt.DaysFormat],r[vt.DaysStandalone]],t);return Ca(a,n)}(t,i,r)[e.getDay()];case un.DayPeriods:const c=e.getHours(),d=e.getMinutes();if(a){const v=function p$(e){const t=is(e);return IA(t),(t[vt.ExtraData][2]||[]).map(r=>"string"==typeof r?iC(r):[iC(r[0]),iC(r[1])])}(t),E=function m$(e,t,n){const r=is(e);IA(r);const a=Ca([r[vt.ExtraData][0],r[vt.ExtraData][1]],t)||[];return Ca(a,n)||[]}(t,i,r),D=v.findIndex(T=>{if(Array.isArray(T)){const[P,N]=T,G=c>=P.hours&&d>=P.minutes,U=c0?Math.floor(i/60):Math.ceil(i/60);switch(e){case Li.Short:return(i>=0?"+":"")+gl(c,2,a)+gl(Math.abs(i%60),2,a);case Li.ShortGMT:return"GMT"+(i>=0?"+":"")+gl(c,1,a);case Li.Long:return"GMT"+(i>=0?"+":"")+gl(c,2,a)+":"+gl(Math.abs(i%60),2,a);case Li.Extended:return 0===r?"Z":(i>=0?"+":"")+gl(c,2,a)+":"+gl(Math.abs(i%60),2,a);default:throw new Error(`Unknown zone width "${e}"`)}}}function AA(e){return Yv(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function oC(e,t=!1){return function(n,r){let i;if(t){const a=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,c=n.getDate();i=1+Math.floor((c+a)/7)}else{const a=AA(n),c=function S$(e){const t=Yv(e,0,1).getDay();return Yv(e,0,1+(t<=4?4:11)-t)}(a.getFullYear()),d=a.getTime()-c.getTime();i=1+Math.round(d/6048e5)}return gl(i,e,wa(r,Ut.MinusSign))}}function e0(e,t=!1){return function(n,r){return gl(AA(n).getFullYear(),e,wa(r,Ut.MinusSign),t)}}const sC={};function kA(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function PA(e){return e instanceof Date&&!isNaN(e.valueOf())}function LA(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const r=n.indexOf("="),[i,a]=-1==r?[n,""]:[n.slice(0,r),n.slice(r+1)];if(i.trim()===t)return decodeURIComponent(a)}return null}let dC=(()=>{class e{constructor(n,r,i,a){this._iterableDiffers=n,this._keyValueDiffers=r,this._ngEl=i,this._renderer=a,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(n){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof n?n.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(n){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof n?n.split(/\s+/):n,this._rawClass&&(jg(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const n=this._iterableDiffer.diff(this._rawClass);n&&this._applyIterableChanges(n)}else if(this._keyValueDiffer){const n=this._keyValueDiffer.diff(this._rawClass);n&&this._applyKeyValueChanges(n)}}_applyKeyValueChanges(n){n.forEachAddedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachChangedItem(r=>this._toggleClass(r.key,r.currentValue)),n.forEachRemovedItem(r=>{r.previousValue&&this._toggleClass(r.key,!1)})}_applyIterableChanges(n){n.forEachAddedItem(r=>{if("string"!=typeof r.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Mn(r.item)}`);this._toggleClass(r.item,!0)}),n.forEachRemovedItem(r=>this._toggleClass(r.item,!1))}_applyClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!0)):Object.keys(n).forEach(r=>this._toggleClass(r,!!n[r])))}_removeClasses(n){n&&(Array.isArray(n)||n instanceof Set?n.forEach(r=>this._toggleClass(r,!1)):Object.keys(n).forEach(r=>this._toggleClass(r,!1)))}_toggleClass(n,r){(n=n.trim())&&n.split(/\s+/g).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}}return e.\u0275fac=function(n){return new(n||e)(qe(Gv),qe(ry),qe(qs),qe(sc))},e.\u0275dir=Ot({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"},standalone:!0}),e})();class H${constructor(t,n,r,i){this.$implicit=t,this.ngForOf=n,this.index=r,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let n0=(()=>{class e{constructor(n,r,i){this._viewContainer=n,this._template=r,this._differs=i,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(n){this._ngForOf=n,this._ngForOfDirty=!0}set ngForTrackBy(n){this._trackByFn=n}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(n){n&&(this._template=n)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;!this._differ&&n&&(this._differ=this._differs.find(n).create(this.ngForTrackBy))}if(this._differ){const n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}}_applyChanges(n){const r=this._viewContainer;n.forEachOperation((i,a,c)=>{if(null==i.previousIndex)r.createEmbeddedView(this._template,new H$(i.item,this._ngForOf,-1,-1),null===c?void 0:c);else if(null==c)r.remove(null===a?void 0:a);else if(null!==a){const d=r.get(a);r.move(d,c),BA(d,i)}});for(let i=0,a=r.length;i{BA(r.get(i.currentIndex),i)})}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(pl),qe(iu),qe(Gv))},e.\u0275dir=Ot({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0}),e})();function BA(e,t){e.context.$implicit=t.item}let fC=(()=>{class e{constructor(n,r){this._viewContainer=n,this._context=new q$,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=r}set ngIf(n){this._context.$implicit=this._context.ngIf=n,this._updateView()}set ngIfThen(n){VA("ngIfThen",n),this._thenTemplateRef=n,this._thenViewRef=null,this._updateView()}set ngIfElse(n){VA("ngIfElse",n),this._elseTemplateRef=n,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(n,r){return!0}}return e.\u0275fac=function(n){return new(n||e)(qe(pl),qe(iu))},e.\u0275dir=Ot({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0}),e})();class q${constructor(){this.$implicit=null,this.ngIf=null}}function VA(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Mn(t)}'.`)}const a7=new Tt("DATE_PIPE_DEFAULT_TIMEZONE");let gC=(()=>{class e{constructor(n,r){this.locale=n,this.defaultTimezone=r}transform(n,r="mediumDate",i,a){if(null==n||""===n||n!=n)return null;try{return x$(n,r,a||this.locale,i??this.defaultTimezone??void 0)}catch(c){throw function yl(e,t){return new nt(2100,!1)}()}}}return e.\u0275fac=function(n){return new(n||e)(qe(ou,16),qe(a7,24))},e.\u0275pipe=Hi({name:"date",type:e,pure:!0,standalone:!0}),e})(),jA=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({}),e})();let x7=(()=>{class e{}return e.\u0275prov=zt({token:e,providedIn:"root",factory:()=>new w7(St(ss),window)}),e})();class w7{constructor(t,n){this.document=t,this.window=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(!this.supportsScrolling())return;const n=function C7(e,t){const n=e.getElementById(t)||e.getElementsByName(t)[0];if(n)return n;if("function"==typeof e.createTreeWalker&&e.body&&(e.body.createShadowRoot||e.body.attachShadow)){const r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let i=r.currentNode;for(;i;){const a=i.shadowRoot;if(a){const c=a.getElementById(t)||a.querySelector(`[name="${t}"]`);if(c)return c}i=r.nextNode()}}return null}(this.document,t);n&&(this.scrollToElement(n),n.focus())}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const n=this.window.history;n&&n.scrollRestoration&&(n.scrollRestoration=t)}}scrollToElement(t){const n=t.getBoundingClientRect(),r=n.left+this.window.pageXOffset,i=n.top+this.window.pageYOffset,a=this.offset();this.window.scrollTo(r-a[0],i-a[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=GA(this.window.history)||GA(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch{return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}function GA(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}class qA{}class xC extends class Y7 extends class e${}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function QU(e){qv||(qv=e)}(new xC)}onAndCancel(t,n,r){return t.addEventListener(n,r,!1),()=>{t.removeEventListener(n,r,!1)}}dispatchEvent(t,n){t.dispatchEvent(n)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,n){return(n=n||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,n){return"window"===n?window:"document"===n?t:"body"===n?t.body:null}getBaseHref(t){const n=function K7(){return ay=ay||document.querySelector("base"),ay?ay.getAttribute("href"):null}();return null==n?null:function J7(e){s0=s0||document.createElement("a"),s0.setAttribute("href",e);const t=s0.pathname;return"/"===t.charAt(0)?t:`/${t}`}(n)}resetBaseElement(){ay=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return LA(document.cookie,t)}}let s0,ay=null;const KA=new Tt("TRANSITION_ID"),e9=[{provide:Nv,useFactory:function Q7(e,t,n){return()=>{n.get(zv).donePromise.then(()=>{const r=dc(),i=t.querySelectorAll(`style[ng-transition="${e}"]`);for(let a=0;a{class e{build(){return new XMLHttpRequest}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();const a0=new Tt("EventManagerPlugins");let l0=(()=>{class e{constructor(n,r){this._zone=r,this._eventNameToPlugin=new Map,n.forEach(i=>i.manager=this),this._plugins=n.slice().reverse()}addEventListener(n,r,i){return this._findPluginFor(r).addEventListener(n,r,i)}addGlobalEventListener(n,r,i){return this._findPluginFor(r).addGlobalEventListener(n,r,i)}getZone(){return this._zone}_findPluginFor(n){const r=this._eventNameToPlugin.get(n);if(r)return r;const i=this._plugins;for(let a=0;a{class e{constructor(){this._stylesSet=new Set}addStyles(n){const r=new Set;n.forEach(i=>{this._stylesSet.has(i)||(this._stylesSet.add(i),r.add(i))}),this.onStylesAdded(r)}onStylesAdded(n){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})(),ly=(()=>{class e extends QA{constructor(n){super(),this._doc=n,this._hostNodes=new Map,this._hostNodes.set(n.head,[])}_addStylesToHost(n,r,i){n.forEach(a=>{const c=this._doc.createElement("style");c.textContent=a,i.push(r.appendChild(c))})}addHost(n){const r=[];this._addStylesToHost(this._stylesSet,n,r),this._hostNodes.set(n,r)}removeHost(n){const r=this._hostNodes.get(n);r&&r.forEach(ek),this._hostNodes.delete(n)}onStylesAdded(n){this._hostNodes.forEach((r,i)=>{this._addStylesToHost(n,i,r)})}ngOnDestroy(){this._hostNodes.forEach(n=>n.forEach(ek))}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();function ek(e){dc().remove(e)}const wC={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},CC=/%COMP%/g;function c0(e,t,n){for(let r=0;r{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let EC=(()=>{class e{constructor(n,r,i){this.eventManager=n,this.sharedStylesHost=r,this.appId=i,this.rendererByCompId=new Map,this.defaultRenderer=new DC(n)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;switch(r.encapsulation){case ms.Emulated:{let i=this.rendererByCompId.get(r.id);return i||(i=new l9(this.eventManager,this.sharedStylesHost,r,this.appId),this.rendererByCompId.set(r.id,i)),i.applyToHost(n),i}case 1:case ms.ShadowDom:return new c9(this.eventManager,this.sharedStylesHost,n,r);default:if(!this.rendererByCompId.has(r.id)){const i=c0(r.id,r.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(r.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(n){return new(n||e)(St(l0),St(ly),St(ny))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();class DC{constructor(t){this.eventManager=t,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(t,n){return n?document.createElementNS(wC[n]||n,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,n){(ok(t)?t.content:t).appendChild(n)}insertBefore(t,n,r){t&&(ok(t)?t.content:t).insertBefore(n,r)}removeChild(t,n){t&&t.removeChild(n)}selectRootElement(t,n){let r="string"==typeof t?document.querySelector(t):t;if(!r)throw new Error(`The selector "${t}" did not match any elements`);return n||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,n,r,i){if(i){n=i+":"+n;const a=wC[i];a?t.setAttributeNS(a,n,r):t.setAttribute(n,r)}else t.setAttribute(n,r)}removeAttribute(t,n,r){if(r){const i=wC[r];i?t.removeAttributeNS(i,n):t.removeAttribute(`${r}:${n}`)}else t.removeAttribute(n)}addClass(t,n){t.classList.add(n)}removeClass(t,n){t.classList.remove(n)}setStyle(t,n,r,i){i&(Yi.DashCase|Yi.Important)?t.style.setProperty(n,r,i&Yi.Important?"important":""):t.style[n]=r}removeStyle(t,n,r){r&Yi.DashCase?t.style.removeProperty(n):t.style[n]=""}setProperty(t,n,r){t[n]=r}setValue(t,n){t.nodeValue=n}listen(t,n,r){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,n,rk(r)):this.eventManager.addEventListener(t,n,rk(r))}}function ok(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class l9 extends DC{constructor(t,n,r,i){super(t),this.component=r;const a=c0(i+"-"+r.id,r.styles,[]);n.addStyles(a),this.contentAttr=function o9(e){return"_ngcontent-%COMP%".replace(CC,e)}(i+"-"+r.id),this.hostAttr=function s9(e){return"_nghost-%COMP%".replace(CC,e)}(i+"-"+r.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,n){const r=super.createElement(t,n);return super.setAttribute(r,this.contentAttr,""),r}}class c9 extends DC{constructor(t,n,r,i){super(t),this.sharedStylesHost=n,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const a=c0(i.id,i.styles,[]);for(let c=0;c{class e extends JA{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,i){return n.addEventListener(r,i,!1),()=>this.removeEventListener(n,r,i)}removeEventListener(n,r,i){return n.removeEventListener(r,i)}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();const sk=["alt","control","meta","shift"],h9={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},d9={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let f9=(()=>{class e extends JA{constructor(n){super(n)}supports(n){return null!=e.parseEventName(n)}addEventListener(n,r,i){const a=e.parseEventName(r),c=e.eventCallback(a.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dc().onAndCancel(n,a.domEventName,c))}static parseEventName(n){const r=n.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const a=e._normalizeKey(r.pop());let c="",d=r.indexOf("code");if(d>-1&&(r.splice(d,1),c="code."),sk.forEach(v=>{const E=r.indexOf(v);E>-1&&(r.splice(E,1),c+=v+".")}),c+=a,0!=r.length||0===a.length)return null;const p={};return p.domEventName=i,p.fullKey=c,p}static matchEventFullKeyCode(n,r){let i=h9[n.key]||n.key,a="";return r.indexOf("code.")>-1&&(i=n.code,a="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),sk.forEach(c=>{c!==i&&(0,d9[c])(n)&&(a+=c+".")}),a+=i,a===r)}static eventCallback(n,r,i){return a=>{e.matchEventFullKeyCode(a,n)&&i.runGuarded(()=>r(a))}}static _normalizeKey(n){return"esc"===n?"escape":n}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();const y9=rA(YU,"browser",[{provide:Vw,useValue:"browser"},{provide:ZI,useValue:function p9(){xC.makeCurrent()},multi:!0},{provide:ss,useFactory:function g9(){return function x(e){_=e}(document),document},deps:[]}]),ck=new Tt(""),uk=[{provide:Bv,useClass:class t9{addToWindow(t){nr.getAngularTestability=(r,i=!0)=>{const a=t.findTestabilityInTree(r,i);if(null==a)throw new Error("Could not find testability for element.");return a},nr.getAllAngularTestabilities=()=>t.getAllTestabilities(),nr.getAllAngularRootElements=()=>t.getAllRootElements(),nr.frameworkStabilizers||(nr.frameworkStabilizers=[]),nr.frameworkStabilizers.push(r=>{const i=nr.getAllAngularTestabilities();let a=i.length,c=!1;const d=function(p){c=c||p,a--,0==a&&r(c)};i.forEach(function(p){p.whenStable(d)})})}findTestabilityInTree(t,n,r){return null==n?null:t.getTestability(n)??(r?dc().isShadowRoot(n)?this.findTestabilityInTree(t,n.host,!0):this.findTestabilityInTree(t,n.parentElement,!0):null)}},deps:[]},{provide:QI,useClass:Gw,deps:[Oi,qw,Bv]},{provide:Gw,useClass:Gw,deps:[Oi,qw,Bv]}],hk=[{provide:wh,useValue:"root"},{provide:Dp,useFactory:function m9(){return new Dp},deps:[]},{provide:a0,useClass:u9,multi:!0,deps:[ss,Oi,Vw]},{provide:a0,useClass:f9,multi:!0,deps:[ss]},{provide:EC,useClass:EC,deps:[l0,ly,ny]},{provide:F2,useExisting:EC},{provide:QA,useExisting:ly},{provide:ly,useClass:ly,deps:[ss]},{provide:l0,useClass:l0,deps:[a0,Oi]},{provide:qA,useClass:n9,deps:[]},[]];let _9=(()=>{class e{constructor(n){}static withServerTransition(n){return{ngModule:e,providers:[{provide:ny,useValue:n.appId},{provide:KA,useExisting:ny},e9]}}}return e.\u0275fac=function(n){return new(n||e)(St(ck,12))},e.\u0275mod=li({type:e}),e.\u0275inj=Di({providers:[...hk,...uk],imports:[jA,KU]}),e})(),dk=(()=>{class e{constructor(n){this._doc=n}getTitle(){return this._doc.title}setTitle(n){this._doc.title=n||""}}return e.\u0275fac=function(n){return new(n||e)(St(ss))},e.\u0275prov=zt({token:e,factory:function(n){let r=null;return r=n?new n:function b9(){return new dk(St(ss))}(),r},providedIn:"root"}),e})();function Bt(...e){return Cr(e,lr(e))}typeof window<"u"&&window;class _l extends pi{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const n=super._subscribe(t);return!n.closed&&t.next(this._value),n}getValue(){const{hasError:t,thrownError:n,_value:r}=this;if(t)throw n;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}}const u0=qh(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:T9}=Array,{getPrototypeOf:I9,prototype:A9,keys:k9}=Object;const{isArray:R9}=Array;function _k(...e){const t=lr(e),n=function Zn(e){return ar(an(e))?e.pop():void 0}(e),{args:r,keys:i}=function mk(e){if(1===e.length){const t=e[0];if(T9(t))return{args:t,keys:null};if(function P9(e){return e&&"object"==typeof e&&I9(e)===A9}(t)){const n=k9(t);return{args:n.map(r=>t[r]),keys:n}}}return{args:e,keys:null}}(e);if(0===r.length)return Cr([],t);const a=new Bn(function O9(e,t,n=Wr){return r=>{vk(t,()=>{const{length:i}=e,a=new Array(i);let c=i,d=i;for(let p=0;p{const v=Cr(e[p],t);let E=!1;v.subscribe(tr(r,D=>{a[p]=D,E||(E=!0,d--),d||r.next(n(a.slice()))},()=>{--c||r.complete()}))},r)},r)}}(r,t,i?c=>function yk(e,t){return e.reduce((n,r,i)=>(n[r]=t[i],n),{})}(i,c):Wr));return n?a.pipe(function gk(e){return Pe(t=>function F9(e,t){return R9(t)?e(...t):e(t)}(e,t))}(n)):a}function vk(e,t,n){e?Te(n,e,t):t()}function TC(...e){return function L9(){return dt(1)}()(Cr(e,lr(e)))}function bk(e){return new Bn(t=>{te(e()).subscribe(t)})}function cy(e,t){const n=ar(e)?e:()=>e,r=i=>i.error(n());return new Bn(t?i=>t.schedule(r,0,i):r)}function IC(){return yr((e,t)=>{let n=null;e._refCount++;const r=tr(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(n=null);const i=e._connection,a=n;n=null,i&&(!a||i===a)&&i.unsubscribe(),t.unsubscribe()});e.subscribe(r),r.closed||(n=e.connect())})}class xk extends Bn{constructor(t,n){super(),this.source=t,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,na(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new wr;const n=this.getSubject();t.add(this.source.subscribe(tr(n,void 0,()=>{this._teardown(),n.complete()},r=>{this._teardown(),n.error(r)},()=>this._teardown()))),t.closed&&(this._connection=null,t=wr.EMPTY)}return t}refCount(){return IC()(this)}}function fc(e,t){return yr((n,r)=>{let i=null,a=0,c=!1;const d=()=>c&&!i&&r.complete();n.subscribe(tr(r,p=>{i?.unsubscribe();let v=0;const E=a++;te(e(p,E)).subscribe(i=tr(r,D=>r.next(t?t(p,D,E,v++):D),()=>{i=null,d()}))},()=>{c=!0,d()}))})}function uy(e){return e<=0?()=>xt:yr((t,n)=>{let r=0;t.subscribe(tr(n,i=>{++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function uu(e,t){return yr((n,r)=>{let i=0;n.subscribe(tr(r,a=>e.call(t,a,i++)&&r.next(a)))})}function h0(e){return yr((t,n)=>{let r=!1;t.subscribe(tr(n,i=>{r=!0,n.next(i)},()=>{r||n.next(e),n.complete()}))})}function wk(e=z9){return yr((t,n)=>{let r=!1;t.subscribe(tr(n,i=>{r=!0,n.next(i)},()=>r?n.complete():n.error(e())))})}function z9(){return new u0}function Ih(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,a)=>e(i,a,r)):Wr,uy(1),n?h0(t):wk(()=>new u0))}function Ah(e,t){return ar(t)?ht(e,t,1):ht(e,1)}function Uo(e,t,n){const r=ar(e)||t||n?{next:e,error:t,complete:n}:e;return r?yr((i,a)=>{var c;null===(c=r.subscribe)||void 0===c||c.call(r);let d=!0;i.subscribe(tr(a,p=>{var v;null===(v=r.next)||void 0===v||v.call(r,p),a.next(p)},()=>{var p;d=!1,null===(p=r.complete)||void 0===p||p.call(r),a.complete()},p=>{var v;d=!1,null===(v=r.error)||void 0===v||v.call(r,p),a.error(p)},()=>{var p,v;d&&(null===(p=r.unsubscribe)||void 0===p||p.call(r)),null===(v=r.finalize)||void 0===v||v.call(r)}))}):Wr}function kh(e){return yr((t,n)=>{let a,r=null,i=!1;r=t.subscribe(tr(n,void 0,void 0,c=>{a=te(e(c,kh(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function B9(e,t,n,r,i){return(a,c)=>{let d=n,p=t,v=0;a.subscribe(tr(c,E=>{const D=v++;p=d?e(p,E,D):(d=!0,E),r&&c.next(p)},i&&(()=>{d&&c.next(p),c.complete()})))}}function Ck(e,t){return yr(B9(e,t,arguments.length>=2,!0))}function AC(e){return e<=0?()=>xt:yr((t,n)=>{let r=[];t.subscribe(tr(n,i=>{r.push(i),e{for(const i of r)n.next(i);n.complete()},void 0,()=>{r=null}))})}function Ek(e,t){const n=arguments.length>=2;return r=>r.pipe(e?uu((i,a)=>e(i,a,r)):Wr,AC(1),n?h0(t):wk(()=>new u0))}function kC(e){return yr((t,n)=>{try{t.subscribe(n)}finally{n.add(e)}})}const vn="primary",hy=Symbol("RouteTitle");class $9{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n[0]:n}return null}getAll(t){if(this.has(t)){const n=this.params[t];return Array.isArray(n)?n:[n]}return[]}get keys(){return Object.keys(this.params)}}function qp(e){return new $9(e)}function j9(e,t,n){const r=n.path.split("/");if(r.length>e.length||"full"===n.pathMatch&&(t.hasChildren()||r.lengthr[a]===i)}return e===t}function Sk(e){return Array.prototype.concat.apply([],e)}function Mk(e){return e.length>0?e[e.length-1]:null}function Eo(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function Ph(e){return pw(e)?e:Gg(e)?Cr(Promise.resolve(e)):Bt(e)}const q9={exact:function Ak(e,t,n){if(!sf(e.segments,t.segments)||!d0(e.segments,t.segments,n)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const r in t.children)if(!e.children[r]||!Ak(e.children[r],t.children[r],n))return!1;return!0},subset:kk},Tk={exact:function Z9(e,t){return pc(e,t)},subset:function W9(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>Dk(e[n],t[n]))},ignored:()=>!0};function Ik(e,t,n){return q9[n.paths](e.root,t.root,n.matrixParams)&&Tk[n.queryParams](e.queryParams,t.queryParams)&&!("exact"===n.fragment&&e.fragment!==t.fragment)}function kk(e,t,n){return Pk(e,t,t.segments,n)}function Pk(e,t,n,r){if(e.segments.length>n.length){const i=e.segments.slice(0,n.length);return!(!sf(i,n)||t.hasChildren()||!d0(i,n,r))}if(e.segments.length===n.length){if(!sf(e.segments,n)||!d0(e.segments,n,r))return!1;for(const i in t.children)if(!e.children[i]||!kk(e.children[i],t.children[i],r))return!1;return!0}{const i=n.slice(0,e.segments.length),a=n.slice(e.segments.length);return!!(sf(e.segments,i)&&d0(e.segments,i,r)&&e.children[vn])&&Pk(e.children[vn],t,a,r)}}function d0(e,t,n){return t.every((r,i)=>Tk[n](e[i].parameters,r.parameters))}class rf{constructor(t,n,r){this.root=t,this.queryParams=n,this.fragment=r}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=qp(this.queryParams)),this._queryParamMap}toString(){return K9.serialize(this)}}class En{constructor(t,n){this.segments=t,this.children=n,this.parent=null,Eo(n,(r,i)=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return f0(this)}}class dy{constructor(t,n){this.path=t,this.parameters=n}get parameterMap(){return this._parameterMap||(this._parameterMap=qp(this.parameters)),this._parameterMap}toString(){return Lk(this)}}function sf(e,t){return e.length===t.length&&e.every((n,r)=>n.path===t[r].path)}let Rk=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:function(){return new RC},providedIn:"root"}),e})();class RC{parse(t){const n=new sj(t);return new rf(n.parseRootSegment(),n.parseQueryParams(),n.parseFragment())}serialize(t){const n=`/${fy(t.root,!0)}`,r=function ej(e){const t=Object.keys(e).map(n=>{const r=e[n];return Array.isArray(r)?r.map(i=>`${p0(n)}=${p0(i)}`).join("&"):`${p0(n)}=${p0(r)}`}).filter(n=>!!n);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${n}${r}${"string"==typeof t.fragment?`#${function J9(e){return encodeURI(e)}(t.fragment)}`:""}`}}const K9=new RC;function f0(e){return e.segments.map(t=>Lk(t)).join("/")}function fy(e,t){if(!e.hasChildren())return f0(e);if(t){const n=e.children[vn]?fy(e.children[vn],!1):"",r=[];return Eo(e.children,(i,a)=>{a!==vn&&r.push(`${a}:${fy(i,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=function Y9(e,t){let n=[];return Eo(e.children,(r,i)=>{i===vn&&(n=n.concat(t(r,i)))}),Eo(e.children,(r,i)=>{i!==vn&&(n=n.concat(t(r,i)))}),n}(e,(r,i)=>i===vn?[fy(e.children[vn],!1)]:[`${i}:${fy(r,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[vn]?`${f0(e)}/${n[0]}`:`${f0(e)}/(${n.join("//")})`}}function Fk(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function p0(e){return Fk(e).replace(/%3B/gi,";")}function FC(e){return Fk(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function m0(e){return decodeURIComponent(e)}function Ok(e){return m0(e.replace(/\+/g,"%20"))}function Lk(e){return`${FC(e.path)}${function Q9(e){return Object.keys(e).map(t=>`;${FC(t)}=${FC(e[t])}`).join("")}(e.parameters)}`}const tj=/^[^\/()?;=#]+/;function g0(e){const t=e.match(tj);return t?t[0]:""}const nj=/^[^=?&#]+/,ij=/^[^&#]+/;class sj{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new En([],{}):new En([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let n={};this.peekStartsWith("/(")&&(this.capture("/"),n=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(t.length>0||Object.keys(n).length>0)&&(r[vn]=new En(t,n)),r}parseSegment(){const t=g0(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new nt(4009,!1);return this.capture(t),new dy(m0(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const n=g0(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const i=g0(this.remaining);i&&(r=i,this.capture(r))}t[m0(n)]=m0(r)}parseQueryParam(t){const n=function rj(e){const t=e.match(nj);return t?t[0]:""}(this.remaining);if(!n)return;this.capture(n);let r="";if(this.consumeOptional("=")){const c=function oj(e){const t=e.match(ij);return t?t[0]:""}(this.remaining);c&&(r=c,this.capture(r))}const i=Ok(n),a=Ok(r);if(t.hasOwnProperty(i)){let c=t[i];Array.isArray(c)||(c=[c],t[i]=c),c.push(a)}else t[i]=a}parseParens(t){const n={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=g0(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new nt(4010,!1);let a;r.indexOf(":")>-1?(a=r.slice(0,r.indexOf(":")),this.capture(a),this.capture(":")):t&&(a=vn);const c=this.parseChildren();n[a]=1===Object.keys(c).length?c[vn]:new En([],c),this.consumeOptional("//")}return n}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new nt(4011,!1)}}function OC(e){return e.segments.length>0?new En([],{[vn]:e}):e}function y0(e){const t={};for(const r of Object.keys(e.children)){const a=y0(e.children[r]);(a.segments.length>0||a.hasChildren())&&(t[r]=a)}return function aj(e){if(1===e.numberOfChildren&&e.children[vn]){const t=e.children[vn];return new En(e.segments.concat(t.segments),t.children)}return e}(new En(e.segments,t))}function af(e){return e instanceof rf}function uj(e,t,n,r,i){if(0===n.length)return Zp(t.root,t.root,t.root,r,i);const a=function Bk(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new zk(!0,0,e);let t=0,n=!1;const r=e.reduce((i,a,c)=>{if("object"==typeof a&&null!=a){if(a.outlets){const d={};return Eo(a.outlets,(p,v)=>{d[v]="string"==typeof p?p.split("/"):p}),[...i,{outlets:d}]}if(a.segmentPath)return[...i,a.segmentPath]}return"string"!=typeof a?[...i,a]:0===c?(a.split("/").forEach((d,p)=>{0==p&&"."===d||(0==p&&""===d?n=!0:".."===d?t++:""!=d&&i.push(d))}),i):[...i,a]},[]);return new zk(n,t,r)}(n);return a.toRoot()?Zp(t.root,t.root,new En([],{}),r,i):function c(p){const v=function dj(e,t,n,r){if(e.isAbsolute)return new Wp(t.root,!0,0);if(-1===r)return new Wp(n,n===t.root,0);return function Vk(e,t,n){let r=e,i=t,a=n;for(;a>i;){if(a-=i,r=r.parent,!r)throw new nt(4005,!1);i=r.segments.length}return new Wp(r,!1,i-a)}(n,r+(py(e.commands[0])?0:1),e.numberOfDoubleDots)}(a,t,e.snapshot?._urlSegment,p),E=v.processChildren?gy(v.segmentGroup,v.index,a.commands):NC(v.segmentGroup,v.index,a.commands);return Zp(t.root,v.segmentGroup,E,r,i)}(e.snapshot?._lastPathIndex)}function py(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function my(e){return"object"==typeof e&&null!=e&&e.outlets}function Zp(e,t,n,r,i){let c,a={};r&&Eo(r,(p,v)=>{a[v]=Array.isArray(p)?p.map(E=>`${E}`):`${p}`}),c=e===t?n:Nk(e,t,n);const d=OC(y0(c));return new rf(d,a,i)}function Nk(e,t,n){const r={};return Eo(e.children,(i,a)=>{r[a]=i===t?n:Nk(i,t,n)}),new En(e.segments,r)}class zk{constructor(t,n,r){if(this.isAbsolute=t,this.numberOfDoubleDots=n,this.commands=r,t&&r.length>0&&py(r[0]))throw new nt(4003,!1);const i=r.find(my);if(i&&i!==Mk(r))throw new nt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Wp{constructor(t,n,r){this.segmentGroup=t,this.processChildren=n,this.index=r}}function NC(e,t,n){if(e||(e=new En([],{})),0===e.segments.length&&e.hasChildren())return gy(e,t,n);const r=function pj(e,t,n){let r=0,i=t;const a={match:!1,pathIndex:0,commandIndex:0};for(;i=n.length)return a;const c=e.segments[i],d=n[r];if(my(d))break;const p=`${d}`,v=r0&&void 0===p)break;if(p&&v&&"object"==typeof v&&void 0===v.outlets){if(!$k(p,v,c))return a;r+=2}else{if(!$k(p,{},c))return a;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex{"string"==typeof a&&(a=[a]),null!==a&&(i[c]=NC(e.children[c],t,a))}),Eo(e.children,(a,c)=>{void 0===r[c]&&(i[c]=a)}),new En(e.segments,i)}}function zC(e,t,n){const r=e.segments.slice(0,t);let i=0;for(;i{"string"==typeof n&&(n=[n]),null!==n&&(t[r]=zC(new En([],{}),0,n))}),t}function Uk(e){const t={};return Eo(e,(n,r)=>t[r]=`${n}`),t}function $k(e,t,n){return e==n.path&&pc(t,n.parameters)}class hu{constructor(t,n){this.id=t,this.url=n}}class BC extends hu{constructor(t,n,r="imperative",i=null){super(t,n),this.type=0,this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class lf extends hu{constructor(t,n,r){super(t,n),this.urlAfterRedirects=r,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class _0 extends hu{constructor(t,n,r,i){super(t,n),this.reason=r,this.code=i,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class jk extends hu{constructor(t,n,r,i){super(t,n),this.error=r,this.target=i,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class gj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class yj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class _j extends hu{constructor(t,n,r,i,a){super(t,n),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=a,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class vj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class bj extends hu{constructor(t,n,r,i){super(t,n),this.urlAfterRedirects=r,this.state=i,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class xj{constructor(t){this.route=t,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class wj{constructor(t){this.route=t,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Cj{constructor(t){this.snapshot=t,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ej{constructor(t){this.snapshot=t,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Dj{constructor(t){this.snapshot=t,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Sj{constructor(t){this.snapshot=t,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Hk{constructor(t,n,r){this.routerEvent=t,this.position=n,this.anchor=r,this.type=15}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class Gk{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const n=this.pathFromRoot(t);return n.length>1?n[n.length-2]:null}children(t){const n=VC(t,this._root);return n?n.children.map(r=>r.value):[]}firstChild(t){const n=VC(t,this._root);return n&&n.children.length>0?n.children[0].value:null}siblings(t){const n=UC(t,this._root);return n.length<2?[]:n[n.length-2].children.map(i=>i.value).filter(i=>i!==t)}pathFromRoot(t){return UC(t,this._root).map(n=>n.value)}}function VC(e,t){if(e===t.value)return t;for(const n of t.children){const r=VC(e,n);if(r)return r}return null}function UC(e,t){if(e===t.value)return[t];for(const n of t.children){const r=UC(e,n);if(r.length)return r.unshift(t),r}return[]}class du{constructor(t,n){this.value=t,this.children=n}toString(){return`TreeNode(${this.value})`}}function Xp(e){const t={};return e&&e.children.forEach(n=>t[n.value.outlet]=n),t}class qk extends Gk{constructor(t,n){super(t),this.snapshot=n,$C(this,t)}toString(){return this.snapshot.toString()}}function Zk(e,t){const n=function Tj(e,t){const c=new v0([],{},{},"",{},vn,t,null,e.root,-1,{});return new Xk("",new du(c,[]))}(e,t),r=new _l([new dy("",{})]),i=new _l({}),a=new _l({}),c=new _l({}),d=new _l(""),p=new cf(r,i,c,d,a,vn,t,n.root);return p.snapshot=n.root,new qk(new du(p,[]),n)}class cf{constructor(t,n,r,i,a,c,d,p){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=a,this.outlet=c,this.component=d,this.title=this.data?.pipe(Pe(v=>v[hy]))??Bt(void 0),this._futureSnapshot=p}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Pe(t=>qp(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Pe(t=>qp(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Wk(e,t="emptyOnly"){const n=e.pathFromRoot;let r=0;if("always"!==t)for(r=n.length-1;r>=1;){const i=n[r],a=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(a.component)break;r--}}return function Ij(e){return e.reduce((t,n)=>({params:{...t.params,...n.params},data:{...t.data,...n.data},resolve:{...n.data,...t.resolve,...n.routeConfig?.data,...n._resolvedData}}),{params:{},data:{},resolve:{}})}(n.slice(r))}class v0{constructor(t,n,r,i,a,c,d,p,v,E,D,T){this.url=t,this.params=n,this.queryParams=r,this.fragment=i,this.data=a,this.outlet=c,this.component=d,this.title=this.data?.[hy],this.routeConfig=p,this._urlSegment=v,this._lastPathIndex=E,this._correctedLastPathIndex=T??E,this._resolve=D}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=qp(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=qp(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Xk extends Gk{constructor(t,n){super(n),this.url=t,$C(this,n)}toString(){return Yk(this._root)}}function $C(e,t){t.value._routerState=e,t.children.forEach(n=>$C(e,n))}function Yk(e){const t=e.children.length>0?` { ${e.children.map(Yk).join(", ")} } `:"";return`${e.value}${t}`}function jC(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,pc(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),pc(t.params,n.params)||e.params.next(n.params),function H9(e,t){if(e.length!==t.length)return!1;for(let n=0;npc(n.parameters,t[r].parameters))}(e.url,t.url);return n&&!(!e.parent!=!t.parent)&&(!e.parent||HC(e.parent,t.parent))}function yy(e,t,n){if(n&&e.shouldReuseRoute(t.value,n.value.snapshot)){const r=n.value;r._futureSnapshot=t.value;const i=function kj(e,t,n){return t.children.map(r=>{for(const i of n.children)if(e.shouldReuseRoute(r.value,i.value.snapshot))return yy(e,r,i);return yy(e,r)})}(e,t,n);return new du(r,i)}{if(e.shouldAttach(t.value)){const a=e.retrieve(t.value);if(null!==a){const c=a.route;return c.value._futureSnapshot=t.value,c.children=t.children.map(d=>yy(e,d)),c}}const r=function Pj(e){return new cf(new _l(e.url),new _l(e.params),new _l(e.queryParams),new _l(e.fragment),new _l(e.data),e.outlet,e.component,e)}(t.value),i=t.children.map(a=>yy(e,a));return new du(r,i)}}const GC="ngNavigationCancelingError";function Kk(e,t){const{redirectTo:n,navigationBehaviorOptions:r}=af(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,i=Jk(!1,0,t);return i.url=n,i.navigationBehaviorOptions=r,i}function Jk(e,t,n){const r=new Error("NavigationCancelingError: "+(e||""));return r[GC]=!0,r.cancellationCode=t,n&&(r.url=n),r}function Qk(e){return eP(e)&&af(e.url)}function eP(e){return e&&e[GC]}class Rj{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.injector=null,this.children=new _y,this.attachRef=null}}let _y=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(n,r){const i=this.getOrCreateContext(n);i.outlet=r,this.contexts.set(n,i)}onChildOutletDestroyed(n){const r=this.getContext(n);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const n=this.contexts;return this.contexts=new Map,n}onOutletReAttached(n){this.contexts=n}getOrCreateContext(n){let r=this.getContext(n);return r||(r=new Rj,this.contexts.set(n,r)),r}getContext(n){return this.contexts.get(n)||null}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const b0=!1;let tP=(()=>{class e{constructor(n,r,i,a,c){this.parentContexts=n,this.location=r,this.changeDetector=a,this.environmentInjector=c,this.activated=null,this._activatedRoute=null,this.activateEvents=new ti,this.deactivateEvents=new ti,this.attachEvents=new ti,this.detachEvents=new ti,this.name=i||vn,n.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.getContext(this.name)?.outlet===this&&this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const n=this.parentContexts.getContext(this.name);n&&n.route&&(n.attachRef?this.attach(n.attachRef,n.route):this.activateWith(n.route,n.injector))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new nt(4012,b0);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new nt(4012,b0);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new nt(4012,b0);this.location.detach();const n=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(n.instance),n}attach(n,r){this.activated=n,this._activatedRoute=r,this.location.insert(n.hostView),this.attachEvents.emit(n.instance)}deactivate(){if(this.activated){const n=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(n)}}activateWith(n,r){if(this.isActivated)throw new nt(4013,b0);this._activatedRoute=n;const i=this.location,c=n._futureSnapshot.component,d=this.parentContexts.getOrCreateContext(this.name).children,p=new Fj(n,d,i.injector);if(r&&function Oj(e){return!!e.resolveComponentFactory}(r)){const v=r.resolveComponentFactory(c);this.activated=i.createComponent(v,i.length,p)}else this.activated=i.createComponent(c,{index:i.length,injector:p,environmentInjector:r??this.environmentInjector});this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return e.\u0275fac=function(n){return new(n||e)(qe(_y),qe(pl),function Dd(e){return function qm(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let i=0;for(;i{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=zs({type:e,selectors:[["ng-component"]],standalone:!0,features:[lI],decls:1,vars:0,template:function(n,r){1&n&&xa(0,"router-outlet")},dependencies:[tP],encapsulation:2}),e})();function nP(e,t){return e.providers&&!e._injector&&(e._injector=Av(e.providers,t,`Route: ${e.path}`)),e._injector??t}function WC(e){const t=e.children&&e.children.map(WC),n=t?{...e,children:t}:{...e};return!n.component&&!n.loadComponent&&(t||n.loadChildren)&&n.outlet&&n.outlet!==vn&&(n.component=qC),n}function Ea(e){return e.outlet||vn}function rP(e,t){const n=e.filter(r=>Ea(r)===t);return n.push(...e.filter(r=>Ea(r)!==t)),n}function vy(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const n=t.routeConfig;if(n?._loadedInjector)return n._loadedInjector;if(n?._injector)return n._injector}return null}class Vj{constructor(t,n,r,i){this.routeReuseStrategy=t,this.futureState=n,this.currState=r,this.forwardEvent=i}activate(t){const n=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(n,r,t),jC(this.futureState.root),this.activateChildRoutes(n,r,t)}deactivateChildRoutes(t,n,r){const i=Xp(n);t.children.forEach(a=>{const c=a.value.outlet;this.deactivateRoutes(a,i[c],r),delete i[c]}),Eo(i,(a,c)=>{this.deactivateRouteAndItsChildren(a,r)})}deactivateRoutes(t,n,r){const i=t.value,a=n?n.value:null;if(i===a)if(i.component){const c=r.getContext(i.outlet);c&&this.deactivateChildRoutes(t,n,c.children)}else this.deactivateChildRoutes(t,n,r);else a&&this.deactivateRouteAndItsChildren(n,r)}deactivateRouteAndItsChildren(t,n){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,n):this.deactivateRouteAndOutlet(t,n)}detachAndStoreRouteSubtree(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,a=Xp(t);for(const c of Object.keys(a))this.deactivateRouteAndItsChildren(a[c],i);if(r&&r.outlet){const c=r.outlet.detach(),d=r.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:c,route:t,contexts:d})}}deactivateRouteAndOutlet(t,n){const r=n.getContext(t.value.outlet),i=r&&t.value.component?r.children:n,a=Xp(t);for(const c of Object.keys(a))this.deactivateRouteAndItsChildren(a[c],i);r&&r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated(),r.attachRef=null,r.resolver=null,r.route=null)}activateChildRoutes(t,n,r){const i=Xp(n);t.children.forEach(a=>{this.activateRoutes(a,i[a.value.outlet],r),this.forwardEvent(new Sj(a.value.snapshot))}),t.children.length&&this.forwardEvent(new Ej(t.value.snapshot))}activateRoutes(t,n,r){const i=t.value,a=n?n.value:null;if(jC(i),i===a)if(i.component){const c=r.getOrCreateContext(i.outlet);this.activateChildRoutes(t,n,c.children)}else this.activateChildRoutes(t,n,r);else if(i.component){const c=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const d=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),c.children.onOutletReAttached(d.contexts),c.attachRef=d.componentRef,c.route=d.route.value,c.outlet&&c.outlet.attach(d.componentRef,d.route.value),jC(d.route.value),this.activateChildRoutes(t,null,c.children)}else{const d=vy(i.snapshot),p=d?.get(Bg)??null;c.attachRef=null,c.route=i,c.resolver=p,c.injector=d,c.outlet&&c.outlet.activateWith(i,c.injector),this.activateChildRoutes(t,null,c.children)}}else this.activateChildRoutes(t,null,r)}}class iP{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class x0{constructor(t,n){this.component=t,this.route=n}}function Uj(e,t,n){const r=e._root;return by(r,t?t._root:null,n,[r.value])}function Yp(e,t){const n=Symbol(),r=t.get(e,n);return r===n?"function"!=typeof e||function ed(e){return null!==Uu(e)}(e)?t.get(e):e:r}function by(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const a=Xp(t);return e.children.forEach(c=>{(function jj(e,t,n,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const a=e.value,c=t?t.value:null,d=n?n.getContext(e.value.outlet):null;if(c&&a.routeConfig===c.routeConfig){const p=function Hj(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!sf(e.url,t.url);case"pathParamsOrQueryParamsChange":return!sf(e.url,t.url)||!pc(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!HC(e,t)||!pc(e.queryParams,t.queryParams);default:return!HC(e,t)}}(c,a,a.routeConfig.runGuardsAndResolvers);p?i.canActivateChecks.push(new iP(r)):(a.data=c.data,a._resolvedData=c._resolvedData),by(e,t,a.component?d?d.children:null:n,r,i),p&&d&&d.outlet&&d.outlet.isActivated&&i.canDeactivateChecks.push(new x0(d.outlet.component,c))}else c&&xy(t,d,i),i.canActivateChecks.push(new iP(r)),by(e,null,a.component?d?d.children:null:n,r,i)})(c,a[c.value.outlet],n,r.concat([c.value]),i),delete a[c.value.outlet]}),Eo(a,(c,d)=>xy(c,n.getContext(d),i)),i}function xy(e,t,n){const r=Xp(e),i=e.value;Eo(r,(a,c)=>{xy(a,i.component?t?t.children.getContext(c):null:t,n)}),n.canDeactivateChecks.push(new x0(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))}function wy(e){return"function"==typeof e}function XC(e){return e instanceof u0||"EmptyError"===e?.name}const w0=Symbol("INITIAL_VALUE");function Kp(){return fc(e=>_k(e.map(t=>t.pipe(uy(1),function N9(...e){const t=lr(e);return yr((n,r)=>{(t?TC(e,n,t):TC(e,n)).subscribe(r)})}(w0)))).pipe(Pe(t=>{for(const n of t)if(!0!==n){if(n===w0)return w0;if(!1===n||n instanceof rf)return n}return!0}),uu(t=>t!==w0),uy(1)))}function oP(e){return function Fa(...e){return Os(e)}(Uo(t=>{if(af(t))throw Kk(0,t)}),Pe(t=>!0===t))}const YC={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function sP(e,t,n,r,i){const a=KC(e,t,n);return a.matched?function aH(e,t,n,r){const i=t.canMatch;return i&&0!==i.length?Bt(i.map(c=>{const d=Yp(c,e);return Ph(function Yj(e){return e&&wy(e.canMatch)}(d)?d.canMatch(t,n):e.runInContext(()=>d(t,n)))})).pipe(Kp(),oP()):Bt(!0)}(r=nP(t,r),t,n).pipe(Pe(c=>!0===c?a:{...YC})):Bt(a)}function KC(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{...YC}:{matched:!0,consumedSegments:[],remainingSegments:n,parameters:{},positionalParamSegments:{}};const i=(t.matcher||j9)(n,e,t);if(!i)return{...YC};const a={};Eo(i.posParams,(d,p)=>{a[p]=d.path});const c=i.consumed.length>0?{...a,...i.consumed[i.consumed.length-1].parameters}:a;return{matched:!0,consumedSegments:i.consumed,remainingSegments:n.slice(i.consumed.length),parameters:c,positionalParamSegments:i.posParams??{}}}function C0(e,t,n,r,i="corrected"){if(n.length>0&&function uH(e,t,n){return n.some(r=>E0(e,t,r)&&Ea(r)!==vn)}(e,n,r)){const c=new En(t,function cH(e,t,n,r){const i={};i[vn]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;for(const a of n)if(""===a.path&&Ea(a)!==vn){const c=new En([],{});c._sourceSegment=e,c._segmentIndexShift=t.length,i[Ea(a)]=c}return i}(e,t,r,new En(n,e.children)));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:[]}}if(0===n.length&&function hH(e,t,n){return n.some(r=>E0(e,t,r))}(e,n,r)){const c=new En(e.segments,function lH(e,t,n,r,i,a){const c={};for(const d of r)if(E0(e,n,d)&&!i[Ea(d)]){const p=new En([],{});p._sourceSegment=e,p._segmentIndexShift="legacy"===a?e.segments.length:t.length,c[Ea(d)]=p}return{...i,...c}}(e,t,n,r,e.children,i));return c._sourceSegment=e,c._segmentIndexShift=t.length,{segmentGroup:c,slicedSegments:n}}const a=new En(e.segments,e.children);return a._sourceSegment=e,a._segmentIndexShift=t.length,{segmentGroup:a,slicedSegments:n}}function E0(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path}function aP(e,t,n,r){return!!(Ea(e)===r||r!==vn&&E0(t,n,e))&&("**"===e.path||KC(t,e,n).matched)}function lP(e,t,n){return 0===t.length&&!e.children[n]}const D0=!1;class S0{constructor(t){this.segmentGroup=t||null}}class cP{constructor(t){this.urlTree=t}}function Cy(e){return cy(new S0(e))}function uP(e){return cy(new cP(e))}class mH{constructor(t,n,r,i,a){this.injector=t,this.configLoader=n,this.urlSerializer=r,this.urlTree=i,this.config=a,this.allowRedirects=!0}apply(){const t=C0(this.urlTree.root,[],[],this.config).segmentGroup,n=new En(t.segments,t.children);return this.expandSegmentGroup(this.injector,this.config,n,vn).pipe(Pe(a=>this.createUrlTree(y0(a),this.urlTree.queryParams,this.urlTree.fragment))).pipe(kh(a=>{if(a instanceof cP)return this.allowRedirects=!1,this.match(a.urlTree);throw a instanceof S0?this.noMatchError(a):a}))}match(t){return this.expandSegmentGroup(this.injector,this.config,t.root,vn).pipe(Pe(i=>this.createUrlTree(y0(i),t.queryParams,t.fragment))).pipe(kh(i=>{throw i instanceof S0?this.noMatchError(i):i}))}noMatchError(t){return new nt(4002,D0)}createUrlTree(t,n,r){const i=OC(t);return new rf(i,n,r)}expandSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.expandChildren(t,n,r).pipe(Pe(a=>new En([],a))):this.expandSegment(t,r,n,r.segments,i,!0)}expandChildren(t,n,r){const i=[];for(const a of Object.keys(r.children))"primary"===a?i.unshift(a):i.push(a);return Cr(i).pipe(Ah(a=>{const c=r.children[a],d=rP(n,a);return this.expandSegmentGroup(t,d,c,a).pipe(Pe(p=>({segment:p,outlet:a})))}),Ck((a,c)=>(a[c.outlet]=c.segment,a),{}),Ek())}expandSegment(t,n,r,i,a,c){return Cr(r).pipe(Ah(d=>this.expandSegmentAgainstRoute(t,n,r,d,i,a,c).pipe(kh(v=>{if(v instanceof S0)return Bt(null);throw v}))),Ih(d=>!!d),kh((d,p)=>{if(XC(d))return lP(n,i,a)?Bt(new En([],{})):Cy(n);throw d}))}expandSegmentAgainstRoute(t,n,r,i,a,c,d){return aP(i,n,a,c)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,n,i,a,c):d&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,n,r,i,a,c):Cy(n):Cy(n)}expandSegmentAgainstRouteUsingRedirect(t,n,r,i,a,c){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,r,i,c):this.expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,a,c)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,i){const a=this.applyRedirectCommands([],r.redirectTo,{});return r.redirectTo.startsWith("/")?uP(a):this.lineralizeSegments(r,a).pipe(ht(c=>{const d=new En(c,{});return this.expandSegment(t,d,n,c,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,n,r,i,a,c){const{matched:d,consumedSegments:p,remainingSegments:v,positionalParamSegments:E}=KC(n,i,a);if(!d)return Cy(n);const D=this.applyRedirectCommands(p,i.redirectTo,E);return i.redirectTo.startsWith("/")?uP(D):this.lineralizeSegments(i,D).pipe(ht(T=>this.expandSegment(t,n,r,T.concat(v),c,!1)))}matchSegmentAgainstRoute(t,n,r,i,a){return"**"===r.path?(t=nP(r,t),r.loadChildren?(r._loadedRoutes?Bt({routes:r._loadedRoutes,injector:r._loadedInjector}):this.configLoader.loadChildren(t,r)).pipe(Pe(d=>(r._loadedRoutes=d.routes,r._loadedInjector=d.injector,new En(i,{})))):Bt(new En(i,{}))):sP(n,r,i,t).pipe(fc(({matched:c,consumedSegments:d,remainingSegments:p})=>c?this.getChildConfig(t=r._injector??t,r,i).pipe(ht(E=>{const D=E.injector??t,T=E.routes,{segmentGroup:P,slicedSegments:N}=C0(n,d,p,T),G=new En(P.segments,P.children);if(0===N.length&&G.hasChildren())return this.expandChildren(D,T,G).pipe(Pe(X=>new En(d,X)));if(0===T.length&&0===N.length)return Bt(new En(d,{}));const U=Ea(r)===a;return this.expandSegment(D,G,T,N,U?vn:a,!0).pipe(Pe(ne=>new En(d.concat(ne.segments),ne.children)))})):Cy(n)))}getChildConfig(t,n,r){return n.children?Bt({routes:n.children,injector:t}):n.loadChildren?void 0!==n._loadedRoutes?Bt({routes:n._loadedRoutes,injector:n._loadedInjector}):function sH(e,t,n,r){const i=t.canLoad;return void 0===i||0===i.length?Bt(!0):Bt(i.map(c=>{const d=Yp(c,e);return Ph(function qj(e){return e&&wy(e.canLoad)}(d)?d.canLoad(t,n):e.runInContext(()=>d(t,n)))})).pipe(Kp(),oP())}(t,n,r).pipe(ht(i=>i?this.configLoader.loadChildren(t,n).pipe(Uo(a=>{n._loadedRoutes=a.routes,n._loadedInjector=a.injector})):function fH(e){return cy(Jk(D0,3))}())):Bt({routes:[],injector:t})}lineralizeSegments(t,n){let r=[],i=n.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return Bt(r);if(i.numberOfChildren>1||!i.children[vn])return cy(new nt(4e3,D0));i=i.children[vn]}}applyRedirectCommands(t,n,r){return this.applyRedirectCreateUrlTree(n,this.urlSerializer.parse(n),t,r)}applyRedirectCreateUrlTree(t,n,r,i){const a=this.createSegmentGroup(t,n.root,r,i);return new rf(a,this.createQueryParams(n.queryParams,this.urlTree.queryParams),n.fragment)}createQueryParams(t,n){const r={};return Eo(t,(i,a)=>{if("string"==typeof i&&i.startsWith(":")){const d=i.substring(1);r[a]=n[d]}else r[a]=i}),r}createSegmentGroup(t,n,r,i){const a=this.createSegments(t,n.segments,r,i);let c={};return Eo(n.children,(d,p)=>{c[p]=this.createSegmentGroup(t,d,r,i)}),new En(a,c)}createSegments(t,n,r,i){return n.map(a=>a.path.startsWith(":")?this.findPosParam(t,a,i):this.findOrReturn(a,r))}findPosParam(t,n,r){const i=r[n.path.substring(1)];if(!i)throw new nt(4001,D0);return i}findOrReturn(t,n){let r=0;for(const i of n){if(i.path===t.path)return n.splice(r),i;r++}return t}}class yH{}class bH{constructor(t,n,r,i,a,c,d,p){this.injector=t,this.rootComponentType=n,this.config=r,this.urlTree=i,this.url=a,this.paramsInheritanceStrategy=c,this.relativeLinkResolution=d,this.urlSerializer=p}recognize(){const t=C0(this.urlTree.root,[],[],this.config.filter(n=>void 0===n.redirectTo),this.relativeLinkResolution).segmentGroup;return this.processSegmentGroup(this.injector,this.config,t,vn).pipe(Pe(n=>{if(null===n)return null;const r=new v0([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},vn,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new du(r,n),a=new Xk(this.url,i);return this.inheritParamsAndData(a._root),a}))}inheritParamsAndData(t){const n=t.value,r=Wk(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach(i=>this.inheritParamsAndData(i))}processSegmentGroup(t,n,r,i){return 0===r.segments.length&&r.hasChildren()?this.processChildren(t,n,r):this.processSegment(t,n,r,r.segments,i)}processChildren(t,n,r){return Cr(Object.keys(r.children)).pipe(Ah(i=>{const a=r.children[i],c=rP(n,i);return this.processSegmentGroup(t,c,a,i)}),Ck((i,a)=>i&&a?(i.push(...a),i):null),function V9(e,t=!1){return yr((n,r)=>{let i=0;n.subscribe(tr(r,a=>{const c=e(a,i++);(c||t)&&r.next(a),!c&&r.complete()}))})}(i=>null!==i),h0(null),Ek(),Pe(i=>{if(null===i)return null;const a=hP(i);return function xH(e){e.sort((t,n)=>t.value.outlet===vn?-1:n.value.outlet===vn?1:t.value.outlet.localeCompare(n.value.outlet))}(a),a}))}processSegment(t,n,r,i,a){return Cr(n).pipe(Ah(c=>this.processSegmentAgainstRoute(c._injector??t,c,r,i,a)),Ih(c=>!!c),kh(c=>{if(XC(c))return lP(r,i,a)?Bt([]):Bt(null);throw c}))}processSegmentAgainstRoute(t,n,r,i,a){if(n.redirectTo||!aP(n,r,i,a))return Bt(null);let c;if("**"===n.path){const d=i.length>0?Mk(i).parameters:{},p=fP(r)+i.length;c=Bt({snapshot:new v0(i,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,mP(n),Ea(n),n.component??n._loadedComponent??null,n,dP(r),p,gP(n),p),consumedSegments:[],remainingSegments:[]})}else c=sP(r,n,i,t).pipe(Pe(({matched:d,consumedSegments:p,remainingSegments:v,parameters:E})=>{if(!d)return null;const D=fP(r)+p.length;return{snapshot:new v0(p,E,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,mP(n),Ea(n),n.component??n._loadedComponent??null,n,dP(r),D,gP(n),D),consumedSegments:p,remainingSegments:v}}));return c.pipe(fc(d=>{if(null===d)return Bt(null);const{snapshot:p,consumedSegments:v,remainingSegments:E}=d;t=n._injector??t;const D=n._loadedInjector??t,T=function wH(e){return e.children?e.children:e.loadChildren?e._loadedRoutes:[]}(n),{segmentGroup:P,slicedSegments:N}=C0(r,v,E,T.filter(U=>void 0===U.redirectTo),this.relativeLinkResolution);if(0===N.length&&P.hasChildren())return this.processChildren(D,T,P).pipe(Pe(U=>null===U?null:[new du(p,U)]));if(0===T.length&&0===N.length)return Bt([new du(p,[])]);const G=Ea(n)===a;return this.processSegment(D,T,P,N,G?vn:a).pipe(Pe(U=>null===U?null:[new du(p,U)]))}))}}function CH(e){const t=e.value.routeConfig;return t&&""===t.path&&void 0===t.redirectTo}function hP(e){const t=[],n=new Set;for(const r of e){if(!CH(r)){t.push(r);continue}const i=t.find(a=>r.value.routeConfig===a.value.routeConfig);void 0!==i?(i.children.push(...r.children),n.add(i)):t.push(r)}for(const r of n){const i=hP(r.children);t.push(new du(r.value,i))}return t.filter(r=>!n.has(r))}function dP(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function fP(e){let t=e,n=t._segmentIndexShift??0;for(;t._sourceSegment;)t=t._sourceSegment,n+=t._segmentIndexShift??0;return n-1}function mP(e){return e.data||{}}function gP(e){return e.resolve||{}}function yP(e){return"string"==typeof e.title||null===e.title}function JC(e){return fc(t=>{const n=e(t);return n?Cr(n).pipe(Pe(()=>t)):Bt(t)})}let _P=(()=>{class e{buildTitle(n){let r,i=n.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(a=>a.outlet===vn);return r}getResolvedTitleForRoute(n){return n.data[hy]}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:function(){return Or(vP)},providedIn:"root"}),e})(),vP=(()=>{class e extends _P{constructor(n){super(),this.title=n}updateTitle(n){const r=this.buildTitle(n);void 0!==r&&this.title.setTitle(r)}}return e.\u0275fac=function(n){return new(n||e)(St(dk))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class kH{}class RH extends class PH{shouldDetach(t){return!1}store(t,n){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,n){return t.routeConfig===n.routeConfig}}{}const T0=new Tt("",{providedIn:"root",factory:()=>({})}),QC=new Tt("ROUTES");let eE=(()=>{class e{constructor(n,r){this.injector=n,this.compiler=r,this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap}loadComponent(n){if(this.componentLoaders.get(n))return this.componentLoaders.get(n);if(n._loadedComponent)return Bt(n._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(n);const r=Ph(n.loadComponent()).pipe(Uo(a=>{this.onLoadEndListener&&this.onLoadEndListener(n),n._loadedComponent=a}),kC(()=>{this.componentLoaders.delete(n)})),i=new xk(r,()=>new pi).pipe(IC());return this.componentLoaders.set(n,i),i}loadChildren(n,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return Bt({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const a=this.loadModuleFactoryOrRoutes(r.loadChildren).pipe(Pe(d=>{this.onLoadEndListener&&this.onLoadEndListener(r);let p,v,E=!1;Array.isArray(d)?v=d:(p=d.create(n).injector,v=Sk(p.get(QC,[],Rt.Self|Rt.Optional)));return{routes:v.map(WC),injector:p}}),kC(()=>{this.childrenLoaders.delete(r)})),c=new xk(a,()=>new pi).pipe(IC());return this.childrenLoaders.set(r,c),c}loadModuleFactoryOrRoutes(n){return Ph(n()).pipe(ht(r=>r instanceof sI||Array.isArray(r)?Bt(r):Cr(this.compiler.compileModuleAsync(r))))}}return e.\u0275fac=function(n){return new(n||e)(St(Zs),St(Uw))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class OH{}class LH{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,n){return t}}function NH(e){throw e}function zH(e,t,n){return t.parse("/")}const BH={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},VH={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};function xP(){const e=Or(Rk),t=Or(_y),n=Or(nC),r=Or(Zs),i=Or(Uw),a=Or(QC,{optional:!0})??[],c=Or(T0,{optional:!0})??{},d=Or(vP),p=Or(_P,{optional:!0}),v=Or(OH,{optional:!0}),E=Or(kH,{optional:!0}),D=new Do(null,e,t,n,r,i,Sk(a));return v&&(D.urlHandlingStrategy=v),E&&(D.routeReuseStrategy=E),D.titleStrategy=p??d,function UH(e,t){e.errorHandler&&(t.errorHandler=e.errorHandler),e.malformedUriErrorHandler&&(t.malformedUriErrorHandler=e.malformedUriErrorHandler),e.onSameUrlNavigation&&(t.onSameUrlNavigation=e.onSameUrlNavigation),e.paramsInheritanceStrategy&&(t.paramsInheritanceStrategy=e.paramsInheritanceStrategy),e.relativeLinkResolution&&(t.relativeLinkResolution=e.relativeLinkResolution),e.urlUpdateStrategy&&(t.urlUpdateStrategy=e.urlUpdateStrategy),e.canceledNavigationResolution&&(t.canceledNavigationResolution=e.canceledNavigationResolution)}(c,D),D}let Do=(()=>{class e{constructor(n,r,i,a,c,d,p){this.rootComponentType=n,this.urlSerializer=r,this.rootContexts=i,this.location=a,this.config=p,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new pi,this.errorHandler=NH,this.malformedUriErrorHandler=zH,this.navigated=!1,this.lastSuccessfulId=-1,this.afterPreactivation=()=>Bt(void 0),this.urlHandlingStrategy=new LH,this.routeReuseStrategy=new RH,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.configLoader=c.get(eE),this.configLoader.onLoadEndListener=T=>this.triggerEvent(new wj(T)),this.configLoader.onLoadStartListener=T=>this.triggerEvent(new xj(T)),this.ngModule=c.get(Qd),this.console=c.get(gU);const D=c.get(Oi);this.isNgZoneEnabled=D instanceof Oi&&Oi.isInAngularZone(),this.resetConfig(p),this.currentUrlTree=function G9(){return new rf(new En([],{}),{},null)}(),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.routerState=Zk(this.currentUrlTree,this.rootComponentType),this.transitions=new _l({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}get browserPageId(){return this.location.getState()?.\u0275routerPageId}setupNavigations(n){const r=this.events;return n.pipe(uu(i=>0!==i.id),Pe(i=>({...i,extractedUrl:this.urlHandlingStrategy.extract(i.rawUrl)})),fc(i=>{let a=!1,c=!1;return Bt(i).pipe(Uo(d=>{this.currentNavigation={id:d.id,initialUrl:d.rawUrl,extractedUrl:d.extractedUrl,trigger:d.source,extras:d.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null}}),fc(d=>{const p=this.browserUrlTree.toString(),v=!this.navigated||d.extractedUrl.toString()!==p||p!==this.currentUrlTree.toString();if(("reload"===this.onSameUrlNavigation||v)&&this.urlHandlingStrategy.shouldProcessUrl(d.rawUrl))return wP(d.source)&&(this.browserUrlTree=d.extractedUrl),Bt(d).pipe(fc(D=>{const T=this.transitions.getValue();return r.next(new BC(D.id,this.serializeUrl(D.extractedUrl),D.source,D.restoredState)),T!==this.transitions.getValue()?xt:Promise.resolve(D)}),function gH(e,t,n,r){return fc(i=>function pH(e,t,n,r,i){return new mH(e,t,n,r,i).apply()}(e,t,n,i.extractedUrl,r).pipe(Pe(a=>({...i,urlAfterRedirects:a}))))}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Uo(D=>{this.currentNavigation={...this.currentNavigation,finalUrl:D.urlAfterRedirects},i.urlAfterRedirects=D.urlAfterRedirects}),function DH(e,t,n,r,i,a){return ht(c=>function vH(e,t,n,r,i,a,c="emptyOnly",d="legacy"){return new bH(e,t,n,r,i,c,d,a).recognize().pipe(fc(p=>null===p?function _H(e){return new Bn(t=>t.error(e))}(new yH):Bt(p)))}(e,t,n,c.urlAfterRedirects,r.serialize(c.urlAfterRedirects),r,i,a).pipe(Pe(d=>({...c,targetSnapshot:d}))))}(this.ngModule.injector,this.rootComponentType,this.config,this.urlSerializer,this.paramsInheritanceStrategy,this.relativeLinkResolution),Uo(D=>{if(i.targetSnapshot=D.targetSnapshot,"eager"===this.urlUpdateStrategy){if(!D.extras.skipLocationChange){const P=this.urlHandlingStrategy.merge(D.urlAfterRedirects,D.rawUrl);this.setBrowserUrl(P,D)}this.browserUrlTree=D.urlAfterRedirects}const T=new gj(D.id,this.serializeUrl(D.extractedUrl),this.serializeUrl(D.urlAfterRedirects),D.targetSnapshot);r.next(T)}));if(v&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:T,extractedUrl:P,source:N,restoredState:G,extras:U}=d,Z=new BC(T,this.serializeUrl(P),N,G);r.next(Z);const ne=Zk(P,this.rootComponentType).snapshot;return Bt(i={...d,targetSnapshot:ne,urlAfterRedirects:P,extras:{...U,skipLocationChange:!1,replaceUrl:!1}})}return this.rawUrlTree=d.rawUrl,d.resolve(null),xt}),Uo(d=>{const p=new yj(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot);this.triggerEvent(p)}),Pe(d=>i={...d,guards:Uj(d.targetSnapshot,d.currentSnapshot,this.rootContexts)}),function Jj(e,t){return ht(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:a,canDeactivateChecks:c}}=n;return 0===c.length&&0===a.length?Bt({...n,guardsResult:!0}):function Qj(e,t,n,r){return Cr(e).pipe(ht(i=>function oH(e,t,n,r,i){const a=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return a&&0!==a.length?Bt(a.map(d=>{const p=vy(t)??i,v=Yp(d,p);return Ph(function Xj(e){return e&&wy(e.canDeactivate)}(v)?v.canDeactivate(e,t,n,r):p.runInContext(()=>v(e,t,n,r))).pipe(Ih())})).pipe(Kp()):Bt(!0)}(i.component,i.route,n,t,r)),Ih(i=>!0!==i,!0))}(c,r,i,e).pipe(ht(d=>d&&function Gj(e){return"boolean"==typeof e}(d)?function eH(e,t,n,r){return Cr(t).pipe(Ah(i=>TC(function nH(e,t){return null!==e&&t&&t(new Cj(e)),Bt(!0)}(i.route.parent,r),function tH(e,t){return null!==e&&t&&t(new Dj(e)),Bt(!0)}(i.route,r),function iH(e,t,n){const r=t[t.length-1],a=t.slice(0,t.length-1).reverse().map(c=>function $j(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(c)).filter(c=>null!==c).map(c=>bk(()=>Bt(c.guards.map(p=>{const v=vy(c.node)??n,E=Yp(p,v);return Ph(function Wj(e){return e&&wy(e.canActivateChild)}(E)?E.canActivateChild(r,e):v.runInContext(()=>E(r,e))).pipe(Ih())})).pipe(Kp())));return Bt(a).pipe(Kp())}(e,i.path,n),function rH(e,t,n){const r=t.routeConfig?t.routeConfig.canActivate:null;if(!r||0===r.length)return Bt(!0);const i=r.map(a=>bk(()=>{const c=vy(t)??n,d=Yp(a,c);return Ph(function Zj(e){return e&&wy(e.canActivate)}(d)?d.canActivate(t,e):c.runInContext(()=>d(t,e))).pipe(Ih())}));return Bt(i).pipe(Kp())}(e,i.route,n))),Ih(i=>!0!==i,!0))}(r,a,e,t):Bt(d)),Pe(d=>({...n,guardsResult:d})))})}(this.ngModule.injector,d=>this.triggerEvent(d)),Uo(d=>{if(i.guardsResult=d.guardsResult,af(d.guardsResult))throw Kk(0,d.guardsResult);const p=new _j(d.id,this.serializeUrl(d.extractedUrl),this.serializeUrl(d.urlAfterRedirects),d.targetSnapshot,!!d.guardsResult);this.triggerEvent(p)}),uu(d=>!!d.guardsResult||(this.restoreHistory(d),this.cancelNavigationTransition(d,"",3),!1)),JC(d=>{if(d.guards.canActivateChecks.length)return Bt(d).pipe(Uo(p=>{const v=new vj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}),fc(p=>{let v=!1;return Bt(p).pipe(function SH(e,t){return ht(n=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=n;if(!i.length)return Bt(n);let a=0;return Cr(i).pipe(Ah(c=>function MH(e,t,n,r){const i=e.routeConfig,a=e._resolve;return void 0!==i?.title&&!yP(i)&&(a[hy]=i.title),function TH(e,t,n,r){const i=function IH(e){return[...Object.keys(e),...Object.getOwnPropertySymbols(e)]}(e);if(0===i.length)return Bt({});const a={};return Cr(i).pipe(ht(c=>function AH(e,t,n,r){const i=vy(t)??r,a=Yp(e,i);return Ph(a.resolve?a.resolve(t,n):i.runInContext(()=>a(t,n)))}(e[c],t,n,r).pipe(Ih(),Uo(d=>{a[c]=d}))),AC(1),function U9(e){return Pe(()=>e)}(a),kh(c=>XC(c)?xt:cy(c)))}(a,e,t,r).pipe(Pe(c=>(e._resolvedData=c,e.data=Wk(e,n).resolve,i&&yP(i)&&(e.data[hy]=i.title),null)))}(c.route,r,e,t)),Uo(()=>a++),AC(1),ht(c=>a===i.length?Bt(n):xt))})}(this.paramsInheritanceStrategy,this.ngModule.injector),Uo({next:()=>v=!0,complete:()=>{v||(this.restoreHistory(p),this.cancelNavigationTransition(p,"",2))}}))}),Uo(p=>{const v=new bj(p.id,this.serializeUrl(p.extractedUrl),this.serializeUrl(p.urlAfterRedirects),p.targetSnapshot);this.triggerEvent(v)}))}),JC(d=>{const p=v=>{const E=[];v.routeConfig?.loadComponent&&!v.routeConfig._loadedComponent&&E.push(this.configLoader.loadComponent(v.routeConfig).pipe(Uo(D=>{v.component=D}),Pe(()=>{})));for(const D of v.children)E.push(...p(D));return E};return _k(p(d.targetSnapshot.root)).pipe(h0(),uy(1))}),JC(()=>this.afterPreactivation()),Pe(d=>{const p=function Aj(e,t,n){const r=yy(e,t._root,n?n._root:void 0);return new qk(r,t)}(this.routeReuseStrategy,d.targetSnapshot,d.currentRouterState);return i={...d,targetRouterState:p}}),Uo(d=>{this.currentUrlTree=d.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(d.urlAfterRedirects,d.rawUrl),this.routerState=d.targetRouterState,"deferred"===this.urlUpdateStrategy&&(d.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,d),this.browserUrlTree=d.urlAfterRedirects)}),((e,t,n)=>Pe(r=>(new Vj(t,r.targetRouterState,r.currentRouterState,n).activate(e),r)))(this.rootContexts,this.routeReuseStrategy,d=>this.triggerEvent(d)),Uo({next(){a=!0},complete(){a=!0}}),kC(()=>{a||c||this.cancelNavigationTransition(i,"",1),this.currentNavigation?.id===i.id&&(this.currentNavigation=null)}),kh(d=>{if(c=!0,eP(d)){Qk(d)||(this.navigated=!0,this.restoreHistory(i,!0));const p=new _0(i.id,this.serializeUrl(i.extractedUrl),d.message,d.cancellationCode);if(r.next(p),Qk(d)){const v=this.urlHandlingStrategy.merge(d.url,this.rawUrlTree),E={skipLocationChange:i.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||wP(i.source)};this.scheduleNavigation(v,"imperative",null,E,{resolve:i.resolve,reject:i.reject,promise:i.promise})}else i.resolve(!1)}else{this.restoreHistory(i,!0);const p=new jk(i.id,this.serializeUrl(i.extractedUrl),d,i.targetSnapshot??void 0);r.next(p);try{i.resolve(this.errorHandler(d))}catch(v){i.reject(v)}}return xt}))}))}resetRootComponentType(n){this.rootComponentType=n,this.routerState.root.component=this.rootComponentType}setTransition(n){this.transitions.next({...this.transitions.value,...n})}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(n=>{const r="popstate"===n.type?"popstate":"hashchange";"popstate"===r&&setTimeout(()=>{const i={replaceUrl:!0},a=n.state?.navigationId?n.state:null;if(a){const d={...a};delete d.navigationId,delete d.\u0275routerPageId,0!==Object.keys(d).length&&(i.state=d)}const c=this.parseUrl(n.url);this.scheduleNavigation(c,r,a,i)},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(n){this.events.next(n)}resetConfig(n){this.config=n.map(WC),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(n,r={}){const{relativeTo:i,queryParams:a,fragment:c,queryParamsHandling:d,preserveFragment:p}=r,v=i||this.routerState.root,E=p?this.currentUrlTree.fragment:c;let D=null;switch(d){case"merge":D={...this.currentUrlTree.queryParams,...a};break;case"preserve":D=this.currentUrlTree.queryParams;break;default:D=a||null}return null!==D&&(D=this.removeEmptyProps(D)),uj(v,this.currentUrlTree,n,D,E??null)}navigateByUrl(n,r={skipLocationChange:!1}){const i=af(n)?n:this.parseUrl(n),a=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(a,"imperative",null,r)}navigate(n,r={skipLocationChange:!1}){return function $H(e){for(let t=0;t{const a=n[i];return null!=a&&(r[i]=a),r},{})}processNavigations(){this.navigations.subscribe(n=>{this.navigated=!0,this.lastSuccessfulId=n.id,this.currentPageId=n.targetPageId,this.events.next(new lf(n.id,this.serializeUrl(n.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.titleStrategy?.updateTitle(this.routerState.snapshot),n.resolve(!0)},n=>{this.console.warn(`Unhandled Navigation Error: ${n}`)})}scheduleNavigation(n,r,i,a,c){if(this.disposed)return Promise.resolve(!1);let d,p,v;c?(d=c.resolve,p=c.reject,v=c.promise):v=new Promise((T,P)=>{d=T,p=P});const E=++this.navigationId;let D;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(i=this.location.getState()),D=i&&i.\u0275routerPageId?i.\u0275routerPageId:a.replaceUrl||a.skipLocationChange?this.browserPageId??0:(this.browserPageId??0)+1):D=0,this.setTransition({id:E,targetPageId:D,source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:n,extras:a,resolve:d,reject:p,promise:v,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),v.catch(T=>Promise.reject(T))}setBrowserUrl(n,r){const i=this.urlSerializer.serialize(n),a={...r.extras.state,...this.generateNgRouterState(r.id,r.targetPageId)};this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl?this.location.replaceState(i,"",a):this.location.go(i,"",a)}restoreHistory(n,r=!1){if("computed"===this.canceledNavigationResolution){const i=this.currentPageId-n.targetPageId;"popstate"!==n.source&&"eager"!==this.urlUpdateStrategy&&this.currentUrlTree!==this.currentNavigation?.finalUrl||0===i?this.currentUrlTree===this.currentNavigation?.finalUrl&&0===i&&(this.resetState(n),this.browserUrlTree=n.currentUrlTree,this.resetUrlToCurrentUrlTree()):this.location.historyGo(i)}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(n),this.resetUrlToCurrentUrlTree())}resetState(n){this.routerState=n.currentRouterState,this.currentUrlTree=n.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n.rawUrl)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}cancelNavigationTransition(n,r,i){const a=new _0(n.id,this.serializeUrl(n.extractedUrl),r,i);this.triggerEvent(a),n.resolve(!1)}generateNgRouterState(n,r){return"computed"===this.canceledNavigationResolution?{navigationId:n,\u0275routerPageId:r}:{navigationId:n}}}return e.\u0275fac=function(n){V1()},e.\u0275prov=zt({token:e,factory:function(){return xP()},providedIn:"root"}),e})();function wP(e){return"imperative"!==e}class CP{}let GH=(()=>{class e{constructor(n,r,i,a,c){this.router=n,this.injector=i,this.preloadingStrategy=a,this.loader=c}setUpPreloading(){this.subscription=this.router.events.pipe(uu(n=>n instanceof lf),Ah(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(n,r){const i=[];for(const a of r){a.providers&&!a._injector&&(a._injector=Av(a.providers,n,`Route: ${a.path}`));const c=a._injector??n,d=a._loadedInjector??c;a.loadChildren&&!a._loadedRoutes&&void 0===a.canLoad||a.loadComponent&&!a._loadedComponent?i.push(this.preloadConfig(c,a)):(a.children||a._loadedRoutes)&&i.push(this.processRoutes(d,a.children??a._loadedRoutes))}return Cr(i).pipe(dt())}preloadConfig(n,r){return this.preloadingStrategy.preload(r,()=>{let i;i=r.loadChildren&&void 0===r.canLoad?this.loader.loadChildren(n,r):Bt(null);const a=i.pipe(ht(c=>null===c?Bt(void 0):(r._loadedRoutes=c.routes,r._loadedInjector=c.injector,this.processRoutes(c.injector??n,c.routes))));return r.loadComponent&&!r._loadedComponent?Cr([a,this.loader.loadComponent(r)]).pipe(dt()):a})}}return e.\u0275fac=function(n){return new(n||e)(St(Do),St(Uw),St(Ms),St(CP),St(eE))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const rE=new Tt("");let EP=(()=>{class e{constructor(n,r,i={}){this.router=n,this.viewportScroller=r,this.options=i,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},i.scrollPositionRestoration=i.scrollPositionRestoration||"disabled",i.anchorScrolling=i.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(n=>{n instanceof BC?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=n.navigationTrigger,this.restoredId=n.restoredState?n.restoredState.navigationId:0):n instanceof lf&&(this.lastId=n.id,this.scheduleScrollEvent(n,this.router.parseUrl(n.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(n=>{n instanceof Hk&&(n.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(n.position):n.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(n.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(n,r){this.router.triggerEvent(new Hk(n,"popstate"===this.lastSource?this.store[this.restoredId]:null,r))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return e.\u0275fac=function(n){V1()},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();function Jp(e,t){return{\u0275kind:e,\u0275providers:t}}function iE(e){return[{provide:QC,multi:!0,useValue:e}]}function SP(){const e=Or(Zs);return t=>{const n=e.get(Vv);if(t!==n.components[0])return;const r=e.get(Do),i=e.get(MP);1===e.get(oE)&&r.initialNavigation(),e.get(TP,null,Rt.Optional)?.setUpPreloading(),e.get(rE,null,Rt.Optional)?.init(),r.resetRootComponentType(n.componentTypes[0]),i.closed||(i.next(),i.unsubscribe())}}const MP=new Tt("",{factory:()=>new pi}),oE=new Tt("",{providedIn:"root",factory:()=>1});const TP=new Tt("");function XH(e){return Jp(0,[{provide:TP,useExisting:GH},{provide:CP,useExisting:e}])}const IP=new Tt("ROUTER_FORROOT_GUARD"),YH=[nC,{provide:Rk,useClass:RC},{provide:Do,useFactory:xP},_y,{provide:cf,useFactory:function DP(e){return e.routerState.root},deps:[Do]},eE];function KH(){return new tA("Router",Do)}let AP=(()=>{class e{constructor(n){}static forRoot(n,r){return{ngModule:e,providers:[YH,[],iE(n),{provide:IP,useFactory:tG,deps:[[Do,new Fd,new Ir]]},{provide:T0,useValue:r||{}},r?.useHash?{provide:nf,useClass:i$}:{provide:nf,useClass:SA},{provide:rE,useFactory:()=>{const e=Or(Do),t=Or(x7),n=Or(T0);return n.scrollOffset&&t.setOffset(n.scrollOffset),new EP(e,t,n)}},r?.preloadingStrategy?XH(r.preloadingStrategy).\u0275providers:[],{provide:tA,multi:!0,useFactory:KH},r?.initialNavigation?nG(r):[],[{provide:kP,useFactory:SP},{provide:WI,multi:!0,useExisting:kP}]]}}static forChild(n){return{ngModule:e,providers:[iE(n)]}}}return e.\u0275fac=function(n){return new(n||e)(St(IP,8))},e.\u0275mod=li({type:e}),e.\u0275inj=Di({imports:[qC]}),e})();function tG(e){return"guarded"}function nG(e){return["disabled"===e.initialNavigation?Jp(3,[{provide:Nv,multi:!0,useFactory:()=>{const t=Or(Do);return()=>{t.setUpLocationChangeListener()}}},{provide:oE,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?Jp(2,[{provide:oE,useValue:0},{provide:Nv,multi:!0,deps:[Zs],useFactory:t=>{const n=t.get(n$,Promise.resolve());let r=!1;return()=>n.then(()=>new Promise(a=>{const c=t.get(Do),d=t.get(MP);(function i(a){t.get(Do).events.pipe(uu(d=>d instanceof lf||d instanceof _0||d instanceof jk),Pe(d=>d instanceof lf||d instanceof _0&&(0===d.code||1===d.code)&&null),uu(d=>null!==d),uy(1)).subscribe(()=>{a()})})(()=>{a(!0),r=!0}),c.afterPreactivation=()=>(a(!0),r||d.closed?Bt(void 0):d),c.initialNavigation()}))}}]).\u0275providers:[]]}const kP=new Tt(""),iG=[];let oG=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({imports:[AP.forRoot(iG),AP]}),e})();class PP{}class RP{}class mc{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(n=>{const r=n.indexOf(":");if(r>0){const i=n.slice(0,r),a=i.toLowerCase(),c=n.slice(r+1).trim();this.maybeSetNormalizedName(i,a),this.headers.has(a)?this.headers.get(a).push(c):this.headers.set(a,[c])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(n=>{let r=t[n];const i=n.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(i,r),this.maybeSetNormalizedName(n,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const n=this.headers.get(t.toLowerCase());return n&&n.length>0?n[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,n){return this.clone({name:t,value:n,op:"a"})}set(t,n){return this.clone({name:t,value:n,op:"s"})}delete(t,n){return this.clone({name:t,value:n,op:"d"})}maybeSetNormalizedName(t,n){this.normalizedNames.has(n)||this.normalizedNames.set(n,t)}init(){this.lazyInit&&(this.lazyInit instanceof mc?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(n=>{this.headers.set(n,t.headers.get(n)),this.normalizedNames.set(n,t.normalizedNames.get(n))})}clone(t){const n=new mc;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof mc?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([t]),n}applyUpdate(t){const n=t.name.toLowerCase();switch(t.op){case"a":case"s":let r=t.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(t.name,n);const i=("a"===t.op?this.headers.get(n):void 0)||[];i.push(...r),this.headers.set(n,i);break;case"d":const a=t.value;if(a){let c=this.headers.get(n);if(!c)return;c=c.filter(d=>-1===a.indexOf(d)),0===c.length?(this.headers.delete(n),this.normalizedNames.delete(n)):this.headers.set(n,c)}else this.headers.delete(n),this.normalizedNames.delete(n)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(n=>t(this.normalizedNames.get(n),this.headers.get(n)))}}class sG{encodeKey(t){return FP(t)}encodeValue(t){return FP(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const lG=/%(\d[a-f0-9])/gi,cG={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function FP(e){return encodeURIComponent(e).replace(lG,(t,n)=>cG[n]??t)}function P0(e){return`${e}`}class fu{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new sG,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function aG(e,t){const n=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(i=>{const a=i.indexOf("="),[c,d]=-1==a?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,a)),t.decodeValue(i.slice(a+1))],p=n.get(c)||[];p.push(d),n.set(c,p)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(n=>{const r=t.fromObject[n],i=Array.isArray(r)?r.map(P0):[P0(r)];this.map.set(n,i)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const n=this.map.get(t);return n?n[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,n){return this.clone({param:t,value:n,op:"a"})}appendAll(t){const n=[];return Object.keys(t).forEach(r=>{const i=t[r];Array.isArray(i)?i.forEach(a=>{n.push({param:r,value:a,op:"a"})}):n.push({param:r,value:i,op:"a"})}),this.clone(n)}set(t,n){return this.clone({param:t,value:n,op:"s"})}delete(t,n){return this.clone({param:t,value:n,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const n=this.encoder.encodeKey(t);return this.map.get(t).map(r=>n+"="+this.encoder.encodeValue(r)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const n=new fu({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat(t),n}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const n=("a"===t.op?this.map.get(t.param):void 0)||[];n.push(P0(t.value)),this.map.set(t.param,n);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let r=this.map.get(t.param)||[];const i=r.indexOf(P0(t.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(t.param,r):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}class R0{constructor(){this.map=new Map}set(t,n){return this.map.set(t,n),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}}function OP(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer}function LP(e){return typeof Blob<"u"&&e instanceof Blob}function NP(e){return typeof FormData<"u"&&e instanceof FormData}class Ey{constructor(t,n,r,i){let a;if(this.url=n,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function uG(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,a=i):a=r,a&&(this.reportProgress=!!a.reportProgress,this.withCredentials=!!a.withCredentials,a.responseType&&(this.responseType=a.responseType),a.headers&&(this.headers=a.headers),a.context&&(this.context=a.context),a.params&&(this.params=a.params)),this.headers||(this.headers=new mc),this.context||(this.context=new R0),this.params){const c=this.params.toString();if(0===c.length)this.urlWithParams=n;else{const d=n.indexOf("?");this.urlWithParams=n+(-1===d?"?":dD.set(T,t.setHeaders[T]),p)),t.setParams&&(v=Object.keys(t.setParams).reduce((D,T)=>D.set(T,t.setParams[T]),v)),new Ey(n,r,a,{params:v,headers:p,context:E,reportProgress:d,responseType:i,withCredentials:c})}}var xi=(()=>((xi=xi||{})[xi.Sent=0]="Sent",xi[xi.UploadProgress=1]="UploadProgress",xi[xi.ResponseHeader=2]="ResponseHeader",xi[xi.DownloadProgress=3]="DownloadProgress",xi[xi.Response=4]="Response",xi[xi.User=5]="User",xi))();class aE{constructor(t,n=200,r="OK"){this.headers=t.headers||new mc,this.status=void 0!==t.status?t.status:n,this.statusText=t.statusText||r,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class lE extends aE{constructor(t={}){super(t),this.type=xi.ResponseHeader}clone(t={}){return new lE({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class F0 extends aE{constructor(t={}){super(t),this.type=xi.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new F0({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class zP extends aE{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${t.url||"(unknown url)"}`:`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function cE(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let BP=(()=>{class e{constructor(n){this.handler=n}request(n,r,i={}){let a;if(n instanceof Ey)a=n;else{let p,v;p=i.headers instanceof mc?i.headers:new mc(i.headers),i.params&&(v=i.params instanceof fu?i.params:new fu({fromObject:i.params})),a=new Ey(n,r,void 0!==i.body?i.body:null,{headers:p,context:i.context,params:v,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials})}const c=Bt(a).pipe(Ah(p=>this.handler.handle(p)));if(n instanceof Ey||"events"===i.observe)return c;const d=c.pipe(uu(p=>p instanceof F0));switch(i.observe||"body"){case"body":switch(a.responseType){case"arraybuffer":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return p.body}));case"blob":return d.pipe(Pe(p=>{if(null!==p.body&&!(p.body instanceof Blob))throw new Error("Response is not a Blob.");return p.body}));case"text":return d.pipe(Pe(p=>{if(null!==p.body&&"string"!=typeof p.body)throw new Error("Response is not a string.");return p.body}));default:return d.pipe(Pe(p=>p.body))}case"response":return d;default:throw new Error(`Unreachable: unhandled observe type ${i.observe}}`)}}delete(n,r={}){return this.request("DELETE",n,r)}get(n,r={}){return this.request("GET",n,r)}head(n,r={}){return this.request("HEAD",n,r)}jsonp(n,r){return this.request("JSONP",n,{params:(new fu).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(n,r={}){return this.request("OPTIONS",n,r)}patch(n,r,i={}){return this.request("PATCH",n,cE(i,r))}post(n,r,i={}){return this.request("POST",n,cE(i,r))}put(n,r,i={}){return this.request("PUT",n,cE(i,r))}}return e.\u0275fac=function(n){return new(n||e)(St(PP))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();class VP{constructor(t,n){this.next=t,this.interceptor=n}handle(t){return this.interceptor.intercept(t,this.next)}}const UP=new Tt("HTTP_INTERCEPTORS");let dG=(()=>{class e{intercept(n,r){return r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();const fG=/^\)\]\}',?\n/;let $P=(()=>{class e{constructor(n){this.xhrFactory=n}handle(n){if("JSONP"===n.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new Bn(r=>{const i=this.xhrFactory.build();if(i.open(n.method,n.urlWithParams),n.withCredentials&&(i.withCredentials=!0),n.headers.forEach((P,N)=>i.setRequestHeader(P,N.join(","))),n.headers.has("Accept")||i.setRequestHeader("Accept","application/json, text/plain, */*"),!n.headers.has("Content-Type")){const P=n.detectContentTypeHeader();null!==P&&i.setRequestHeader("Content-Type",P)}if(n.responseType){const P=n.responseType.toLowerCase();i.responseType="json"!==P?P:"text"}const a=n.serializeBody();let c=null;const d=()=>{if(null!==c)return c;const P=i.statusText||"OK",N=new mc(i.getAllResponseHeaders()),G=function pG(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(i)||n.url;return c=new lE({headers:N,status:i.status,statusText:P,url:G}),c},p=()=>{let{headers:P,status:N,statusText:G,url:U}=d(),Z=null;204!==N&&(Z=typeof i.response>"u"?i.responseText:i.response),0===N&&(N=Z?200:0);let ne=N>=200&&N<300;if("json"===n.responseType&&"string"==typeof Z){const X=Z;Z=Z.replace(fG,"");try{Z=""!==Z?JSON.parse(Z):null}catch(re){Z=X,ne&&(ne=!1,Z={error:re,text:Z})}}ne?(r.next(new F0({body:Z,headers:P,status:N,statusText:G,url:U||void 0})),r.complete()):r.error(new zP({error:Z,headers:P,status:N,statusText:G,url:U||void 0}))},v=P=>{const{url:N}=d(),G=new zP({error:P,status:i.status||0,statusText:i.statusText||"Unknown Error",url:N||void 0});r.error(G)};let E=!1;const D=P=>{E||(r.next(d()),E=!0);let N={type:xi.DownloadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),"text"===n.responseType&&!!i.responseText&&(N.partialText=i.responseText),r.next(N)},T=P=>{let N={type:xi.UploadProgress,loaded:P.loaded};P.lengthComputable&&(N.total=P.total),r.next(N)};return i.addEventListener("load",p),i.addEventListener("error",v),i.addEventListener("timeout",v),i.addEventListener("abort",v),n.reportProgress&&(i.addEventListener("progress",D),null!==a&&i.upload&&i.upload.addEventListener("progress",T)),i.send(a),r.next({type:xi.Sent}),()=>{i.removeEventListener("error",v),i.removeEventListener("abort",v),i.removeEventListener("load",p),i.removeEventListener("timeout",v),n.reportProgress&&(i.removeEventListener("progress",D),null!==a&&i.upload&&i.upload.removeEventListener("progress",T)),i.readyState!==i.DONE&&i.abort()}})}}return e.\u0275fac=function(n){return new(n||e)(St(qA))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})();const uE=new Tt("XSRF_COOKIE_NAME"),hE=new Tt("XSRF_HEADER_NAME");class jP{}let mG=(()=>{class e{constructor(n,r,i){this.doc=n,this.platform=r,this.cookieName=i,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const n=this.doc.cookie||"";return n!==this.lastCookieString&&(this.parseCount++,this.lastToken=LA(n,this.cookieName),this.lastCookieString=n),this.lastToken}}return e.\u0275fac=function(n){return new(n||e)(St(ss),St(Vw),St(uE))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})(),dE=(()=>{class e{constructor(n,r){this.tokenService=n,this.headerName=r}intercept(n,r){const i=n.url.toLowerCase();if("GET"===n.method||"HEAD"===n.method||i.startsWith("http://")||i.startsWith("https://"))return r.handle(n);const a=this.tokenService.getToken();return null!==a&&!n.headers.has(this.headerName)&&(n=n.clone({headers:n.headers.set(this.headerName,a)})),r.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(jP),St(hE))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})(),gG=(()=>{class e{constructor(n,r){this.backend=n,this.injector=r,this.chain=null}handle(n){if(null===this.chain){const r=this.injector.get(UP,[]);this.chain=r.reduceRight((i,a)=>new VP(i,a),this.backend)}return this.chain.handle(n)}}return e.\u0275fac=function(n){return new(n||e)(St(RP),St(Zs))},e.\u0275prov=zt({token:e,factory:e.\u0275fac}),e})(),yG=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:dE,useClass:dG}]}}static withOptions(n={}){return{ngModule:e,providers:[n.cookieName?{provide:uE,useValue:n.cookieName}:[],n.headerName?{provide:hE,useValue:n.headerName}:[]]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({providers:[dE,{provide:UP,useExisting:dE,multi:!0},{provide:jP,useClass:mG},{provide:uE,useValue:"XSRF-TOKEN"},{provide:hE,useValue:"X-XSRF-TOKEN"}]}),e})(),_G=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({providers:[BP,{provide:PP,useClass:gG},$P,{provide:RP,useExisting:$P}],imports:[yG.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]}),e})();class vG{encodeKey(t){return encodeURIComponent(t)}encodeValue(t){return encodeURIComponent(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}const bG=new Tt("basePath");class HP{constructor(t={}){this.apiKeys=t.apiKeys,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.withCredentials=t.withCredentials,this.encoder=t.encoder,this.encodeParam=t.encodeParam?t.encodeParam:n=>this.defaultEncodeParam(n),this.credentials=t.credentials?t.credentials:{}}selectHeaderContentType(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}selectHeaderAccept(t){if(0===t.length)return;const n=t.find(r=>this.isJsonMime(r));return void 0===n?t[0]:n}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(n.test(t)||"application/json-patch+json"===t.toLowerCase())}lookupCredential(t){const n=this.credentials[t];return"function"==typeof n?n():n}defaultEncodeParam(t){const n="date-time"===t.dataFormat?t.value.toISOString():t.value;return encodeURIComponent(String(n))}}let Dy=(()=>{class e{constructor(n,r,i){this.httpClient=n,this.basePath="http://localhost",this.defaultHeaders=new mc,this.configuration=new HP,i&&(this.configuration=i),"string"!=typeof this.configuration.basePath&&(Array.isArray(r)&&r.length>0&&(r=r[0]),"string"!=typeof r&&(r=this.basePath),this.configuration.basePath=r),this.encoder=this.configuration.encoder||new vG}addToHttpParams(n,r,i){return"object"!=typeof r||r instanceof Date?this.addToHttpParamsRecursive(n,r,i):this.addToHttpParamsRecursive(n,r)}addToHttpParamsRecursive(n,r,i){if(null==r)return n;if("object"==typeof r)if(Array.isArray(r))r.forEach(a=>n=this.addToHttpParamsRecursive(n,a,i));else if(r instanceof Date){if(null==i)throw Error("key may not be null if value is Date");n=n.append(i,r.toISOString().substr(0,10))}else Object.keys(r).forEach(a=>n=this.addToHttpParamsRecursive(n,r[a],null!=i?`${i}.${a}`:a));else{if(null==i)throw Error("key may not be null if value is not object or array");n=n.append(i,r)}return n}paxServiceGetDevice(n,r="body",i=!1,a){if(null==n)throw new Error("Required parameter id was null or undefined when calling paxServiceGetDevice.");let c=this.defaultHeaders,d=a&&a.httpHeaderAccept;void 0===d&&(d=this.configuration.selectHeaderAccept(["application/json"])),void 0!==d&&(c=c.set("Accept",d));let p=a&&a.context;void 0===p&&(p=new R0);let v="json";d&&(v=d.startsWith("text")?"text":this.configuration.isJsonMime(d)?"json":"blob");let E=`/api/v1/devices/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`;return this.httpClient.request("get",`${this.configuration.basePath}${E}`,{context:p,responseType:v,withCredentials:this.configuration.withCredentials,headers:c,observe:r,reportProgress:i})}paxServiceListData(n,r,i,a="body",c=!1,d){let p=new fu({encoder:this.encoder});null!=n&&(p=this.addToHttpParams(p,n,"since")),null!=r&&(p=this.addToHttpParams(p,r,"until")),null!=i&&(p=this.addToHttpParams(p,i,"limit"));let v=this.defaultHeaders,E=d&&d.httpHeaderAccept;void 0===E&&(E=this.configuration.selectHeaderAccept(["application/json"])),void 0!==E&&(v=v.set("Accept",E));let D=d&&d.context;void 0===D&&(D=new R0);let T="json";return E&&(T=E.startsWith("text")?"text":this.configuration.isJsonMime(E)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/data`,{context:D,params:p,responseType:T,withCredentials:this.configuration.withCredentials,headers:v,observe:a,reportProgress:c})}paxServiceListDevices(n="body",r=!1,i){let a=this.defaultHeaders,c=i&&i.httpHeaderAccept;void 0===c&&(c=this.configuration.selectHeaderAccept(["application/json"])),void 0!==c&&(a=a.set("Accept",c));let d=i&&i.context;void 0===d&&(d=new R0);let p="json";return c&&(p=c.startsWith("text")?"text":this.configuration.isJsonMime(c)?"json":"blob"),this.httpClient.request("get",`${this.configuration.basePath}/api/v1/devices`,{context:d,responseType:p,withCredentials:this.configuration.withCredentials,headers:a,observe:n,reportProgress:r})}}return e.\u0275fac=function(n){return new(n||e)(St(BP),St(bG,8),St(HP,8))},e.\u0275prov=zt({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const xG=["chart"];function wG(e,t){if(1&e&&(jn(0,"div",7),zr(1),Wn()),2&e){const n=qg();kr(1),Kd(" Error retrieving data: ",n.errorMessage,"\n")}}function CG(e,t){if(1&e&&(jn(0,"tr")(1,"td"),zr(2),Wn(),jn(3,"td"),zr(4),kv(5,"date"),Wn(),jn(6,"td"),zr(7),Wn(),jn(8,"td"),zr(9),Wn()()),2&e){const n=t.$implicit;kr(2),Sh(n.deviceId),kr(2),Sh(Pv(5,4,n.timestamp,"YYYY-MM-dd HH:mm")),kr(3),Sh(n.bluetoothCount),kr(2),Sh(n.wifiCount)}}function EG(e,t){if(1&e&&(jn(0,"div")(1,"table")(2,"tr")(3,"th"),zr(4,"Device"),Wn(),xa(5,"th"),jn(6,"th"),zr(7,"Timestamp"),Wn(),jn(8,"th"),zr(9,"Bluetooth"),Wn(),jn(10,"th"),zr(11,"WiFi"),Wn()(),Dh(12,CG,10,7,"tr",6),Wn()()),2&e){const n=t.$implicit;kr(12),Co("ngForOf",n.samples)}}const O0=function(e){return{button:!0,activeButton:e}};let DG=(()=>{class e{constructor(n){this.paxService=n,this.dataPoints=[],this.errorMessage="",this.lastPoll=new Date,this.visibleInterval=24}hasError(){return""!=this.errorMessage}ngOnInit(){}ngAfterViewInit(){this.loadData()}showInterval(n){this.visibleInterval=n,this.loadData()}loadData(){let n=""+((new Date).getTime()-3600*this.visibleInterval*1e3),r=""+(new Date).getTime();this.paxService.paxServiceListData(n,r,19e6).subscribe({next:i=>{i.data&&(this.dataPoints=i.data)},error:i=>{this.errorMessage=i.message},complete:()=>{this.lastPoll=new Date}})}}return e.\u0275fac=function(n){return new(n||e)(qe(Dy))},e.\u0275cmp=zs({type:e,selectors:[["app-main-chart"]],viewQuery:function(n,r){if(1&n&&Fv(xG,5),2&n){let i;$p(i=jp())&&(r.chartRef=i.first)}},decls:19,vars:19,consts:[["class","error",4,"ngIf"],[1,"chart-container"],[1,"chart"],["chart",""],[1,"stats"],[3,"ngClass","click"],[4,"ngFor","ngForOf"],[1,"error"]],template:function(n,r){1&n&&(jn(0,"h1"),zr(1,"PAX Counters"),Wn(),Dh(2,wG,2,1,"div",0),jn(3,"div",1),xa(4,"canvas",2,3),Wn(),jn(6,"div",4),zr(7),kv(8,"date"),Wn(),jn(9,"div")(10,"button",5),Ri("click",function(){return r.showInterval(168)}),zr(11,"1w"),Wn(),jn(12,"button",5),Ri("click",function(){return r.showInterval(24)}),zr(13,"1d"),Wn(),jn(14,"button",5),Ri("click",function(){return r.showInterval(12)}),zr(15,"12h"),Wn(),jn(16,"button",5),Ri("click",function(){return r.showInterval(1)}),zr(17,"Last hour"),Wn()(),Dh(18,EG,13,1,"div",6)),2&n&&(kr(2),Co("ngIf",r.hasError()),kr(5),yw(" Last update ",Pv(8,8,r.lastPoll,"yyyy-MM-dd HH:mm")," (",r.dataPoints.length," sets)\n"),kr(3),Co("ngClass",ef(11,O0,168==r.visibleInterval)),kr(2),Co("ngClass",ef(13,O0,24==r.visibleInterval)),kr(2),Co("ngClass",ef(15,O0,12==r.visibleInterval)),kr(2),Co("ngClass",ef(17,O0,1==r.visibleInterval)),kr(2),Co("ngForOf",r.dataPoints))},dependencies:[dC,n0,fC,gC],styles:["h1[_ngcontent-%COMP%]{font-size:24px;text-align:center}.error[_ngcontent-%COMP%]{border:solid 1px darkred;background:pink;color:maroon;border-radius:.5em;padding:1em;font-weight:400}.chart-container[_ngcontent-%COMP%]{padding:1em;display:grid;justify-items:center}.chart[_ngcontent-%COMP%]{margin:1em;width:100%;border-radius:.25em;border:solid 1px darkgray}.stats[_ngcontent-%COMP%]{font-size:10pt;font-weight:100;text-align:right;padding:1em}.button[_ngcontent-%COMP%]{height:2em;width:8em;margin:.25em;font-size:14pt;border:solid 1px blue;border-radius:.25em}"]}),e})();function vl(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function MG(e){return 0|e.length}function TG(e){return!(e>0)}function IG(e){return"object"!=typeof e||"length"in e?e:Array.from(e)}function Sy(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function fE(e,t){let r,n=0,i=0,a=0;if(void 0===t)for(let c of e)null!=c&&(c=+c)>=c&&(r=c-i,i+=r/++n,a+=r*(c-i));else{let c=-1;for(let d of e)null!=(d=t(d,++c,e))&&(d=+d)>=d&&(r=d-i,i+=r/++n,a+=r*(d-i))}if(n>1)return a/(n-1)}function GP(e,t){const n=fE(e,t);return n&&Math.sqrt(n)}function Qp(e,t){let n,r;if(void 0===t)for(const i of e)null!=i&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r=a&&(n=r=a):(n>a&&(n=a),r=r.length)return n(a);const d=new L0,p=r[c++];let v=-1;for(const E of a){const D=p(E,++v,a),T=d.get(D);T?T.push(E):d.set(D,[E])}for(const[E,D]of d)d.set(E,i(D,c));return t(d)}(e,0)}function Xs(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function FG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const a of e)++i,null!=a&&(n=a)&&(n=a,r=i);else for(let a of e)null!=(a=t(a,++i,e))&&(n=a)&&(n=a,r=i);return r}function OG(e,t){let n=0,r=0;if(void 0===t)for(let i of e)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let a of e)null!=(a=t(a,++i,e))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}function uf(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function yE(e,...t){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&2!==n.length||t.length>1){const r=Uint32Array.from(e,(i,a)=>a);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,a)=>{for(const c of t){const d=Ty(c[i],c[a]);if(d)return d}})):(n=e.map(n),r.sort((i,a)=>Ty(n[i],n[a]))),function LG(e,t){return Array.from(t,n=>e[n])}(e,r)}return e.sort(_E(n))}function _E(e=vl){if(e===vl)return Ty;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}function Ty(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}function JP(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?Ty:_E(i);r>n;){if(r-n>600){const p=r-n+1,v=t-n+1,E=Math.log(p),D=.5*Math.exp(2*E/3),T=.5*Math.sqrt(E*D*(p-D)/p)*(v-p/2<0?-1:1);JP(e,t,Math.max(n,Math.floor(t-v*D/p+T)),Math.min(r,Math.floor(t+(p-v)*D/p+T)),i)}const a=e[t];let c=n,d=r;for(Iy(e,n,t),i(e[r],a)>0&&Iy(e,n,r);c0;)--d}0===i(e[n],a)?Iy(e,n,d):(++d,Iy(e,d,r)),d<=t&&(n=d+1),t<=d&&(r=d-1)}return e}function Iy(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function QP(e){return null===e?NaN:+e}function N0(e,t,n){if(e=Float64Array.from(function*NG(e,t){if(void 0===t)for(let n of e)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return uf(e);if(t>=1)return Xs(e);var r,i=(r-1)*t,a=Math.floor(i),c=Xs(JP(e,a).subarray(0,a+1));return c+(uf(e.subarray(a+1))-c)*(i-a)}}function zG(e,t,n=QP){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),c=+n(e[a],a,e);return c+(+n(e[a+1],a+1,e)-c)*(i-a)}}function z0(e,t){return N0(e,.5,t)}function BG(e,t){let n,r=-1,i=-1;if(void 0===t)for(const a of e)++i,null!=a&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);else for(let a of e)null!=(a=t(a,++i,e))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function eR(e,t){const n=new L0;if(void 0===t)for(let a of e)null!=a&&a>=a&&n.set(a,(n.get(a)||0)+1);else{let a=-1;for(let c of e)null!=(c=t(c,++a,e))&&c>=c&&n.set(c,(n.get(c)||0)+1)}let r,i=0;for(const[a,c]of n)c>i&&(i=c,r=a);return r}function tR(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),a=new Array(i);++rt(n[d],n[p]);let a,c;return(e=Uint32Array.from(n,(d,p)=>p)).sort(t===vl?(d,p)=>Ty(n[d],n[p]):_E(i)),e.forEach((d,p)=>{const v=i(d,void 0===a?d:a);v>=0?((void 0===a||v>0)&&(a=d,c=p),r[d]=c):r[d]=NaN}),r}function B0(e,t){let n=0;if(void 0===t)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}const VG=Math.sqrt(50),UG=Math.sqrt(10),$G=Math.sqrt(2);function V0(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),c=a>=VG?10:a>=UG?5:a>=$G?2:1;let d,p,v;return i<0?(v=Math.pow(10,-i)/c,d=Math.round(e*v),p=Math.round(t*v),d/vt&&--p,v=-v):(v=Math.pow(10,i)*c,d=Math.round(e/v),p=Math.round(t/v),d*vt&&--p),p0))return[];if((e=+e)==(t=+t))return[e];const r=t=i))return[];const d=a-i+1,p=new Array(d);if(r)if(c<0)for(let v=0;v+e(t)}function ZG(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function WG(){return!this.__axis}function G0(e,t){var n=[],r=null,i=null,a=6,c=6,d=3,p=typeof window<"u"&&window.devicePixelRatio>1?0:.5,v=1===e||4===e?-1:1,E=4===e||2===e?"x":"y",D=1===e||3===e?HG:GG;function T(P){var N=r??(t.ticks?t.ticks.apply(t,n):t.domain()),G=i??(t.tickFormat?t.tickFormat.apply(t,n):jG),U=Math.max(a,0)+d,Z=t.range(),ne=+Z[0]+p,X=+Z[Z.length-1]+p,re=(t.bandwidth?ZG:qG)(t.copy(),p),fe=P.selection?P.selection():P,ve=fe.selectAll(".domain").data([null]),Re=fe.selectAll(".tick").data(N,t).order(),We=Re.exit(),Ke=Re.enter().append("g").attr("class","tick"),lt=Re.select("line"),Ue=Re.select("text");ve=ve.merge(ve.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),Re=Re.merge(Ke),lt=lt.merge(Ke.append("line").attr("stroke","currentColor").attr(E+"2",v*a)),Ue=Ue.merge(Ke.append("text").attr("fill","currentColor").attr(E,v*U).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),P!==fe&&(ve=ve.transition(P),Re=Re.transition(P),lt=lt.transition(P),Ue=Ue.transition(P),We=We.transition(P).attr("opacity",1e-6).attr("transform",function(st){return isFinite(st=re(st))?D(st+p):this.getAttribute("transform")}),Ke.attr("opacity",1e-6).attr("transform",function(st){var Fe=this.parentNode.__axis;return D((Fe&&isFinite(Fe=Fe(st))?Fe:re(st))+p)})),We.remove(),ve.attr("d",4===e||2===e?c?"M"+v*c+","+ne+"H"+p+"V"+X+"H"+v*c:"M"+p+","+ne+"V"+X:c?"M"+ne+","+v*c+"V"+p+"H"+X+"V"+v*c:"M"+ne+","+p+"H"+X),Re.attr("opacity",1).attr("transform",function(st){return D(re(st)+p)}),lt.attr(E+"2",v*a),Ue.attr(E,v*U).text(G),fe.filter(WG).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),fe.each(function(){this.__axis=re})}return T.scale=function(P){return arguments.length?(t=P,T):t},T.ticks=function(){return n=Array.from(arguments),T},T.tickArguments=function(P){return arguments.length?(n=null==P?[]:Array.from(P),T):n.slice()},T.tickValues=function(P){return arguments.length?(r=null==P?null:Array.from(P),T):r&&r.slice()},T.tickFormat=function(P){return arguments.length?(i=P,T):i},T.tickSize=function(P){return arguments.length?(a=c=+P,T):a},T.tickSizeInner=function(P){return arguments.length?(a=+P,T):a},T.tickSizeOuter=function(P){return arguments.length?(c=+P,T):c},T.tickPadding=function(P){return arguments.length?(d=+P,T):d},T.offset=function(P){return arguments.length?(p=+P,T):p},T}function YG(){}function wE(e){return null==e?YG:function(){return this.querySelector(e)}}function JG(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function QG(){return[]}function iR(e){return null==e?QG:function(){return this.querySelectorAll(e)}}function oR(e){return function(){return this.matches(e)}}function sR(e){return function(t){return t.matches(e)}}var nq=Array.prototype.find;function iq(){return this.firstElementChild}var sq=Array.prototype.filter;function aq(){return Array.from(this.children)}function aR(e){return new Array(e.length)}function q0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function dq(e){return function(){return e}}function fq(e,t,n,r,i,a){for(var d,c=0,p=t.length,v=a.length;ct?1:e>=t?0:NaN}q0.prototype={constructor:q0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var CE="http://www.w3.org/1999/xhtml";const tm={svg:"http://www.w3.org/2000/svg",xhtml:CE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Z0(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),tm.hasOwnProperty(t)?{space:tm[t],local:e}:e}function Aq(e){return function(){this.removeAttribute(e)}}function kq(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pq(e,t){return function(){this.setAttribute(e,t)}}function Rq(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Oq(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function lR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nq(e){return function(){this.style.removeProperty(e)}}function zq(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Bq(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function nm(e,t){return e.style.getPropertyValue(t)||lR(e).getComputedStyle(e,null).getPropertyValue(t)}function Uq(e){return function(){delete this[e]}}function $q(e,t){return function(){this[e]=t}}function jq(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function cR(e){return e.trim().split(/^|\s+/)}function EE(e){return e.classList||new uR(e)}function uR(e){this._node=e,this._names=cR(e.getAttribute("class")||"")}function hR(e,t){for(var n=EE(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function bZ(e){return function(){var t=this.__on;if(t){for(var a,n=0,r=-1,i=t.length;n=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var pR=[null];function Ys(e,t){this._groups=e,this._parents=t}function mR(){return new Ys([[document.documentElement]],pR)}Ys.prototype=mR.prototype={constructor:Ys,select:function KG(e){"function"!=typeof e&&(e=wE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=X&&(X=ne+1);!(fe=U[X])&&++X=0;)(c=r[i])&&(a&&4^c.compareDocumentPosition(a)&&a.parentNode.insertBefore(c,a),a=c);return this},sort:function wq(e){function t(D,T){return D&&T?e(D.__data__,T.__data__):!D-!T}e||(e=Cq);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==t?Nq:"function"==typeof t?Bq:zq)(e,t,n??"")):nm(this.node(),e)},property:function Hq(e,t){return arguments.length>1?this.each((null==t?Uq:"function"==typeof t?jq:$q)(e,t)):this.node()[e]},classed:function Wq(e,t){var n=cR(e+"");if(arguments.length<2){for(var r=EE(this.node()),i=-1,a=n.length;++i{}};function gR(){for(var r,e=0,t=arguments.length,n={};e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function AZ(e,t){for(var i,n=0,r=e.length;n0)for(var i,a,n=new Array(i),r=0;r=0&&e._call.call(void 0,t),e=e._next;--rm}()}finally{rm=0,function OZ(){for(var e,n,t=X0,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:X0=n);Fy=e,ME(r)}(),hf=0}}function FZ(){var e=Oy.now(),t=e-Y0;t>1e3&&(K0-=t,Y0=e)}function ME(e){rm||(Py&&(Py=clearTimeout(Py)),e-hf>24?(e<1/0&&(Py=setTimeout(xR,e-Oy.now()-K0)),Ry&&(Ry=clearInterval(Ry))):(Ry||(Y0=Oy.now(),Ry=setInterval(FZ,1e3)),rm=1,vR(xR)))}function wR(e,t,n){var r=new J0;return r.restart(i=>{r.stop(),e(i+t)},t=null==t?0:+t,n),r}J0.prototype=bR.prototype={constructor:J0,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?SE():+n)+(null==t?0:+t),!this._next&&Fy!==this&&(Fy?Fy._next=this:X0=this,Fy=this),this._call=e,this._time=n,ME()},stop:function(){this._call&&(this._call=null,this._time=1/0,ME())}};var LZ=kZ("start","end","cancel","interrupt"),NZ=[];function tb(e,t,n,r,i,a){var c=e.__transition;if(c){if(n in c)return}else e.__transition={};!function zZ(e,t,n){var i,r=e.__transition;function c(v){var E,D,T,P;if(1!==n.state)return p();for(E in r)if((P=r[E]).name===n.name){if(3===P.state)return wR(c);4===P.state?(P.state=6,P.timer.stop(),P.on.call("interrupt",e,e.__data__,P.index,P.group),delete r[E]):+E0)throw new Error("too late; already scheduled");return n}function gc(e,t){var n=bl(e,t);if(n.state>3)throw new Error("too late; already running");return n}function bl(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $o(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nb,SR=180/Math.PI,kE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function MR(e,t,n,r,i,a){var c,d,p;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(p=e*n+t*r)&&(n-=e*p,r-=t*p),(d=Math.sqrt(n*n+r*r))&&(n/=d,r/=d,p/=d),e*r180?E+=360:E-v>180&&(v+=360),T.push({i:D.push(i(D)+"rotate(",null,r)-2,x:$o(v,E)})):E&&D.push(i(D)+"rotate("+E+r)}(v.rotate,E.rotate,D,T),function d(v,E,D,T){v!==E?T.push({i:D.push(i(D)+"skewX(",null,r)-2,x:$o(v,E)}):E&&D.push(i(D)+"skewX("+E+r)}(v.skewX,E.skewX,D,T),function p(v,E,D,T,P,N){if(v!==D||E!==T){var G=P.push(i(P)+"scale(",null,",",null,")");N.push({i:G-4,x:$o(v,D)},{i:G-2,x:$o(E,T)})}else(1!==D||1!==T)&&P.push(i(P)+"scale("+D+","+T+")")}(v.scaleX,v.scaleY,E.scaleX,E.scaleY,D,T),v=E=null,function(P){for(var U,N=-1,G=T.length;++N>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?rb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?rb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=XZ.exec(e))?new eo(t[1],t[2],t[3],1):(t=YZ.exec(e))?new eo(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=KZ.exec(e))?rb(t[1],t[2],t[3],t[4]):(t=JZ.exec(e))?rb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=QZ.exec(e))?OR(t[1],t[2]/100,t[3]/100,1):(t=eW.exec(e))?OR(t[1],t[2]/100,t[3]/100,t[4]):IR.hasOwnProperty(e)?PR(IR[e]):"transparent"===e?new eo(NaN,NaN,NaN,0):null}function PR(e){return new eo(e>>16&255,e>>8&255,255&e,1)}function rb(e,t,n,r){return r<=0&&(e=t=n=NaN),new eo(e,t,n,r)}function RE(e){return e instanceof Rh||(e=Fh(e)),e?new eo((e=e.rgb()).r,e.g,e.b,e.opacity):new eo}function Oh(e,t,n,r){return 1===arguments.length?RE(e):new eo(e,t,n,r??1)}function eo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function RR(){return`#${pf(this.r)}${pf(this.g)}${pf(this.b)}`}function FR(){const e=ib(this.opacity);return`${1===e?"rgb(":"rgba("}${ff(this.r)}, ${ff(this.g)}, ${ff(this.b)}${1===e?")":`, ${e})`}`}function ib(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ff(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pf(e){return((e=ff(e))<16?"0":"")+e.toString(16)}function OR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xl(e,t,n,r)}function LR(e){if(e instanceof xl)return new xl(e.h,e.s,e.l,e.opacity);if(e instanceof Rh||(e=Fh(e)),!e)return new xl;if(e instanceof xl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),c=NaN,d=a-i,p=(a+i)/2;return d?(c=t===a?(n-r)/d+6*(n0&&p<1?0:c,new xl(c,d,p,e.opacity)}function FE(e,t,n,r){return 1===arguments.length?LR(e):new xl(e,t,n,r??1)}function xl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function NR(e){return(e=(e||0)%360)<0?e+360:e}function ob(e){return Math.max(0,Math.min(1,e||0))}function OE(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function zR(e,t,n,r,i){var a=e*e,c=a*e;return((1-3*e+3*a-c)*t+(4-6*a+3*c)*n+(1+3*e+3*a-3*c)*r+c*i)/6}im(Rh,Fh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:AR,formatHex:AR,formatHex8:function tW(){return this.rgb().formatHex8()},formatHsl:function nW(){return LR(this).formatHsl()},formatRgb:kR,toString:kR}),im(eo,Oh,Ly(Rh,{brighter(e){return e=null==e?om:Math.pow(om,e),new eo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new eo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new eo(ff(this.r),ff(this.g),ff(this.b),ib(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:RR,formatHex:RR,formatHex8:function rW(){return`#${pf(this.r)}${pf(this.g)}${pf(this.b)}${pf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:FR,toString:FR})),im(xl,FE,Ly(Rh,{brighter(e){return e=null==e?om:Math.pow(om,e),new xl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new eo(OE(e>=240?e-240:e+120,i,r),OE(e,i,r),OE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new xl(NR(this.h),ob(this.s),ob(this.l),ib(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ib(this.opacity);return`${1===e?"hsl(":"hsla("}${NR(this.h)}, ${100*ob(this.s)}%, ${100*ob(this.l)}%${1===e?")":`, ${e})`}`}}));const sb=e=>()=>e;function BR(e,t){return function(n){return e+n*t}}function LE(e,t){var n=t-e;return n?BR(e,n>180||n<-180?n-360*Math.round(n/360):n):sb(isNaN(e)?t:e)}function to(e,t){var n=t-e;return n?BR(e,n):sb(isNaN(e)?t:e)}const mf=function e(t){var n=function aW(e){return 1==(e=+e)?to:function(t,n){return n-t?function sW(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):sb(isNaN(t)?n:t)}}(t);function r(i,a){var c=n((i=Oh(i)).r,(a=Oh(a)).r),d=n(i.g,a.g),p=n(i.b,a.b),v=to(i.opacity,a.opacity);return function(E){return i.r=c(E),i.g=d(E),i.b=p(E),i.opacity=v(E),i+""}}return r.gamma=e,r}(1);function VR(e){return function(t){var c,d,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n);for(c=0;c=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1];return zR((n-r/t)*t,r>0?e[r-1]:2*i-a,i,a,rn&&(a=t.slice(n,a),d[c]?d[c]+=a:d[++c]=a),(r=r[0])===(i=i[0])?d[c]?d[c]+=i:d[++c]=i:(d[++c]=null,p.push({i:c,x:$o(r,i)})),n=zE.lastIndex;return n=0&&(t=t.slice(0,n)),!t||"start"===t})}(t)?AE:gc;return function(){var c=a(this,e),d=c.on;d!==r&&(i=(r=d).copy()).on(t,n),c.on=i}}var $W=ky.prototype.constructor;function jR(e){return function(){this.style.removeProperty(e)}}function XW(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function YW(e,t,n){var r,i;function a(){var c=t.apply(this,arguments);return c!==i&&(r=(i=c)&&XW(e,c,n)),r}return a._value=t,a}function tX(e){return function(t){this.textContent=e.call(this,t)}}function nX(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&tX(i)),t}return r._value=e,r}var sX=0;function pu(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function HR(){return++sX}var mu=ky.prototype;pu.prototype=function aX(e){return ky().transition(e)}.prototype={constructor:pu,select:function VW(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=wE(e));for(var r=this._groups,i=r.length,a=new Array(i),c=0;c2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[c]):a=!1;a&&delete e.__transition}}(this,e)})},ky.prototype.transition=function hX(e){var t,n;e instanceof pu?(t=e._id,e=e._name):(t=HR(),(n=cX).time=SE(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,a=0;a1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cm(e){return(e=cb(Math.abs(e)))?e[1]:NaN}["w","e"].map(zy),["n","s"].map(zy),["n","w","e","s","nw","ne","sw","se"].map(zy);var YR,wX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function By(e){if(!(t=wX.exec(e)))throw new Error("invalid format: "+e);var t;return new jE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function jE(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function KR(e,t){var n=cb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}By.prototype=jE.prototype,jE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const JR={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function vX(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>KR(100*e,t),r:KR,s:function EX(e,t){var n=cb(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(YR=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,c=r.length;return a===c?r:a>c?r+new Array(a-c+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+cb(e,Math.max(0,t+a-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function QR(e){return e}var ub,um,nF,eF=Array.prototype.map,tF=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];!function SX(e){ub=function DX(e){var t=void 0===e.grouping||void 0===e.thousands?QR:function bX(e,t){return function(n,r){for(var i=n.length,a=[],c=0,d=e[0],p=0;i>0&&d>0&&(p+d+1>r&&(d=Math.max(1,r-p)),a.push(n.substring(i-=d,i+d)),!((p+=d+1)>r));)d=e[c=(c+1)%e.length];return a.reverse().join(t)}}(eF.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?QR:function xX(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}(eF.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"\u2212":e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function v(D){var T=(D=By(D)).fill,P=D.align,N=D.sign,G=D.symbol,U=D.zero,Z=D.width,ne=D.comma,X=D.precision,re=D.trim,fe=D.type;"n"===fe?(ne=!0,fe="g"):JR[fe]||(void 0===X&&(X=12),re=!0,fe="g"),(U||"0"===T&&"="===P)&&(U=!0,T="0",P="=");var ve="$"===G?n:"#"===G&&/[boxX]/.test(fe)?"0"+fe.toLowerCase():"",Re="$"===G?r:/[%p]/.test(fe)?c:"",We=JR[fe],Ke=/[defgprs%]/.test(fe);function lt(Ue){var le,de,pe,st=ve,Fe=Re;if("c"===fe)Fe=We(Ue)+Fe,Ue="";else{var Oe=(Ue=+Ue)<0||1/Ue<0;if(Ue=isNaN(Ue)?p:We(Math.abs(Ue),X),re&&(Ue=function CX(e){e:for(var i,t=e.length,n=1,r=-1;n0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}(Ue)),Oe&&0==+Ue&&"+"!==N&&(Oe=!1),st=(Oe?"("===N?N:d:"-"===N||"("===N?"":N)+st,Fe=("s"===fe?tF[8+YR/3]:"")+Fe+(Oe&&"("===N?")":""),Ke)for(le=-1,de=Ue.length;++le(pe=Ue.charCodeAt(le))||pe>57){Fe=(46===pe?i+Ue.slice(le+1):Ue.slice(le))+Fe,Ue=Ue.slice(0,le);break}}ne&&!U&&(Ue=t(Ue,1/0));var Ye=st.length+Ue.length+Fe.length,Ze=Ye>1)+st+Ue+Fe+Ze.slice(Ye);break;default:Ue=Ze+st+Ue+Fe}return a(Ue)}return X=void 0===X?6:/[gprs]/.test(fe)?Math.max(1,Math.min(21,X)):Math.max(0,Math.min(20,X)),lt.toString=function(){return D+""},lt}return{format:v,formatPrefix:function E(D,T){var P=v(((D=By(D)).type="f",D)),N=3*Math.max(-8,Math.min(8,Math.floor(cm(T)/3))),G=Math.pow(10,-N),U=tF[8+N/3];return function(Z){return P(G*Z)+U}}}}(e),um=ub.format,nF=ub.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});var hn=1e-6,Dn=Math.PI,ni=Dn/2,iF=Dn/4,Ks=2*Dn,as=180/Dn,ri=Dn/180,mr=Math.abs,hm=Math.atan,yu=Math.atan2,bn=Math.cos,oF=(Math,Math.exp),hb=(Math,Math,Math.log),HE=Math.pow,on=Math.sin,Da=Math.sign||function(e){return e>0?1:e<0?-1:0},Is=Math.sqrt,GE=Math.tan;function sF(e){return e>1?0:e<-1?Dn:Math.acos(e)}function Sa(e){return e>1?ni:e<-1?-ni:Math.asin(e)}function Ma(){}function aF(){var t,e=[];return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ma,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function db(e,t){return mr(e[0]-t[0])=0;--d)i.point((D=E[d])[0],D[1]);else r(T.x,T.p.x,-1,i);T=T.p}E=(T=T.o).z,P=!P}while(!T.v);i.lineEnd()}}}function cF(e){if(t=e.length){for(var t,i,n=0,r=e[0];++n0)do{T.point(0===P||3===P?e:n,P>1?r:t)}while((P=(P+D+4)%4)!==N);else T.point(E[0],E[1])}function c(v,E){return mr(v[0]-e)0?0:3:mr(v[0]-n)0?2:1:mr(v[1]-t)0?1:0:E>0?3:2}function d(v,E){return p(v.x,E.x)}function p(v,E){var D=c(v,1),T=c(E,1);return D!==T?D-T:0===D?E[1]-v[1]:1===D?v[0]-E[0]:2===D?v[1]-E[1]:E[0]-v[0]}return function(v){var T,P,N,G,U,Z,ne,X,re,fe,ve,E=v,D=aF(),Re={point:We,lineStart:function st(){Re.point=le,P&&P.push(N=[]),fe=!0,re=!1,ne=X=NaN},lineEnd:function Fe(){T&&(le(G,U),Z&&re&&D.rejoin(),T.push(D.result())),Re.point=We,re&&E.lineEnd()},polygonStart:function lt(){E=D,T=[],P=[],ve=!0},polygonEnd:function Ue(){var de=function Ke(){for(var de=0,pe=0,Oe=P.length;per&&(Hn-Ft)*(r-sr)>(gr-sr)*(e-Ft)&&++de:gr<=r&&(Hn-Ft)*(r-sr)<(gr-sr)*(e-Ft)&&--de;return de}(),pe=ve&&de,Oe=(T=uF(T)).length;(pe||Oe)&&(v.polygonStart(),pe&&(v.lineStart(),a(null,null,1,v),v.lineEnd()),Oe&&lF(T,d,de,a,v),v.polygonEnd()),E=v,T=P=N=null}};function We(de,pe){i(de,pe)&&E.point(de,pe)}function le(de,pe){var Oe=i(de,pe);if(P&&N.push([de,pe]),fe)G=de,U=pe,Z=Oe,fe=!1,Oe&&(E.lineStart(),E.point(de,pe));else if(Oe&&re)E.point(de,pe);else{var Ye=[ne=Math.max(pb,Math.min(Vy,ne)),X=Math.max(pb,Math.min(Vy,X))],Ze=[de=Math.max(pb,Math.min(Vy,de)),pe=Math.max(pb,Math.min(Vy,pe))];!function MX(e,t,n,r,i,a){var N,c=e[0],d=e[1],E=0,D=1,T=t[0]-c,P=t[1]-d;if(N=n-c,T||!(N>0)){if(N/=T,T<0){if(N0){if(N>D)return;N>E&&(E=N)}if(N=i-c,T||!(N<0)){if(N/=T,T<0){if(N>D)return;N>E&&(E=N)}else if(T>0){if(N0)){if(N/=P,P<0){if(N0){if(N>D)return;N>E&&(E=N)}if(N=a-d,P||!(N<0)){if(N/=P,P<0){if(N>D)return;N>E&&(E=N)}else if(P>0){if(N0&&(e[0]=c+E*T,e[1]=d+E*P),D<1&&(t[0]=c+D*T,t[1]=d+D*P),!0}}}}}(Ye,Ze,e,t,n,r)?Oe&&(E.lineStart(),E.point(de,pe),ve=!1):(re||(E.lineStart(),E.point(Ye[0],Ye[1])),E.point(Ze[0],Ze[1]),Oe||E.lineEnd(),ve=!1)}ne=de,X=pe,re=Oe}return Re}}const qE=e=>e;function mb(e,t){e&&fF.hasOwnProperty(e.type)&&fF[e.type](e,t)}var dF={Feature:function(e,t){mb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0){for(c=t[--n];n>0&&(r=c,i=t[--n],c=r+i,a=i-(c-r),!a););n>0&&(a<0&&t[n-1]<0||a>0&&t[n-1]>0)&&(i=2*a,r=c+i,i==r-c&&(c=r))}return c}}var mF,gF,YE,KE,WE=new _u,XE=new _u,Lh={point:Ma,lineStart:Ma,lineEnd:Ma,polygonStart:function(){Lh.lineStart=IX,Lh.lineEnd=kX},polygonEnd:function(){Lh.lineStart=Lh.lineEnd=Lh.point=Ma,WE.add(mr(XE)),XE=new _u},result:function(){var e=WE/2;return WE=new _u,e}};function IX(){Lh.point=AX}function AX(e,t){Lh.point=yF,mF=YE=e,gF=KE=t}function yF(e,t){XE.add(KE*e-YE*t),YE=e,KE=t}function kX(){yF(mF,gF)}const _F=Lh;var fm=1/0,gb=fm,Uy=-fm,yb=Uy;const _b={point:function RX(e,t){eUy&&(Uy=e),tyb&&(yb=t)},lineStart:Ma,lineEnd:Ma,polygonStart:Ma,polygonEnd:Ma,result:function(){var e=[[fm,gb],[Uy,yb]];return Uy=yb=-(gb=fm=1/0),e}};var vF,bF,_c,vc,JE=0,QE=0,$y=0,vb=0,bb=0,pm=0,eD=0,tD=0,jy=0,wl={point:gf,lineStart:xF,lineEnd:wF,polygonStart:function(){wl.lineStart=LX,wl.lineEnd=NX},polygonEnd:function(){wl.point=gf,wl.lineStart=xF,wl.lineEnd=wF},result:function(){var e=jy?[eD/jy,tD/jy]:pm?[vb/pm,bb/pm]:$y?[JE/$y,QE/$y]:[NaN,NaN];return JE=QE=$y=vb=bb=pm=eD=tD=jy=0,e}};function gf(e,t){JE+=e,QE+=t,++$y}function xF(){wl.point=FX}function FX(e,t){wl.point=OX,gf(_c=e,vc=t)}function OX(e,t){var n=e-_c,r=t-vc,i=Is(n*n+r*r);vb+=i*(_c+e)/2,bb+=i*(vc+t)/2,pm+=i,gf(_c=e,vc=t)}function wF(){wl.point=gf}function LX(){wl.point=zX}function NX(){CF(vF,bF)}function zX(e,t){wl.point=CF,gf(vF=_c=e,bF=vc=t)}function CF(e,t){var n=e-_c,r=t-vc,i=Is(n*n+r*r);vb+=i*(_c+e)/2,bb+=i*(vc+t)/2,pm+=i,eD+=(i=vc*e-_c*t)*(_c+e),tD+=i*(vc+t),jy+=3*i,gf(_c=e,vc=t)}const EF=wl;function DF(e){this._context=e}DF.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ks)}},result:Ma};var rD,SF,MF,Hy,Gy,nD=new _u,xb={point:Ma,lineStart:function(){xb.point=BX},lineEnd:function(){rD&&TF(SF,MF),xb.point=Ma},polygonStart:function(){rD=!0},polygonEnd:function(){rD=null},result:function(){var e=+nD;return nD=new _u,e}};function BX(e,t){xb.point=TF,SF=Hy=e,MF=Gy=t}function TF(e,t){nD.add(Is((Hy-=e)*Hy+(Gy-=t)*Gy)),Hy=e,Gy=t}const IF=xb;let AF,wb,kF,PF;class RF{constructor(t){this._append=null==t?FF:function VX(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return FF;if(t!==AF){const n=10**t;AF=t,wb=function(i){let a=1;this._+=i[0];for(const c=i.length;a=0))throw new RangeError(`invalid digits: ${d}`);n=p}return null===t&&(a=new RF(n)),c},c.projection(e).digits(n).context(t)}function oD(e){return[yu(e[1],e[0]),Sa(e[2])]}function mm(e){var t=e[0],n=e[1],r=bn(n);return[r*bn(t),r*on(t),on(n)]}function Cb(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Eb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function sD(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Db(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function aD(e){var t=Is(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function lD(e){return mr(e[0])<=Dn?e[0]:Da(e[0])*((mr(e[0])+Dn)%Ks-Dn)}function OF(e,t,n,r){return function(i){var v,E,D,a=t(i),c=aF(),d=t(c),p=!1,T={point:P,lineStart:G,lineEnd:U,polygonStart:function(){T.point=Z,T.lineStart=ne,T.lineEnd=X,E=[],v=[]},polygonEnd:function(){T.point=P,T.lineStart=G,T.lineEnd=U,E=uF(E);var re=function UX(e,t){var n=lD(t),r=t[1],i=on(r),a=[on(n),-bn(n),0],c=0,d=0,p=new _u;1===i?r=ni+hn:-1===i&&(r=-ni-hn);for(var v=0,E=e.length;v=0?1:-1,lt=Ke*We,Ue=lt>Dn,st=U*ve;if(p.add(yu(st*Ke*on(lt),Z*Re+st*bn(lt))),c+=Ue?We+Ke*Ks:We,Ue^N>=n^re>=n){var Fe=Eb(mm(P),mm(X));aD(Fe);var le=Eb(a,Fe);aD(le);var de=(Ue^We>=0?-1:1)*Sa(le[2]);(r>de||r===de&&(Fe[0]||Fe[1]))&&(d+=Ue^We>=0?1:-1)}}return(c<-hn||c0){for(p||(i.polygonStart(),p=!0),i.lineStart(),ve=0;ve1&&2&re&&fe.push(fe.pop().concat(fe.shift())),E.push(fe.filter($X))}}return T}}function $X(e){return e.length>1}function jX(e,t){return((e=e.x)[0]<0?e[1]-ni-hn:ni-e[1])-((t=t.x)[0]<0?t[1]-ni-hn:ni-t[1])}const LF=OF(function(){return!0},function HX(e){var i,t=NaN,n=NaN,r=NaN;return{lineStart:function(){e.lineStart(),i=1},point:function(a,c){var d=a>0?Dn:-Dn,p=mr(a-t);mr(p-Dn)0?ni:-ni),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),e.point(a,n),i=0):r!==d&&p>=Dn&&(mr(t-r)hn?hm((on(t)*(a=bn(r))*on(n)-on(r)*(i=bn(t))*on(e))/(i*a*c)):(t+r)/2}(t,n,a,c),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(d,n),i=0),e.point(t=a,n=c),r=d},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}},function qX(e,t,n,r){var i;if(null==e)r.point(-Dn,i=n*ni),r.point(0,i),r.point(Dn,i),r.point(Dn,0),r.point(Dn,-i),r.point(0,-i),r.point(-Dn,-i),r.point(-Dn,0),r.point(-Dn,i);else if(mr(e[0]-t[0])>hn){var a=e[0]0,i=mr(t)>hn;function c(E,D){return bn(E)*bn(D)>t}function p(E,D,T){var G=[1,0,0],U=Eb(mm(E),mm(D)),Z=Cb(U,U),ne=U[0],X=Z-ne*ne;if(!X)return!T&&E;var re=t*Z/X,fe=-t*ne/X,ve=Eb(G,U),Re=Db(G,re);sD(Re,Db(U,fe));var Ke=ve,lt=Cb(Re,Ke),Ue=Cb(Ke,Ke),st=lt*lt-Ue*(Cb(Re,Re)-1);if(!(st<0)){var Fe=Is(st),le=Db(Ke,(-lt-Fe)/Ue);if(sD(le,Re),le=oD(le),!T)return le;var Ze,de=E[0],pe=D[0],Oe=E[1],Ye=D[1];pe0^le[1]<(mr(le[0]-de)Dn^(de<=le[0]&&le[0]<=pe)){var sr=Db(Ke,(-lt+Fe)/Ue);return sD(sr,Re),[le,oD(sr)]}}}function v(E,D){var T=r?e:Dn-e,P=0;return E<-T?P|=1:E>T&&(P|=2),D<-T?P|=4:D>T&&(P|=8),P}return OF(c,function d(E){var D,T,P,N,G;return{lineStart:function(){N=P=!1,G=1},point:function(U,Z){var X,ne=[U,Z],re=c(U,Z),fe=r?re?0:v(U,Z):re?v(U+(U<0?Dn:-Dn),Z):0;if(!D&&(N=P=re)&&E.lineStart(),re!==P&&(!(X=p(D,ne))||db(D,X)||db(ne,X))&&(ne[2]=1),re!==P)G=0,re?(E.lineStart(),X=p(ne,D),E.point(X[0],X[1])):(X=p(D,ne),E.point(X[0],X[1],2),E.lineEnd()),D=X;else if(i&&D&&r^re){var ve;!(fe&T)&&(ve=p(ne,D,!0))&&(G=0,r?(E.lineStart(),E.point(ve[0][0],ve[0][1]),E.point(ve[1][0],ve[1][1]),E.lineEnd()):(E.point(ve[1][0],ve[1][1]),E.lineEnd(),E.lineStart(),E.point(ve[0][0],ve[0][1],3)))}re&&(!D||!db(D,ne))&&E.point(ne[0],ne[1]),D=ne,P=re,T=fe},lineEnd:function(){P&&E.lineEnd(),D=null},clean:function(){return G|(N&&P)<<1}}},function a(E,D,T,P){!function NF(e,t,n,r,i,a){if(n){var c=bn(t),d=on(t),p=r*n;null==i?(i=t+r*Ks,a=t-p/2):(i=zF(c,i),a=zF(c,a),(r>0?ia)&&(i+=r*Ks));for(var v,E=i;r>0?E>a:EDn&&(e-=Math.round(e/Ks)*Ks),[e,t]}function BF(e,t,n){return(e%=Ks)?t||n?cD(UF(e),$F(t,n)):UF(e):t||n?$F(t,n):uD}function VF(e){return function(t,n){return mr(t+=e)>Dn&&(t-=Math.round(t/Ks)*Ks),[t,n]}}function UF(e){var t=VF(e);return t.invert=VF(-e),t}function $F(e,t){var n=bn(e),r=on(e),i=bn(t),a=on(t);function c(d,p){var v=bn(p),E=bn(d)*v,D=on(d)*v,T=on(p),P=T*n+E*r;return[yu(D*i-P*a,E*n-T*r),Sa(P*i+D*a)]}return c.invert=function(d,p){var v=bn(p),E=bn(d)*v,D=on(d)*v,T=on(p),P=T*i-D*a;return[yu(D*i+T*a,E*n+P*r),Sa(P*n-E*r)]},c}function hD(e){return{stream:Sb(e)}}function Sb(e){return function(t){var n=new dD;for(var r in e)n[r]=e[r];return n.stream=t,n}}function dD(){}function fD(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),dm(n,e.stream(_b)),t(_b.result()),null!=r&&e.clipExtent(r),e}function pD(e,t,n){return fD(e,function(r){var i=t[1][0]-t[0][0],a=t[1][1]-t[0][1],c=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),d=+t[0][0]+(i-c*(r[1][0]+r[0][0]))/2,p=+t[0][1]+(a-c*(r[1][1]+r[0][1]))/2;e.scale(150*c).translate([d,p])},n)}function jF(e,t,n){return pD(e,[[0,0],t],n)}function HF(e,t,n){return fD(e,function(r){var i=+t,a=i/(r[1][0]-r[0][0]),c=(i-a*(r[1][0]+r[0][0]))/2,d=-a*r[0][1];e.scale(150*a).translate([c,d])},n)}function GF(e,t,n){return fD(e,function(r){var i=+t,a=i/(r[1][1]-r[0][1]),c=-a*r[0][0],d=(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([c,d])},n)}uD.invert=uD,dD.prototype={constructor:dD,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var XX=bn(30*ri);function ZF(e,t){return+t?function KX(e,t){function n(r,i,a,c,d,p,v,E,D,T,P,N,G,U){var Z=v-r,ne=E-i,X=Z*Z+ne*ne;if(X>4*t&&G--){var re=c+T,fe=d+P,ve=p+N,Re=Is(re*re+fe*fe+ve*ve),We=Sa(ve/=Re),Ke=mr(mr(ve)-1)t||mr((Z*Fe+ne*le)/X-.5)>.3||c*T+d*P+p*N2?de[2]%360*ri:0,Fe()):[d*as,p*as,v*as]},Ue.angle=function(de){return arguments.length?(D=de%360*ri,Fe()):D*as},Ue.reflectX=function(de){return arguments.length?(T=de?-1:1,Fe()):T<0},Ue.reflectY=function(de){return arguments.length?(P=de?-1:1,Fe()):P<0},Ue.precision=function(de){return arguments.length?(ve=ZF(Re,fe=de*de),le()):Is(fe)},Ue.fitExtent=function(de,pe){return pD(Ue,de,pe)},Ue.fitSize=function(de,pe){return jF(Ue,de,pe)},Ue.fitWidth=function(de,pe){return HF(Ue,de,pe)},Ue.fitHeight=function(de,pe){return GF(Ue,de,pe)},function(){return t=e.apply(this,arguments),Ue.invert=t.invert&&st,Fe()}}function mD(e){var t=0,n=Dn/3,r=XF(e),i=r(t,n);return i.parallels=function(a){return arguments.length?r(t=a[0]*ri,n=a[1]*ri):[t*as,n*as]},i}function nY(e,t){var n=on(e),r=(n+on(t))/2;if(mr(r)=.12&&U<.234&&G>=-.425&&G<-.214?i:U>=.166&&U<.234&&G>=-.214&&G<-.115?c:n).invert(T)},E.stream=function(T){return e&&t===T?e:e=function rY(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i2?e[2]*ri:0),t.invert=function(n){return(n=e.invert(n[0]*ri,n[1]*ri))[0]*=as,n[1]*=as,n},t}(t.rotate()).invert([0,0]));return a(null==c?[[T[0]-D,T[1]-D],[T[0]+D,T[1]+D]]:e===Tb?[[Math.max(T[0]-D,c),d],[Math.min(T[0]+D,p),v]]:[[c,Math.max(T[1]-D,d)],[p,Math.min(T[1]+D,v)]])}return t.scale=function(D){return arguments.length?(r(D),E()):r()},t.translate=function(D){return arguments.length?(i(D),E()):i()},t.center=function(D){return arguments.length?(n(D),E()):n()},t.clipExtent=function(D){return arguments.length?(null==D?c=d=p=v=null:(c=+D[0][0],d=+D[0][1],p=+D[1][0],v=+D[1][1]),E()):null==c?null:[[c,d],[p,v]]},E()}function Ib(e){return GE((ni+e)/2)}function lY(e,t){var n=bn(e),r=e===t?on(e):hb(n/bn(t))/hb(Ib(t)/Ib(e)),i=n*HE(Ib(e),r)/r;if(!r)return Tb;function a(c,d){i>0?d<-ni+hn&&(d=-ni+hn):d>ni-hn&&(d=ni-hn);var p=i/HE(Ib(d),r);return[p*on(r*c),i-p*bn(r*c)]}return a.invert=function(c,d){var p=i-d,v=Da(r)*Is(c*c+p*p),E=yu(c,mr(p))*Da(p);return p*r<0&&(E-=Dn*Da(c)*Da(p)),[E/r,2*hm(HE(i/v,1/r))-ni]},a}function cY(){return mD(lY).scale(109.5).parallels([30,30])}function Ab(e,t){return[e,t]}function uY(){return Nh(Ab).scale(152.63)}function hY(e,t){var n=bn(e),r=e===t?on(e):(n-bn(t))/(t-e),i=n/r+e;if(mr(r)2?r[2]+90:90]):[(r=n())[0],r[1],r[2]-90]},n([0,0,90]).scale(159.155)}function gD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function sO(e){return function(t,n){var r=e((t=FE(t)).h,(n=FE(n)).h),i=to(t.s,n.s),a=to(t.l,n.l),c=to(t.opacity,n.opacity);return function(d){return t.h=r(d),t.s=i(d),t.l=a(d),t.opacity=c(d),t+""}}}tO.invert=function(e,t){for(var c,n=t,r=n*n,i=r*r*r,a=0;a<12&&(i=(r=(n-=c=(n*(Zy+Wy*r+i*(Xy+Yy*r))-t)/(Zy+3*Wy*r+i*(7*Xy+9*Yy*r)))*n)*r*r,!(mr(c)<1e-12));++a);return[kb*e*(Zy+3*Wy*r+i*(7*Xy+9*Yy*r))/bn(n),Sa(on(n)/kb)]},nO.invert=qy(hm),rO.invert=qy(Sa),iO.invert=qy(function(e){return 2*hm(e)}),oO.invert=function(e,t){return[-t,2*hm(oF(e))-ni]};const vY=sO(LE);sO(to);const aO=Math.PI/180,lO=180/Math.PI,dO=4/29,gm=6/29,fO=3*gm*gm;function pO(e){if(e instanceof Cl)return new Cl(e.l,e.a,e.b,e.opacity);if(e instanceof bc)return gO(e);e instanceof eo||(e=RE(e));var a,c,t=xD(e.r),n=xD(e.g),r=xD(e.b),i=_D((.2225045*t+.7168786*n+.0606169*r)/1);return t===n&&n===r?a=c=i:(a=_D((.4360747*t+.3850649*n+.1430804*r)/.96422),c=_D((.0139322*t+.0971045*n+.7141733*r)/.82521)),new Cl(116*i-16,500*(a-i),200*(i-c),e.opacity)}function yD(e,t,n,r){return 1===arguments.length?pO(e):new Cl(e,t,n,r??1)}function Cl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function _D(e){return e>.008856451679035631?Math.pow(e,1/3):e/fO+dO}function vD(e){return e>gm?e*e*e:fO*(e-dO)}function bD(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function xD(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mO(e){if(e instanceof bc)return new bc(e.h,e.c,e.l,e.opacity);if(e instanceof Cl||(e=pO(e)),0===e.a&&0===e.b)return new bc(NaN,0=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vO;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;iyf)if(Math.abs(D*p-v*E)>yf&&a){let P=r-c,N=i-d,G=p*p+v*v,U=P*P+N*N,Z=Math.sqrt(G),ne=Math.sqrt(T),X=a*Math.tan((ED-Math.acos((G+T-U)/(2*Z*ne)))/2),re=X/ne,fe=X/Z;Math.abs(re-1)>yf&&this._append`L${t+re*E},${n+re*D}`,this._append`A${a},${a},0,0,${+(D*P>E*N)},${this._x1=t+fe*p},${this._y1=n+fe*v}`}else this._append`L${this._x1=t},${this._y1=n}`}arc(t,n,r,i,a,c){if(t=+t,n=+n,c=!!c,(r=+r)<0)throw new Error(`negative radius: ${r}`);let d=r*Math.cos(i),p=r*Math.sin(i),v=t+d,E=n+p,D=1^c,T=c?i-a:a-i;null===this._x1?this._append`M${v},${E}`:(Math.abs(this._x1-v)>yf||Math.abs(this._y1-E)>yf)&&this._append`L${v},${E}`,r&&(T<0&&(T=T%DD+DD),T>MY?this._append`A${r},${r},0,1,${D},${t-d},${n-p}A${r},${r},0,1,${D},${this._x1=v},${this._y1=E}`:T>yf&&this._append`A${r},${r},0,${+(T>=ED)},${D},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function _f(e=3){return new Rb(+e)}function xc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Fb(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const SD=Symbol("implicit");function MD(){var e=new L0,t=[],n=[],r=SD;function i(a){let c=e.get(a);if(void 0===c){if(r!==SD)return r;e.set(a,c=t.push(a)-1)}return n[c%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new L0;for(const c of a)e.has(c)||e.set(c,t.push(c)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return MD(t,n).unknown(r)},xc.apply(i,arguments),i}function Ob(){var a,c,e=MD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,d=!1,p=0,v=0,E=.5;function D(){var T=t().length,P=i>>1;n(d[D],p)<0?v=D+1:E=D}while(vvl(e(d),p),r=(d,p)=>e(d)-p):(t=e===vl||e===Sy?e:kY,n=e,r=e),{left:i,center:function c(d,p,v=0,E=d.length){const D=i(d,p,v,E-1);return D>v&&r(d[D-1],p)>-r(d[D],p)?D-1:D},right:function a(d,p,v=0,E=d.length){if(v>>1;n(d[D],p)<=0?v=D+1:E=D}while(vt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}(e[0],e[T-1])),d=T>2?LY:OY,p=v=null,D}function D(T){return null==T||isNaN(T=+T)?a:(p||(p=d(e.map(r),t,n)))(r(c(T)))}return D.invert=function(T){return c(i((v||(v=d(t,e.map(r),$o)))(T)))},D.domain=function(T){return arguments.length?(e=Array.from(T,AD),E()):e.slice()},D.range=function(T){return arguments.length?(t=Array.from(T),E()):t.slice()},D.rangeRound=function(T){return t=Array.from(T),n=gD,E()},D.clamp=function(T){return arguments.length?(c=!!T||Ta,E()):c!==Ta},D.interpolate=function(T){return arguments.length?(n=T,E()):n},D.unknown=function(T){return arguments.length?(a=T,D):a},function(T,P){return r=T,i=P,E()}}function CO(){return Lb()(Ta,Ta)}function Qy(e){var t=e.domain;return e.ticks=function(n){var r=t();return U0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return function VY(e,t,n,r){var a,i=bE(e,t,n);switch((r=By(r??",f")).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null==r.precision&&!isNaN(a=function NY(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cm(t)/3)))-cm(Math.abs(e)))}(i,c))&&(r.precision=a),nF(r,c);case"":case"e":case"g":case"p":case"r":null==r.precision&&!isNaN(a=function zY(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cm(t)-cm(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-("e"===r.type));break;case"f":case"%":null==r.precision&&!isNaN(a=function BY(e){return Math.max(0,-cm(Math.abs(e)))}(i))&&(r.precision=a-2*("%"===r.type))}return um(r)}(i[0],i[i.length-1],n??10,r)},e.nice=function(n){null==n&&(n=10);var p,v,r=t(),i=0,a=r.length-1,c=r[i],d=r[a],E=10;for(d0;){if((v=vE(c,d,n))===p)return r[i]=c,r[a]=d,t(r);if(v>0)c=Math.floor(c/v)*v,d=Math.ceil(d/v)*v;else{if(!(v<0))break;c=Math.ceil(c*v)/v,d=Math.floor(d*v)/v}p=v}return e},e}function PD(){var e=CO();return e.copy=function(){return Jy(e,PD())},xc.apply(e,arguments),Qy(e)}function EO(e){var t;function n(r){return null==r||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,AD),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return EO(e).unknown(t)},e=arguments.length?Array.from(e,AD):[0,1],Qy(n)}function DO(e,t){var c,n=0,r=(e=e.slice()).length-1,i=e[n],a=e[r];return a-e(-t,n)}function IO(e){const t=e(SO,MO),n=t.domain;let i,a,r=10;function c(){return i=function GY(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(r),a=function HY(e){return 10===e?jY:e===Math.E?Math.exp:t=>Math.pow(e,t)}(r),n()[0]<0?(i=TO(i),a=TO(a),e(UY,$Y)):e(SO,MO),t}return t.base=function(d){return arguments.length?(r=+d,c()):r},t.domain=function(d){return arguments.length?(n(d),c()):n()},t.ticks=d=>{const p=n();let v=p[0],E=p[p.length-1];const D=E0){for(;T<=P;++T)for(N=1;NE)break;Z.push(G)}}else for(;T<=P;++T)for(N=r-1;N>=1;--N)if(G=T>0?N/a(-T):N*a(T),!(GE)break;Z.push(G)}2*Z.length{if(null==d&&(d=10),null==p&&(p=10===r?"s":","),"function"!=typeof p&&(!(r%1)&&null==(p=By(p)).precision&&(p.trim=!0),p=um(p)),d===1/0)return p;const v=Math.max(1,r*d/t.ticks().length);return E=>{let D=E/a(Math.round(i(E)));return D*rn(DO(n(),{floor:d=>a(Math.floor(i(d))),ceil:d=>a(Math.ceil(i(d)))})),t}function AO(){const e=IO(Lb()).domain([1,10]);return e.copy=()=>Jy(e,AO()).base(e.base()),xc.apply(e,arguments),e}function kO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function PO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function RO(e){var t=1,n=e(kO(t),PO(t));return n.constant=function(r){return arguments.length?e(kO(t=+r),PO(t)):t},Qy(n)}function FO(){var e=RO(Lb());return e.copy=function(){return Jy(e,FO()).constant(e.constant())},xc.apply(e,arguments)}function OO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function ZY(e){return e<0?-e*e:e*e}function LO(e){var t=e(Ta,Ta),n=1;function r(){return 1===n?e(Ta,Ta):.5===n?e(qY,ZY):e(OO(n),OO(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Qy(t)}function RD(){var e=LO(Lb());return e.copy=function(){return Jy(e,RD()).exponent(e.exponent())},xc.apply(e,arguments),e}function NO(){var r,e=[],t=[],n=[];function i(){var c=0,d=Math.max(1,t.length);for(n=new Array(d-1);++c0?n[d-1]:e[0],d(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const c=i(a),d=i.ceil(a);return a-c(t(a=new Date(+a),null==c?1:Math.floor(c)),a),i.range=(a,c,d)=>{const p=[];if(a=i.ceil(a),d=null==d?1:Math.floor(d),!(a0))return p;let v;do{p.push(v=new Date(+a)),t(a,d),e(a)}while(vNi(c=>{if(c>=c)for(;e(c),!a(c);)c.setTime(c-1)},(c,d)=>{if(c>=c)if(d<0)for(;++d<=0;)for(;t(c,-1),!a(c););else for(;--d>=0;)for(;t(c,1),!a(c););}),n&&(i.count=(a,c)=>(LD.setTime(+a),ND.setTime(+c),e(LD),e(ND),Math.floor(n(LD,ND))),i.every=a=>(a=Math.floor(a),isFinite(a)&&a>0?a>1?i.filter(r?c=>r(c)%a==0:c=>i.count(0,c)%a==0):i:null)),i}const Nb=Ni(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Nb.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Ni(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Nb:null);const wu=Ni(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vu)},(e,t)=>(t-e)/vu,e=>e.getUTCSeconds()),zb=Ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu)},(e,t)=>{e.setTime(+e+t*Ia)},(e,t)=>(t-e)/Ia,e=>e.getMinutes()),Bb=Ni(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ia)},(e,t)=>(t-e)/Ia,e=>e.getUTCMinutes()),Vb=Ni(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vu-e.getMinutes()*Ia)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getHours()),Ub=Ni(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*bu)},(e,t)=>(t-e)/bu,e=>e.getUTCHours()),ym=Ni(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ia)/xu,e=>e.getDate()-1),e_=Ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>e.getUTCDate()-1),VO=Ni(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xu,e=>Math.floor(e/xu));function vf(e){return Ni(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+7*n)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ia)/FD)}const _m=vf(0),t_=vf(1),UO=vf(2),$O=vf(3),bf=vf(4),jO=vf(5),HO=vf(6);function xf(e){return Ni(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)},(t,n)=>(n-t)/FD)}const vm=xf(0),n_=xf(1),GO=xf(2),qO=xf(3),wf=xf(4),ZO=xf(5),WO=xf(6),bm=Ni(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth()),xm=Ni(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth()),wc=Ni(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());wc.every=e=>isFinite(e=Math.floor(e))&&e>0?Ni(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;const Cc=Ni(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function XO(e,t,n,r,i,a){const c=[[wu,1,vu],[wu,5,5e3],[wu,15,15e3],[wu,30,3e4],[a,1,Ia],[a,5,5*Ia],[a,15,15*Ia],[a,30,30*Ia],[i,1,bu],[i,3,3*bu],[i,6,6*bu],[i,12,12*bu],[r,1,xu],[r,2,2*xu],[n,1,FD],[t,1,BO],[t,3,3*BO],[e,1,OD]];function p(v,E,D){const T=Math.abs(E-v)/D,P=TD(([,,U])=>U).right(c,T);if(P===c.length)return e.every(bE(v/OD,E/OD,D));if(0===P)return Nb.every(Math.max(bE(v,E,D),1));const[N,G]=c[T/c[P-1][2]isFinite(e=Math.floor(e))&&e>0?Ni(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;const[WY,XY]=XO(Cc,xm,vm,VO,Ub,Bb),[YY,KY]=XO(wc,bm,_m,ym,Vb,zb);function zD(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function BD(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function r_(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var wm,uL,s_,YO={"-":"",_:" ",0:"0"},no=/^\s*\d+/,QY=/^%/,eK=/[\\^$*+?|[\]().{}]/g;function Xn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a[t.toLowerCase(),n]))}function nK(e,t,n){var r=no.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function rK(e,t,n){var r=no.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function iK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function oK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function sK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function KO(e,t,n){var r=no.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function JO(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function aK(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function lK(e,t,n){var r=no.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function cK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function QO(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function uK(e,t,n){var r=no.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function eL(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function dK(e,t,n){var r=no.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function fK(e,t,n){var r=no.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function pK(e,t,n){var r=no.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function mK(e,t,n){var r=QY.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function gK(e,t,n){var r=no.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function yK(e,t,n){var r=no.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tL(e,t){return Xn(e.getDate(),t,2)}function _K(e,t){return Xn(e.getHours(),t,2)}function vK(e,t){return Xn(e.getHours()%12||12,t,2)}function bK(e,t){return Xn(1+ym.count(wc(e),e),t,3)}function nL(e,t){return Xn(e.getMilliseconds(),t,3)}function xK(e,t){return nL(e,t)+"000"}function wK(e,t){return Xn(e.getMonth()+1,t,2)}function CK(e,t){return Xn(e.getMinutes(),t,2)}function EK(e,t){return Xn(e.getSeconds(),t,2)}function DK(e){var t=e.getDay();return 0===t?7:t}function SK(e,t){return Xn(_m.count(wc(e)-1,e),t,2)}function rL(e){var t=e.getDay();return t>=4||0===t?bf(e):bf.ceil(e)}function MK(e,t){return e=rL(e),Xn(bf.count(wc(e),e)+(4===wc(e).getDay()),t,2)}function TK(e){return e.getDay()}function IK(e,t){return Xn(t_.count(wc(e)-1,e),t,2)}function AK(e,t){return Xn(e.getFullYear()%100,t,2)}function kK(e,t){return Xn((e=rL(e)).getFullYear()%100,t,2)}function PK(e,t){return Xn(e.getFullYear()%1e4,t,4)}function RK(e,t){var n=e.getDay();return Xn((e=n>=4||0===n?bf(e):bf.ceil(e)).getFullYear()%1e4,t,4)}function FK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Xn(t/60|0,"0",2)+Xn(t%60,"0",2)}function iL(e,t){return Xn(e.getUTCDate(),t,2)}function OK(e,t){return Xn(e.getUTCHours(),t,2)}function LK(e,t){return Xn(e.getUTCHours()%12||12,t,2)}function NK(e,t){return Xn(1+e_.count(Cc(e),e),t,3)}function oL(e,t){return Xn(e.getUTCMilliseconds(),t,3)}function zK(e,t){return oL(e,t)+"000"}function BK(e,t){return Xn(e.getUTCMonth()+1,t,2)}function VK(e,t){return Xn(e.getUTCMinutes(),t,2)}function UK(e,t){return Xn(e.getUTCSeconds(),t,2)}function $K(e){var t=e.getUTCDay();return 0===t?7:t}function jK(e,t){return Xn(vm.count(Cc(e)-1,e),t,2)}function sL(e){var t=e.getUTCDay();return t>=4||0===t?wf(e):wf.ceil(e)}function HK(e,t){return e=sL(e),Xn(wf.count(Cc(e),e)+(4===Cc(e).getUTCDay()),t,2)}function GK(e){return e.getUTCDay()}function qK(e,t){return Xn(n_.count(Cc(e)-1,e),t,2)}function ZK(e,t){return Xn(e.getUTCFullYear()%100,t,2)}function WK(e,t){return Xn((e=sL(e)).getUTCFullYear()%100,t,2)}function XK(e,t){return Xn(e.getUTCFullYear()%1e4,t,4)}function YK(e,t){var n=e.getUTCDay();return Xn((e=n>=4||0===n?wf(e):wf.ceil(e)).getUTCFullYear()%1e4,t,4)}function KK(){return"+0000"}function aL(){return"%"}function lL(e){return+e}function cL(e){return Math.floor(+e/1e3)}function tJ(e){return new Date(e)}function nJ(e){return e instanceof Date?+e:+new Date(+e)}function VD(e,t,n,r,i,a,c,d,p,v){var E=CO(),D=E.invert,T=E.domain,P=v(".%L"),N=v(":%S"),G=v("%I:%M"),U=v("%I %p"),Z=v("%a %d"),ne=v("%b %d"),X=v("%B"),re=v("%Y");function fe(ve){return(p(ve)=12)]},q:function Ft(bt){return 1+~~(bt.getMonth()/3)},Q:lL,s:cL,S:EK,u:DK,U:SK,V:MK,w:TK,W:IK,x:null,X:null,y:AK,Y:PK,Z:FK,"%":aL},re={a:function sr(bt){return c[bt.getUTCDay()]},A:function Hn(bt){return a[bt.getUTCDay()]},b:function gr(bt){return p[bt.getUTCMonth()]},B:function wi(bt){return d[bt.getUTCMonth()]},c:null,d:iL,e:iL,f:zK,g:WK,G:YK,H:OK,I:LK,j:NK,L:oL,m:BK,M:VK,p:function Yn(bt){return i[+(bt.getUTCHours()>=12)]},q:function Vr(bt){return 1+~~(bt.getUTCMonth()/3)},Q:lL,s:cL,S:UK,u:$K,U:jK,V:HK,w:GK,W:qK,x:null,X:null,y:ZK,Y:XK,Z:KK,"%":aL},fe={a:function lt(bt,Kt,Pn){var Je=P.exec(Kt.slice(Pn));return Je?(bt.w=N.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},A:function Ue(bt,Kt,Pn){var Je=D.exec(Kt.slice(Pn));return Je?(bt.w=T.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},b:function st(bt,Kt,Pn){var Je=Z.exec(Kt.slice(Pn));return Je?(bt.m=ne.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},B:function Fe(bt,Kt,Pn){var Je=G.exec(Kt.slice(Pn));return Je?(bt.m=U.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},c:function le(bt,Kt,Pn){return We(bt,t,Kt,Pn)},d:QO,e:QO,f:pK,g:JO,G:KO,H:eL,I:eL,j:uK,L:fK,m:cK,M:hK,p:function Ke(bt,Kt,Pn){var Je=v.exec(Kt.slice(Pn));return Je?(bt.p=E.get(Je[0].toLowerCase()),Pn+Je[0].length):-1},q:lK,Q:gK,s:yK,S:dK,u:rK,U:iK,V:oK,w:nK,W:sK,x:function de(bt,Kt,Pn){return We(bt,n,Kt,Pn)},X:function pe(bt,Kt,Pn){return We(bt,r,Kt,Pn)},y:JO,Y:KO,Z:aK,"%":mK};function ve(bt,Kt){return function(Pn){var Mo,qt,oi,Je=[],Ur=-1,er=0,Zr=bt.length;for(Pn instanceof Date||(Pn=new Date(+Pn));++Ur53)return null;"w"in Je||(Je.w=1),"Z"in Je?(Zr=(er=BD(r_(Je.y,0,1))).getUTCDay(),er=Zr>4||0===Zr?n_.ceil(er):n_(er),er=e_.offset(er,7*(Je.V-1)),Je.y=er.getUTCFullYear(),Je.m=er.getUTCMonth(),Je.d=er.getUTCDate()+(Je.w+6)%7):(Zr=(er=zD(r_(Je.y,0,1))).getDay(),er=Zr>4||0===Zr?t_.ceil(er):t_(er),er=ym.offset(er,7*(Je.V-1)),Je.y=er.getFullYear(),Je.m=er.getMonth(),Je.d=er.getDate()+(Je.w+6)%7)}else("W"in Je||"U"in Je)&&("w"in Je||(Je.w="u"in Je?Je.u%7:"W"in Je?1:0),Zr="Z"in Je?BD(r_(Je.y,0,1)).getUTCDay():zD(r_(Je.y,0,1)).getDay(),Je.m=0,Je.d="W"in Je?(Je.w+6)%7+7*Je.W-(Zr+5)%7:Je.w+7*Je.U-(Zr+6)%7);return"Z"in Je?(Je.H+=Je.Z/100|0,Je.M+=Je.Z%100,BD(Je)):zD(Je)}}function We(bt,Kt,Pn,Je){for(var Mo,qt,Ur=0,er=Kt.length,Zr=Pn.length;Ur=Zr)return-1;if(37===(Mo=Kt.charCodeAt(Ur++))){if(Mo=Kt.charAt(Ur++),!(qt=fe[Mo in YO?Kt.charAt(Ur++):Mo])||(Je=qt(bt,Pn,Je))<0)return-1}else if(Mo!=Pn.charCodeAt(Je++))return-1}return Je}return X.x=ve(n,X),X.X=ve(r,X),X.c=ve(t,X),re.x=ve(n,re),re.X=ve(r,re),re.c=ve(t,re),{format:function(bt){var Kt=ve(bt+="",X);return Kt.toString=function(){return bt},Kt},parse:function(bt){var Kt=Re(bt+="",!1);return Kt.toString=function(){return bt},Kt},utcFormat:function(bt){var Kt=ve(bt+="",re);return Kt.toString=function(){return bt},Kt},utcParse:function(bt){var Kt=Re(bt+="",!0);return Kt.toString=function(){return bt},Kt}}}(e),uL=wm.format,s_=wm.utcFormat}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const lJ=dn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),cJ=dn("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),uJ=dn("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),hJ=dn("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),dJ=dn("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),fJ=dn("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),pJ=dn("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),mJ=dn("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),gJ=dn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),yJ=dn("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),xr=e=>lW(e[e.length-1]);var mL=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(dn);const gL=xr(mL);var yL=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(dn);const _L=xr(yL);var vL=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(dn);const bL=xr(vL);var xL=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(dn);const wL=xr(xL);var $D=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(dn);const Hb=xr($D);var CL=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(dn);const EL=xr(CL);var jD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(dn);const Gb=xr(jD);var DL=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(dn);const SL=xr(DL);var ML=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(dn);const TL=xr(ML);var IL=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(dn);const AL=xr(IL);var kL=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(dn);const PL=xr(kL);var RL=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(dn);const FL=xr(RL);var OL=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(dn);const LL=xr(OL);var NL=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(dn);const zL=xr(NL);var BL=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(dn);const VL=xr(BL);var UL=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(dn);const $L=xr(UL);var jL=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(dn);const HL=xr(jL);var GL=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(dn);const qL=xr(GL);var ZL=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(dn);const WL=xr(ZL);var XL=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(dn);const YL=xr(XL);var KL=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(dn);const JL=xr(KL);var QL=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(dn);const eN=xr(QL);var tN=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(dn);const nN=xr(tN);var rN=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(dn);const iN=xr(rN);var oN=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(dn);const sN=xr(oN);var aN=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(dn);const lN=xr(aN);var cN=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(dn);const uN=xr(cN);function hN(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-2710.57*e)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-67.37*e)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-2475.67*e)))))))+")"}var HD=1.78277,GD=-.29227,qb=-.90649,a_=1.97294,fN=a_*qb,pN=a_*HD,mN=HD*GD- -.14861*qb;function _J(e){if(e instanceof Cf)return new Cf(e.h,e.s,e.l,e.opacity);e instanceof eo||(e=RE(e));var n=e.g/255,r=e.b/255,i=(mN*r+fN*(e.r/255)-pN*n)/(mN+fN-pN),a=r-i,c=(a_*(n-i)-GD*a)/qb,d=Math.sqrt(c*c+a*a)/(a_*i*(1-i)),p=d?Math.atan2(c,a)*lO-120:NaN;return new Cf(p<0?p+360:p,d,i,e.opacity)}function Ec(e,t,n,r){return 1===arguments.length?_J(e):new Cf(e,t,n,r??1)}function Cf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function gN(e){return function t(n){function r(i,a){var c=e((i=Ec(i)).h,(a=Ec(a)).h),d=to(i.s,a.s),p=to(i.l,a.l),v=to(i.opacity,a.opacity);return function(E){return i.h=c(E),i.s=d(E),i.l=p(Math.pow(E,n)),i.opacity=v(E),i+""}}return n=+n,r.gamma=t,r}(1)}im(Cf,Ec,Ly(Rh,{brighter(e){return e=null==e?om:Math.pow(om,e),new Cf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Cf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*aO,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new eo(255*(t+n*(-.14861*r+HD*i)),255*(t+n*(GD*r+qb*i)),255*(t+n*(a_*r)),this.opacity)}})),gN(LE);var qD=gN(to);const yN=qD(Ec(300,.5,0),Ec(-240,.5,1));var _N=qD(Ec(-100,.75,.35),Ec(80,1.5,.8)),vN=qD(Ec(260,.75,.35),Ec(80,1.5,.8)),Zb=Ec();function bN(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Zb.h=360*e-100,Zb.s=1.5-1.5*t,Zb.l=.8-.9*t,Zb+""}var Wb=Oh(),vJ=Math.PI/3,bJ=2*Math.PI/3;function xN(e){var t;return e=(.5-e)*Math.PI,Wb.r=255*(t=Math.sin(e))*t,Wb.g=255*(t=Math.sin(e+vJ))*t,Wb.b=255*(t=Math.sin(e+bJ))*t,Wb+""}function wN(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}function Xb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const CN=Xb(dn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var EN=Xb(dn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),DN=Xb(dn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),SN=Xb(dn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ZD(e){return"string"==typeof e?new Ys([[document.querySelector(e)]],[document.documentElement]):new Ys([[e]],pR)}function Cm(e){return function(){return e}}function MN(e){this._context=e}function Yb(e){return new MN(e)}function CJ(e){return e[0]}function EJ(e){return e[1]}MN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},Math,Math;const TN=Math.cos,WD=(Math,Math.min),Kb=Math.sin,zi=Math.sqrt,Em=Math.PI,Jb=2*Em,SJ=zi(3),kN={draw(e,t){const n=.59436*zi(t+WD(t/28,.75)),r=n/2,i=r*SJ;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},l_={draw(e,t){const n=zi(t/Em);e.moveTo(n,0),e.arc(0,0,n,0,Jb)}},PN={draw(e,t){const n=zi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},RN=zi(1/3),MJ=2*RN,FN={draw(e,t){const n=zi(t/MJ),r=n*RN;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ON={draw(e,t){const n=.62625*zi(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},LN={draw(e,t){const n=.87559*zi(t-WD(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},NN={draw(e,t){const n=zi(t),r=-n/2;e.rect(r,r,n,n)}},zN={draw(e,t){const n=.4431*zi(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},BN=Kb(Em/10)/Kb(7*Em/10),IJ=Kb(Jb/10)*BN,AJ=-TN(Jb/10)*BN,VN={draw(e,t){const n=zi(.8908130915292852*t),r=IJ*n,i=AJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const c=Jb*a/5,d=TN(c),p=Kb(c);e.lineTo(p*n,-d*n),e.lineTo(d*r-p*i,p*r+d*i)}e.closePath()}},XD=zi(3),UN={draw(e,t){const n=-zi(t/(3*XD));e.moveTo(0,2*n),e.lineTo(-XD*n,-n),e.lineTo(XD*n,-n),e.closePath()}},kJ=zi(3),$N={draw(e,t){const n=.6824*zi(t),r=n/2,i=n*kJ/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},Aa=-.5,ka=zi(3)/2,YD=1/zi(12),PJ=3*(YD/2+1),jN={draw(e,t){const n=zi(t/PJ),r=n/2,i=n*YD,a=r,c=n*YD+n,d=-a,p=c;e.moveTo(r,i),e.lineTo(a,c),e.lineTo(d,p),e.lineTo(Aa*r-ka*i,ka*r+Aa*i),e.lineTo(Aa*a-ka*c,ka*a+Aa*c),e.lineTo(Aa*d-ka*p,ka*d+Aa*p),e.lineTo(Aa*r+ka*i,Aa*i-ka*r),e.lineTo(Aa*a+ka*c,Aa*c-ka*a),e.lineTo(Aa*d+ka*p,Aa*p-ka*d),e.closePath()}},HN={draw(e,t){const n=.6189*zi(t-WD(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},RJ=[l_,PN,FN,NN,VN,UN,jN],FJ=[l_,LN,HN,$N,kN,zN,ON];function Bh(){}function Qb(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ex(e){this._context=e}function GN(e){this._context=e}function qN(e){this._context=e}ex.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Qb(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Qb(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},GN.prototype={areaStart:Bh,areaEnd:Bh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Qb(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},qN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Qb(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class ZN{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function WN(e,t){this._basis=new ex(e),this._beta=t}WN.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var p,r=e[0],i=t[0],a=e[n]-r,c=t[n]-i,d=-1;++d<=n;)this._basis.point(this._beta*e[d]+(1-this._beta)*(r+(p=d/n)*a),this._beta*t[d]+(1-this._beta)*(i+p*c));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const UJ=function e(t){function n(r){return 1===t?new ex(r):new WN(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function tx(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function KD(e,t){this._context=e,this._k=(1-t)/6}KD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:tx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:tx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $J=function e(t){function n(r){return new KD(r,t)}return n.tension=function(r){return e(+r)},n}(0);function JD(e,t){this._context=e,this._k=(1-t)/6}JD.prototype={areaStart:Bh,areaEnd:Bh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:tx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jJ=function e(t){function n(r){return new JD(r,t)}return n.tension=function(r){return e(+r)},n}(0);function QD(e,t){this._context=e,this._k=(1-t)/6}QD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:tx(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const HJ=function e(t){function n(r){return new QD(r,t)}return n.tension=function(r){return e(+r)},n}(0);function eS(e,t,n){var r=e._x1,i=e._y1,a=e._x2,c=e._y2;if(e._l01_a>1e-12){var d=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,p=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*d-e._x0*e._l12_2a+e._x2*e._l01_2a)/p,i=(i*d-e._y0*e._l12_2a+e._y2*e._l01_2a)/p}if(e._l23_a>1e-12){var v=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,E=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*v+e._x1*e._l23_2a-t*e._l12_2a)/E,c=(c*v+e._y1*e._l23_2a-n*e._l12_2a)/E}e._context.bezierCurveTo(r,i,a,c,e._x2,e._y2)}function XN(e,t){this._context=e,this._alpha=t}XN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:eS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const GJ=function e(t){function n(r){return t?new XN(r,t):new KD(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function YN(e,t){this._context=e,this._alpha=t}YN.prototype={areaStart:Bh,areaEnd:Bh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qJ=function e(t){function n(r){return t?new YN(r,t):new JD(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function KN(e,t){this._context=e,this._alpha=t}KN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eS(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ZJ=function e(t){function n(r){return t?new KN(r,t):new QD(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function JN(e){this._context=e}function QN(e){return e<0?-1:1}function e3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),c=(n-e._y1)/(i||r<0&&-0),d=(a*i+c*r)/(r+i);return(QN(a)+QN(c))*Math.min(Math.abs(a),Math.abs(c),.5*Math.abs(d))||0}function t3(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tS(e,t,n){var r=e._x0,a=e._x1,c=e._y1,d=(a-r)/3;e._context.bezierCurveTo(r+d,e._y0+d*t,a-d,c-d*n,a,c)}function nx(e){this._context=e}function n3(e){this._context=new r3(e)}function r3(e){this._context=e}function i3(e){this._context=e}function o3(e){var t,r,n=e.length-1,i=new Array(n),a=new Array(n),c=new Array(n);for(i[0]=0,a[0]=2,c[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(c[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t0&&isFinite(e)?e:NaN}function rS(e){return e<0&&isFinite(e)?e:NaN}JN.prototype={areaStart:Bh,areaEnd:Bh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},nx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:tS(this,this._t0,t3(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,tS(this,t3(this,n=e3(this,e,t)),n);break;default:tS(this,this._t0,n=e3(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(n3.prototype=Object.create(nx.prototype)).point=function(e,t){nx.prototype.point.call(this,t,e)},r3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}},i3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=o3(e),i=o3(t),a=0,c=1;c=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}},Dm.prototype={constructor:Dm,scale:function(e){return 1===e?this:new Dm(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Dm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Dm(1,0,0);const lQ=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function c3(e,t){return lQ.test(e+="")?new Date(e):"function"==typeof t?t(e):t}const cQ=new Map([["second",wu],["minute",zb],["hour",Vb],["day",ym],["week",_m],["month",bm],["quarter",bm.every(3)],["half",bm.every(6)],["year",wc],["monday",t_],["tuesday",UO],["wednesday",$O],["thursday",bf],["friday",jO],["saturday",HO],["sunday",_m]]),uQ=new Map([["second",wu],["minute",Bb],["hour",Ub],["day",e_],["week",vm],["month",xm],["quarter",xm.every(3)],["half",xm.every(6)],["year",Cc],["monday",n_],["tuesday",GO],["wednesday",qO],["thursday",wf],["friday",ZO],["saturday",WO],["sunday",vm]]);function hQ(e){const t=cQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}function dQ(e){const t=uQ.get(`${e}`.toLowerCase());if(!t)throw new Error(`unknown interval: ${e}`);return t}const c_=Object.getPrototypeOf(Uint8Array),fQ=Object.prototype.toString;function Dc(e,t,n){const r=typeof t;return"string"===r?u3(e,mQ(t),n):"function"===r?u3(e,t,n):"number"===r||t instanceof Date||"boolean"===r?Go(e,Mm(t),n):function h3(e,t){return void 0===t?Sc(e):e instanceof t?e:t.prototype instanceof c_&&!(e instanceof c_)?t.from(e,oS):t.from(e)}("function"==typeof t?.transform?t.transform(e):t,n)}function u3(e,t,n){return Go(e,n?.prototype instanceof c_?function pQ(e){return(t,n)=>oS(e(t,n))}(t):t,n)}const mQ=e=>t=>t[e],gQ=(e,t)=>t,Cu={transform:e=>e},yQ=()=>!0,Sl=e=>null==e?e:`${e}`,So=e=>null==e?e:+e,d3=e=>e?e[0]:void 0,iS=e=>e?e[1]:void 0,Mm=e=>()=>e;function f3(e){const t=+`${e}`.slice(1)/100;return(n,r)=>N0(n,t,r)}function ox(e){return e instanceof c_?e:Go(e,oS,Float64Array)}function oS(e){return null==e?NaN:Number(e)}function _Q(e){return Go(e,vQ)}function vQ(e){return e instanceof Date&&!isNaN(e)?e:"string"==typeof e?c3(e):null==e||isNaN(e=+e)?void 0:new Date(e)}function Tm(e,t){return void 0===e&&(e=t),null===e?[void 0,"none"]:ax(e)?[void 0,e]:[e,void 0]}function As(e,t){return void 0===e&&(e=t),null===e||"number"==typeof e?[void 0,e]:[e,void 0]}function p3(e,t,n){if(null!=e)return Eu(e,t,n)}function Eu(e,t,n){const r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Sc(e){return null==e||e instanceof Array||e instanceof c_?e:Array.from(e)}function Go(e,t,n=Array){return null==e?e:e instanceof n?e.map(t):n.from(e,t)}function sS(e,t=Array){return e instanceof t?e.slice():t.from(e)}function Im(e){return e?.toString===fQ}function aS(e){return Im(e)&&(void 0!==e.type||void 0!==e.domain)}function sx(e){return Im(e)&&"function"!=typeof e.transform}function Am(e){return sx(e)&&void 0===e.value&&void 0===e.channel}function lS(e,t){return void 0===e&&void 0===t?[d3,iS]:[e,t]}function m3({z:e,fill:t,stroke:n}={}){return void 0===e&&([e]=Tm(t)),void 0===e&&([e]=Tm(n)),e}function u_(e){const t=e.length,n=new Uint32Array(t);for(let r=0;re[n])}function cS(e){return null!==e&&"object"==typeof e?e.valueOf():e}function h_(e,t){return"string"==typeof e?e:e&&void 0!==e.label?e.label:t}function uS(e,t){if(null!=e){if("number"==typeof e){const n=e;return{floor:r=>n*Math.floor(r/n),offset:r=>r+n,range:(r,i)=>tR(Math.ceil(r/n),i/n).map(a=>n*a)}}if("string"==typeof e)return("time"===t?hQ:dQ)(e);if("function"!=typeof e.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof e.offset)throw new Error("invalid interval; missing offset method");return e}}function d_(e,t){if((e=uS(e,t))&&"function"!=typeof e.range)throw new Error("invalid interval: missing range method");return e}function hS(e){return void 0===e||sx(e)?e:{value:e}}function Vh(e){return e&&"function"==typeof e[Symbol.iterator]}function CQ(e){for(const t of e)if(null!=t)return"object"!=typeof t||t instanceof Date}function y3(e){for(const t of e){if(null==t)continue;const n=typeof t;return"string"===n||"boolean"===n}}function Ml(e){for(const t of e)if(null!=t)return t instanceof Date}function EQ(e){for(const t of e)if(null!=t)return"string"==typeof t&&isNaN(t)&&c3(t)}function DQ(e){for(const t of e)if(null!=t){if("string"!=typeof t)return!1;if(t.trim())return!isNaN(t)}}function dS(e,t){let n;for(const r of e)if(null!=r){if(!t(r))return!1;n=!0}return n}function ax(e){return"string"==typeof e&&("none"===(e=e.toLowerCase().trim())||"currentcolor"===e||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||null!==Fh(e))}function MQ(e){return"number"==typeof e&&(0<=e&&e<=1||isNaN(e))}function Js(e){return null==e||f_(e)}function f_(e){return/^\s*none\s*$/i.test(e)}function fS(e="middle"){return Eu(e,"frameAnchor",["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function p_(e){if(null!=e)return Sy(e[0],e[e.length-1])}function _3(e){return Vh(e)?function AQ(e){console.warn("named iterables are deprecated; please use an object instead");const t=new Set;return Object.fromEntries(Array.from(e,n=>{const{name:r}=n;if(null==r)throw new Error("missing name");const i=`${r}`;if("__proto__"===i)throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}(e):e}const Mc=Symbol("position"),Tc=Symbol("color"),lx=Symbol("radius"),cx=Symbol("length"),ux=Symbol("opacity"),hx=Symbol("symbol"),ii=new Map([["x",Mc],["y",Mc],["fx",Mc],["fy",Mc],["r",lx],["color",Tc],["opacity",ux],["symbol",hx],["length",cx]]),PQ=2/Math.sqrt(3),pS=new Map([["asterisk",kN],["circle",l_],["cross",PN],["diamond",FN],["diamond2",ON],["hexagon",{draw(e,t){const n=Math.sqrt(t/Math.PI),r=n*PQ,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}}],["plus",LN],["square",NN],["square2",zN],["star",VN],["times",HN],["triangle",UN],["triangle2",$N],["wye",jN]]);function mS(e){return e&&"function"==typeof e.draw}function FQ(e){return!!mS(e)||"string"==typeof e&&pS.has(e.toLowerCase())}function gS(e){if(null==e||mS(e))return e;const t=pS.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function _S(e,t,n=zQ){if(null==e)return n(e);if("function"==typeof e.reduceIndex)return e;if("function"==typeof e.reduce&&Im(e))return function UQ(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}(e);if("function"==typeof e)return function $Q(e){return{reduceIndex:(t,n,r)=>e(km(n,t),r)}}(e);if(/^p\d{2}$/i.test(e))return Du(f3(e));switch(`${e}`.toLowerCase()){case"first":return E3;case"last":return HQ;case"identity":return C3;case"count":return vS;case"distinct":return GQ;case"sum":return null==t?vS:qQ;case"proportion":return D3(t,"data");case"proportion-facet":return D3(t,"facet");case"deviation":return Du(GP);case"min":return Du(uf);case"min-index":return Du(BG);case"max":return Du(Xs);case"max-index":return Du(FG);case"mean":return w3(OG);case"median":return w3(z0);case"variance":return Du(fE);case"mode":return Du(eR)}return n(e)}function zQ(e){throw new Error(`invalid reduce: ${e}`)}function Du(e){return{reduceIndex:(t,n)=>e(t,r=>n[r])}}function w3(e){return{reduceIndex(t,n){const r=e(t,i=>n[i]);return Ml(n)?new Date(r):r}}}const C3={reduceIndex:(e,t)=>km(t,e)},E3={reduceIndex:(e,t)=>t[e[0]]},HQ={reduceIndex:(e,t)=>t[e[e.length-1]]},vS={label:"Frequency",reduceIndex:e=>e.length},GQ={label:"Distinct",reduceIndex(e,t){const n=new pE;for(const r of e)n.add(t[r]);return n.size}},qQ=Du(B0);function D3(e,t){return null==e?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>B0(n,a=>r[a])/i}}function m_(e,{scale:t,type:n,value:r,filter:i,hint:a},c){return S3(c,{scale:t,type:n,value:Dc(e,r),label:h_(r),filter:i,hint:a})}function S3(e,t){const{scale:n,value:r}=t;if(!0===n||"auto"===n)switch(e){case"fill":case"stroke":case"color":t.scale=!0!==n&&dS(r,ax)?null:"color";break;case"fillOpacity":case"strokeOpacity":t.scale=!0!==n&&dS(r,MQ)?null:"opacity";break;case"symbol":!0!==n&&dS(r,FQ)?(t.scale=null,t.value=Go(r,gS)):t.scale="symbol";break;default:t.scale=ii.has(e)?e:null}else if(!1===n)t.scale=null;else if(null!=n&&!ii.has(n))throw new Error(`unknown scale: ${n}`);return t}function YQ(e,t){for(const n in e){const r=e[n];if(r.scale===t)return r}}function KQ(e,t){const n=e.original;if(n===e)return t;const r=t.value,i=t.value=[];for(let a=0;aMath.abs(a-r[c]),Float64Array)}function bS(e,t,n){let r=e[t];if(!r&&void 0!==n&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function JQ([e,t],[n,r]){return Sm(t,r)||Sm(e,n)}function QQ([e,t],[n,r]){return a3(t,r)||Sm(e,n)}let xS=0;function Ef(e){console.warn(e),++xS}const T3=Math.PI,Su=2*T3;function tee({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:a=t}={},c){if(null==e)return;if("function"==typeof e.stream)return e;let d,p,v="frame";if(Im(e)){let fe;if(({type:e,domain:p,inset:fe,insetTop:n=(void 0!==fe?fe:n),insetRight:r=(void 0!==fe?fe:r),insetBottom:i=(void 0!==fe?fe:i),insetLeft:a=(void 0!==fe?fe:a),clip:v=v,...d}=e),null==e)return}"function"!=typeof e&&({type:e}=I3(e));const{width:E,height:D,marginLeft:T,marginRight:P,marginTop:N,marginBottom:G}=c,U=E-T-P-a-r,Z=D-N-G-n-i;if(e=e?.({width:U,height:Z,clip:v,...d}),null==e)return;v=function nee(e,t,n,r,i){if(!1===e||null==e||"number"==typeof e)return a=>a;if("frame"===(!0===e&&(e="frame"),`${e}`.toLowerCase()))return hF(t,n,r,i);throw new Error(`unknown projection clip type: ${e}`)}(v,T,N,E-P,D-G);let re,ne=T+a,X=N+n;if(null!=p){const[[fe,ve],[Re,We]]=iD(e).bounds(p),Ke=Math.min(U/(Re-fe),Z/(We-ve));Ke>0?(ne-=(Ke*(fe+Re)-U)/2,X-=(Ke*(ve+We)-Z)/2,re=hD({point(lt,Ue){this.stream.point(lt*Ke+ne,Ue*Ke+X)}})):Ef("Warning: the projection could not be fit to the specified domain; using the default scale.")}return re??(re=0===ne&&0===X?A3():hD({point(fe,ve){this.stream.point(fe+ne,ve+X)}})),{stream:fe=>e.stream(re.stream(v(fe)))}}function I3(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Tl(iY,.7463,.4673);case"albers":return fx(YF,.7463,.4673);case"azimuthal-equal-area":return Tl(oY,4,4);case"azimuthal-equidistant":return Tl(sY,Su,Su);case"conic-conformal":return fx(cY,Su,Su);case"conic-equal-area":return fx(Mb,6.1702,2.9781);case"conic-equidistant":return fx(dY,7.312,3.6282);case"equal-earth":return Tl(pY,5.4133,2.6347);case"equirectangular":return Tl(uY,Su,T3);case"gnomonic":return Tl(mY,3.4641,3.4641);case"identity":return{type:A3};case"reflect-y":return{type:ree};case"mercator":return Tl(aY,Su,Su);case"orthographic":return Tl(gY,2,2);case"stereographic":return Tl(yY,2,2);case"transverse-mercator":return Tl(_Y,Su,Su);default:throw new Error(`unknown projection type: ${e}`)}}function Tl(e,t,n){return{type:({width:r,height:i,rotate:a,precision:c=.15,clip:d})=>{const p=e();return null!=c&&p.precision?.(c),null!=a&&p.rotate?.(a),"number"==typeof d&&p.clipAngle?.(d),p.scale(Math.min(r/t,i/n)),p.translate([r/2,i/2]),p},aspectRatio:n/t}}function fx(e,t,n){const{type:r,aspectRatio:i}=Tl(e,t,n);return{type:a=>{const{parallels:c,domain:d,width:p,height:v}=a,E=r(a);return null!=c&&(E.parallels(c),void 0===d&&E.fitSize([p,v],{type:"Sphere"})),E},aspectRatio:i}}const A3=Mm({stream:e=>e}),ree=Mm(hD({point(e,t){this.stream.point(e,-t)}}));function px(e,t,n,r,i){const a=n[e]&&"x"===n[e].scale,c=n[t]&&"y"===n[t].scale;if(a&&c)!function iee(e,t,n,r){const i=n[e],a=n[t],c=i.length,d=n[e]=new Float64Array(c).fill(NaN),p=n[t]=new Float64Array(c).fill(NaN);let v;const E=r.stream({point(D,T){d[v]=D,p[v]=T}});for(v=0;v1===n?[e[3][1]]:2===n?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)))>9?El(t,n):e[n]}function Mu(e,t){return({length:n})=>2===n?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)))>11?El(t,n):e[n]}function P3(e,t){return({length:n})=>2===n?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)))>11?El(r=>t(1-r),n):e[n].slice().reverse()}function Tu(e){return({length:t})=>El(e,Math.max(2,Math.floor(t)))}function R3(e){return({length:t})=>El(e,Math.floor(t)+1).slice(0,-1)}function F3(e){const t=`${e}`.toLowerCase();if(!k3.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return k3.get(t)}function mx(e,t){const n=F3(e),r="function"==typeof n?n({length:t}):n;return r.length!==t?r.slice(0,t):r}const O3=new Map([["brbg",gL],["prgn",_L],["piyg",bL],["puor",wL],["rdbu",Hb],["rdgy",EL],["rdylbu",Gb],["rdylgn",SL],["spectral",TL],["burd",e=>Hb(1-e)],["buylrd",e=>Gb(1-e)],["blues",eN],["greens",nN],["greys",iN],["purples",sN],["reds",lN],["oranges",uN],["turbo",wN],["viridis",CN],["magma",EN],["inferno",DN],["plasma",SN],["cividis",hN],["cubehelix",yN],["warm",_N],["cool",vN],["bugn",AL],["bupu",PL],["gnbu",FL],["orrd",LL],["pubugn",zL],["pubu",VL],["purd",$L],["rdpu",HL],["ylgnbu",qL],["ylgn",WL],["ylorbr",YL],["ylorrd",JL],["rainbow",bN],["sinebow",xN]]);function ES(e){const t=`${e}`.toLowerCase();if(!O3.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return O3.get(t)}const lee=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function L3(e){return null!=e&&lee.has(`${e}`.toLowerCase())}const N3=e=>t=>e(1-t),DS=[0,1],z3=new Map([["number",$o],["rgb",mf],["hsl",vY],["hcl",wY],["lab",function xY(e,t){var n=to((e=yD(e)).l,(t=yD(t)).l),r=to(e.a,t.a),i=to(e.b,t.b),a=to(e.opacity,t.opacity);return function(c){return e.l=n(c),e.a=r(c),e.b=i(c),e.opacity=a(c),e+""}}]]);function B3(e){const t=`${e}`.toLowerCase();if(!z3.has(t))throw new Error(`unknown interpolator: ${t}`);return z3.get(t)}function g_(e,t,n,{type:r,nice:i,clamp:a,zero:c,domain:d=U3(e,n),unknown:p,round:v,scheme:E,interval:D,range:T=(ii.get(e)===lx?vee(n,d):ii.get(e)===cx?bee(n,d):ii.get(e)===ux?DS:void 0),interpolate:P=(ii.get(e)===Tc?null==E&&void 0!==T?mf:ES(void 0!==E?E:"cyclical"===r?"rainbow":"turbo"):v?gD:$o),reverse:N}){if(D=d_(D,r),("cyclical"===r||"sequential"===r)&&(r="linear"),N=!!N,"function"!=typeof P&&(P=B3(P)),1===P.length?(N&&(P=N3(P),N=!1),void 0===T&&2===(T=Float64Array.from(d,(G,U)=>U/(d.length-1))).length&&(T=DS),t.interpolate((T===DS?Mm:MS)(P))):t.interpolate(P),c){const[G,U]=Qp(d);(G>0||U<0)&&(p_(d=sS(d))!==Math.sign(G)?d[d.length-1]=0:d[0]=0)}return N&&(d=$0(d)),t.domain(d).unknown(p),i&&(t.nice(function cee(e,t){return!0===e?void 0:"number"==typeof e?e:function xQ(e,t){if((e=d_(e,t))&&"function"!=typeof e.ceil)throw new Error("invalid interval: missing ceil method");return e}(e,t)}(i,r)),d=t.domain()),void 0!==T&&t.range(T),a&&t.clamp(a),{type:r,domain:d,range:T,scale:t,interpolate:P,interval:D}}function V3(e,t,{exponent:n=1,...r}){return g_(e,RD().exponent(n),t,{...r,type:"pow"})}function dee(e,t,{base:n=10,domain:r=xee(t),...i}){return g_(e,AO().base(n),t,{...i,domain:r})}function fee(e,t,{constant:n=1,...r}){return g_(e,FO().constant(n),t,r)}function pee(e,t,{range:n,quantiles:r=(void 0===n?5:(n=[...n]).length),n:i=r,scheme:a="rdylbu",domain:c=wee(t),unknown:d,interpolate:p,reverse:v}){return void 0===n&&(n=void 0!==p?El(p,i):ii.get(e)===Tc?mx(a,i):void 0),c.length>0&&(c=NO(c,void 0===n?{length:i}:n).quantiles()),SS(e,0,{domain:c,range:n,reverse:v,unknown:d})}function SS(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:a,range:c=(void 0!==a?El(a,n.length+1):ii.get(e)===Tc?mx(i,n.length+1):void 0),reverse:d}){const p=p_(n=Sc(n));if(!isNaN(p)&&!function gee(e,t){for(let n=1,r=e.length,i=e[0];nvoid 0===n?n:uf(n,t)),Xs(e,({value:n})=>void 0===n?n:Xs(n,t))]:[0,1]}function U3(e,t){const n=ii.get(e);return(n===lx||n===ux||n===cx?_ee:y_)(t)}function _ee(e){return[0,e.length?Xs(e,({value:t})=>void 0===t?t:Xs(t,l3)):1]}function vee(e,t){const n=e.find(({radius:c})=>void 0!==c);if(void 0!==n)return[0,n.radius];const r=N0(e,.5,({value:c})=>void 0===c?NaN:N0(c,.25,ix)),i=t.map(c=>3*Math.sqrt(c/r)),a=30/Xs(i);return a<1?i.map(c=>c*a):i}function bee(e,t){const n=z0(e,({value:a})=>void 0===a?NaN:z0(a,Math.abs)),r=t.map(a=>12*a/n),i=60/Xs(r);return i<1?r.map(a=>a*i):r}function xee(e){for(const{value:t}of e)if(void 0!==t)for(let n of t){if(n>0)return y_(e,ix);if(n<0)return y_(e,rS)}return[1,10]}function wee(e){const t=[];for(const{value:n}of e)if(void 0!==n)for(const r of n)t.push(r);return t}function MS(e){return(t,n)=>r=>e(t+r*(n-t))}function gx(e,t,n,r,{type:i,nice:a,clamp:c,domain:d=y_(r),unknown:p,pivot:v=0,scheme:E,range:D,symmetric:T=!0,interpolate:P=(ii.get(e)===Tc?null==E&&void 0!==D?mf:ES(void 0!==E?E:"rdbu"):$o),reverse:N}){v=+v;let[G,U]=d;if(Sy(G,U)<0&&([G,U]=[U,G],N=!N),G=Math.min(G,v),U=Math.max(U,v),"function"!=typeof P&&(P=B3(P)),void 0!==D&&(P=1===P.length?MS(P)(...D):CD(P,D)),N&&(P=N3(P)),T){const Z=n.apply(v),ne=Z-n.apply(G),X=n.apply(U)-Z;neX&&(U=n.invert(Z+ne))}return t.domain([G,v,U]).unknown(p).interpolator(P),c&&t.clamp(c),a&&t.nice(a),{type:i,domain:[G,U],pivot:v,interpolate:P,scale:t}}function Cee(e,t,n){return gx(e,dL(),Mee,t,n)}function $3(e,t,{exponent:n=1,...r}){return gx(e,UD().exponent(n=+n),function Aee(e){return.5===e?Iee:{apply:t=>Math.sign(t)*Math.pow(Math.abs(t),e),invert:t=>Math.sign(t)*Math.pow(Math.abs(t),1/e)}}(n),t,{...r,type:"diverging-pow"})}function Dee(e,t,{base:n=10,pivot:r=1,domain:i=y_(t,r<0?rS:ix),...a}){return gx(e,fL().base(n=+n),Tee,t,{domain:i,pivot:r,...a})}function See(e,t,{constant:n=1,...r}){return gx(e,pL().constant(n=+n),function kee(e){return{apply:t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),invert:t=>Math.sign(t)*Math.expm1(Math.abs(t))*e}}(n),t,r)}const Mee={apply:e=>e,invert:e=>e},Tee={apply:Math.log,invert:Math.exp},Iee={apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*(e*e)};function j3(e,t,n,r){return g_(e,t,n,r)}const __=Symbol("ordinal");function H3(e,t,n,{type:r,interval:i,domain:a,range:c,reverse:d,hint:p}){return i=d_(i,r),void 0===a&&(a=q3(n,i,e)),("categorical"===r||r===__)&&(r="ordinal"),d&&(a=$0(a)),t.domain(a),void 0!==c&&("function"==typeof c&&(c=c(a)),t.range(c)),{type:r,domain:a,range:c,scale:t,hint:p,interval:i}}function G3(e,t,n,r){let{round:i}=n;return void 0!==i&&e.round(i=!!i),(e=H3(r,e,t,n)).round=i,e}function q3(e,t,n){const r=new pE;for(const{value:i,domain:a}of e){if(void 0!==a)return a();if(void 0!==i)for(const c of i)r.add(c)}if(void 0!==t){const[i,a]=Qp(r).map(t.floor,t);return t.range(i,t.offset(a))}if(r.size>1e4&&ii.get(n)===Mc)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return yE(r,Sm)}function Z3(e,t){let n;for(const{hint:r}of e){const i=r?.[t];if(void 0!==i)if(void 0===n)n=i;else if(n!==i)return}return n}function TS(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:a=n,insetLeft:c=n,round:d,nice:p,clamp:v,zero:E,align:D,padding:T,projection:P,facet:{label:N=t}={},...G}={}){const U={};for(const[Z,ne]of e){const X=G[Z],re=e5(Z,ne,{round:ii.get(Z)===Mc?d:void 0,nice:p,clamp:v,zero:E,align:D,padding:T,projection:P,...X});if(re){let{label:fe=("fx"===Z||"fy"===Z?N:t),percent:ve,transform:Re,inset:We,insetTop:Ke=(void 0!==We?We:"y"===Z?r:0),insetRight:lt=(void 0!==We?We:"x"===Z?i:0),insetBottom:Ue=(void 0!==We?We:"y"===Z?a:0),insetLeft:st=(void 0!==We?We:"x"===Z?c:0)}=X||{};if(null==Re)Re=void 0;else if("function"!=typeof Re)throw new Error("invalid scale transform; not a function");re.percent=!!ve,re.label=void 0===fe?Vee(ne,re):fe,re.transform=Re,"x"===Z||"fx"===Z?(re.insetLeft=+st,re.insetRight=+lt):("y"===Z||"fy"===Z)&&(re.insetTop=+Ke,re.insetBottom=+Ue),U[Z]=re}}return U}function W3(e){return Object.fromEntries(Object.entries(e).filter(([,{scale:t}])=>t).map(([t,{scale:n,type:r,interval:i,label:a}])=>(n.type=r,null!=i&&(n.interval=i),null!=a&&(n.label=a),[t,n])))}function Vee(e=[],t){let n;for(const{label:r}of e)if(void 0!==r)if(void 0===n)n=r;else if(n!==r)return;if(!(void 0===n||n5(t)&&/^(date|time|year)$/i.test(n)))return!Df(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function IS(e){const{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:a,height:c,facet:{marginTop:d,marginRight:p,marginBottom:v,marginLeft:E}}=e;return{marginTop:Math.max(t,d),marginRight:Math.max(n,p),marginBottom:Math.max(r,v),marginLeft:Math.max(i,E),width:a,height:c}}function X3({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:a,marginLeft:c,width:d,height:p}=IS(n);return{marginTop:r,marginRight:i,marginBottom:a,marginLeft:c,width:e?e.scale.bandwidth()+c+i:d,height:t?t.scale.bandwidth()+r+a:p}}function Y3(e,t){if(void 0===e.range){const{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:a=0,marginRight:c=0}=t,d=a+n;e.range=[d,Math.max(d,i-c-r)],Df(e)||(e.range=Q3(e)),e.scale.range(e.range)}J3(e)}function K3(e,t){if(void 0===e.range){const{insetTop:n,insetBottom:r}=e,{height:i,marginTop:a=0,marginBottom:c=0}=t,d=a+n;e.range=[Math.max(d,i-c-r),d],Df(e)?e.range.reverse():e.range=Q3(e),e.scale.range(e.range)}J3(e)}function J3(e){void 0===e.round&&function Hee({type:e}){return"point"===e||"band"===e}(e)&&function Uee({scale:e}){const t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,a=e.paddingOuter?e.paddingOuter():e.padding(),c=t-i,d=Math.abs(r-n)/Math.max(1,c+2*a);return(d-Math.floor(d))*c}(e)<=30&&e.scale.round(!0)}function Q3(e){const t=e.scale.domain().length+r5(e);if(!(t>2))return e.range;const[n,r]=e.range;return Array.from({length:t},(i,a)=>n+a/(t-1)*(r-n))}function e5(e,t=[],n={}){const r=function jee(e,t,{type:n,domain:r,range:i,scheme:a,pivot:c,projection:d}){if("fx"===e||"fy"===e)return"band";("x"===e||"y"===e)&&null!=d&&(n=t5);for(const{type:E}of t)if(void 0!==E)if(void 0===n)n=E;else if(n!==E)throw new Error(`scale incompatible with channel: ${n} !== ${E}`);if(n===t5)return;if(void 0!==n)return n;if(void 0===r&&!t.some(({value:E})=>void 0!==E))return;const p=ii.get(e);if(p===lx)return"sqrt";if(p===ux||p===cx)return"linear";if(p===hx)return"ordinal";if((r||i||[]).length>2)return AS(p);if(void 0!==r)return y3(r)?AS(p):Ml(r)?"utc":p!==Tc||null==c&&!L3(a)?"linear":"diverging";const v=t.map(({value:E})=>E).filter(E=>void 0!==E);return v.some(y3)?AS(p):v.some(Ml)?"utc":p!==Tc||null==c&&!L3(a)?"linear":"diverging"}(e,t,n);if(void 0===n.type&&void 0===n.domain&&void 0===n.range&&null==n.interval&&"fx"!==e&&"fy"!==e&&Df({type:r})){const i=t.map(({value:a})=>a).filter(a=>void 0!==a);i.some(Ml)?Ef(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Pm(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${Pm(r)}".`):i.some(EQ)?Ef(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Pm(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${Pm(r)}".`):i.some(DQ)&&Ef(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Pm(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${Pm(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=_x(t,n,ox);break;case"identity":switch(ii.get(e)){case Mc:n=_x(t,n,ox);break;case hx:n=_x(t,n,Gee)}break;case"utc":case"time":n=_x(t,n,_Q)}switch(r){case"diverging":return Cee(e,t,n);case"diverging-sqrt":return function Eee(e,t,n){return $3(e,t,{...n,exponent:.5})}(e,t,n);case"diverging-pow":return $3(e,t,n);case"diverging-log":return Dee(e,t,n);case"diverging-symlog":return See(e,t,n);case"categorical":case"ordinal":case __:return function Fee(e,t,{type:n,interval:r,domain:i,range:a,scheme:c,unknown:d,...p}){let v;if(r=d_(r,n),void 0===i&&(i=q3(t,r,e)),ii.get(e)===hx)v=function Nee(e){return{fill:Z3(e,"fill"),stroke:Z3(e,"stroke")}}(t),a=void 0===a?function zee(e){return Js(e.fill)?FJ:RJ}(v):Go(a,gS);else if(ii.get(e)===Tc&&(void 0===a&&("ordinal"===n||n===__)&&(a=function aee(e,t="greys"){const n=new Set,[r,i]=mx(t,2);for(const a of e)if(null!=a)if(!0===a)n.add(i);else{if(!1!==a)return;n.add(r)}return[...n]}(i,c),void 0!==a&&(c=void 0)),void 0===c&&void 0===a&&(c="ordinal"===n?"turbo":"tableau10"),void 0!==c))if(void 0!==a){const E=ES(c),D=a[0],T=a[1]-a[0];a=({length:P})=>El(N=>E(D+T*N),P)}else a=F3(c);if(d===SD)throw new Error(`implicit unknown on ${e} scale is not supported`);return H3(e,MD().unknown(d),t,{...p,type:n,domain:i,range:a,hint:v})}(e,t,n);case"cyclical":case"sequential":case"linear":return function uee(e,t,n){return g_(e,PD(),t,n)}(e,t,n);case"sqrt":return function hee(e,t,n){return V3(e,t,{...n,exponent:.5})}(e,t,n);case"threshold":return SS(e,0,n);case"quantile":return pee(e,t,n);case"quantize":return function mee(e,t,{range:n,n:r=(void 0===n?5:(n=[...n]).length),scheme:i="rdylbu",domain:a=U3(e,t),unknown:c,interpolate:d,reverse:p}){const[v,E]=Qp(a);let D;return void 0===n?(D=U0(v,E,r),D[0]<=v&&D.splice(0,1),D[D.length-1]>=E&&D.pop(),r=D.length+1,n=void 0!==d?El(d,r):ii.get(e)===Tc?mx(i,r):void 0):(D=El($o(v,E),r+1).slice(1,-1),v instanceof Date&&(D=D.map(T=>new Date(T)))),p_(Sc(a))<0&&D.reverse(),SS(e,0,{domain:D,range:n,reverse:p,unknown:c})}(e,t,n);case"pow":return V3(e,t,n);case"log":return dee(e,t,n);case"symlog":return fee(e,t,n);case"utc":return function Ree(e,t,n){return j3(e,function iJ(){return xc.apply(VD(WY,XY,Cc,xm,vm,e_,Ub,Bb,wu,s_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"time":return function Pee(e,t,n){return j3(e,function rJ(){return xc.apply(VD(YY,KY,wc,bm,_m,ym,Vb,zb,wu,uL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}(),t,n)}(e,t,n);case"point":return function Oee(e,t,{align:n=.5,padding:r=.5,...i}){return G3(function AY(){return bO(Ob.apply(null,arguments).paddingInner(1))}().align(n).padding(r),t,i,e)}(e,t,n);case"band":return function Lee(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:a=("fx"===e||"fy"===e?0:r),...c}){return G3(Ob().align(n).paddingInner(i).paddingOuter(a),t,c,e)}(e,t,n);case"identity":return ii.get(e)===Mc?function yee(){return{type:"identity",scale:EO()}}():{type:"identity"};case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Pm(e){return"symbol"==typeof e?e.description:e}const t5={toString:()=>"projection"};function AS(e){switch(e){case Mc:return"point";case Tc:return __;default:return"ordinal"}}function n5({type:e}){return"time"===e||"utc"===e}function Df({type:e}){return"ordinal"===e||"point"===e||"band"===e||e===__}function r5({type:e}){return"threshold"===e}function yx(e){if(void 0===e)return!0;const t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r((n?.length!==r.length||n.some((i,a)=>i!==r[a]))&&(n=r,t=e(...r)),t)}const Xee=kS(e=>new Intl.NumberFormat(e));function o5(e){return function Zee(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),a=e.getUTCMilliseconds();return`${function Wee(e){return e<0?`-${Iu(-e,6)}`:e>9999?`+${Iu(e,6)}`:Iu(e,4)}(e.getUTCFullYear())}-${Iu(e.getUTCMonth()+1,2)}-${Iu(e.getUTCDate(),2)}${n||r||i||a?`T${Iu(n,2)}:${Iu(r,2)}${i||a?`:${Iu(i,2)}${a?`.${Iu(a,3)}`:""}`:""}Z`:""}`}(e,"Invalid Date")}kS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),kS((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));const vx=function Qee(e="en-US"){const t=function Jee(e="en-US"){const t=Xee(e);return n=>null==n||isNaN(n)?void 0:t.format(n)}(e);return n=>(n instanceof Date?o5:"number"==typeof n?t:Sl)(n)}(),Qs=typeof window<"u"&&window.devicePixelRatio>1?0:.5;let ete=0;function s5(){return"plot-clip-"+ ++ete}function tte(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:a,target:c,fill:d,fillOpacity:p,stroke:v,strokeWidth:E,strokeOpacity:D,strokeLinejoin:T,strokeLinecap:P,strokeMiterlimit:N,strokeDasharray:G,strokeDashoffset:U,opacity:Z,mixBlendMode:ne,paintOrder:X,pointerEvents:re,shapeRendering:fe},{ariaLabel:ve,fill:Re="currentColor",fillOpacity:We,stroke:Ke="none",strokeOpacity:lt,strokeWidth:Ue,strokeLinecap:st,strokeLinejoin:Fe,strokeMiterlimit:le,paintOrder:de}){null===Re&&(d=null,p=null),null===Ke&&(v=null,D=null),Js(Re)?!Js(Ke)&&!Js(d)&&(Ke="none"):Js(Ke)&&!Js(v)&&(Re="none");const[pe,Oe]=Tm(d,Re),[Ye,Ze]=As(p,We),[et,_t]=Tm(v,Ke),[Ft,sr]=As(D,lt),[Hn,gr]=As(Z);f_(_t)||(void 0===E&&(E=Ue),void 0===P&&(P=st),void 0===T&&(T=Fe),void 0===N&&!function TQ(e){return/^\s*round\s*$/i.test(e)}(T)&&(N=le),!f_(Oe)&&void 0===X&&(X=de));const[wi,Yn]=As(E);return null!==Re&&(e.fill=ea(Oe,"currentColor"),e.fillOpacity=b_(Ze,1)),null!==Ke&&(e.stroke=ea(_t,"none"),e.strokeWidth=b_(Yn,1),e.strokeOpacity=b_(sr,1),e.strokeLinejoin=ea(T,"miter"),e.strokeLinecap=ea(P,"butt"),e.strokeMiterlimit=b_(N,4),e.strokeDasharray=ea(G,"none"),e.strokeDashoffset=ea(U,"0")),e.target=Sl(c),e.ariaLabel=Sl(ve),e.ariaDescription=Sl(i),e.ariaHidden=Sl(a),e.opacity=b_(gr,1),e.mixBlendMode=ea(ne,"normal"),e.paintOrder=ea(X,"normal"),e.pointerEvents=ea(re,"auto"),e.shapeRendering=ea(fe,"auto"),{title:{value:t,optional:!0},href:{value:n,optional:!0},ariaLabel:{value:r,optional:!0},fill:{value:pe,scale:"auto",optional:!0},fillOpacity:{value:Ye,scale:"auto",optional:!0},stroke:{value:et,scale:"auto",optional:!0},strokeOpacity:{value:Ft,scale:"auto",optional:!0},strokeWidth:{value:wi,optional:!0},opacity:{value:Hn,scale:"auto",optional:!0}}}function ite(e,t){t&&e.text(n=>vx(t[n]))}function ote(e,t){t&&e.text(([n])=>vx(t[n]))}function v_(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:a,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:E}){n&&xn(e,"aria-label",D=>n[D]),i&&xn(e,"fill",D=>i[D]),a&&xn(e,"fill-opacity",D=>a[D]),c&&xn(e,"stroke",D=>c[D]),d&&xn(e,"stroke-opacity",D=>d[D]),p&&xn(e,"stroke-width",D=>p[D]),v&&xn(e,"opacity",D=>v[D]),E&&a5(e,D=>E[D],t),function nte(e,t){t&&e.filter(n=>nS(t[n])).append("title").call(ite,t)}(e,r)}function ste(e,{target:t},{ariaLabel:n,title:r,fill:i,fillOpacity:a,stroke:c,strokeOpacity:d,strokeWidth:p,opacity:v,href:E}){n&&xn(e,"aria-label",([D])=>n[D]),i&&xn(e,"fill",([D])=>i[D]),a&&xn(e,"fill-opacity",([D])=>a[D]),c&&xn(e,"stroke",([D])=>c[D]),d&&xn(e,"stroke-opacity",([D])=>d[D]),p&&xn(e,"stroke-width",([D])=>p[D]),v&&xn(e,"opacity",([D])=>v[D]),E&&a5(e,([D])=>E[D],t),function rte(e,t){t&&e.filter(([n])=>nS(t[n])).append("title").call(ote,t)}(e,r)}function Sf(e,t,n,r){(function hte(e,t,n,r){let i;switch(t.clip){case"frame":{const{width:a,height:c,marginLeft:d,marginRight:p,marginTop:v,marginBottom:E}=n,D=s5();i=`url(#${D})`,e=ls("svg:g",r).call(T=>T.append("svg:clipPath").attr("id",D).append("rect").attr("x",d).attr("y",v).attr("width",a-p-d).attr("height",c-v-E)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{const{projection:a}=r;if(!a)throw new Error('the "sphere" clip option requires a projection');const c=s5();i=`url(#${c})`,e.append("clipPath").attr("id",c).append("path").attr("d",iD(a)({type:"Sphere"}));break}}xn(e,"aria-label",t.ariaLabel),xn(e,"aria-description",t.ariaDescription),xn(e,"aria-hidden",t.ariaHidden),xn(e,"clip-path",i)})(e,t,n,r),xn(e,"fill",t.fill),xn(e,"fill-opacity",t.fillOpacity),xn(e,"stroke",t.stroke),xn(e,"stroke-width",t.strokeWidth),xn(e,"stroke-opacity",t.strokeOpacity),xn(e,"stroke-linejoin",t.strokeLinejoin),xn(e,"stroke-linecap",t.strokeLinecap),xn(e,"stroke-miterlimit",t.strokeMiterlimit),xn(e,"stroke-dasharray",t.strokeDasharray),xn(e,"stroke-dashoffset",t.strokeDashoffset),xn(e,"shape-rendering",t.shapeRendering),xn(e,"paint-order",t.paintOrder),xn(e,"pointer-events",t.pointerEvents)}function Mf(e,t){(function dte(e,t,n){null!=n&&e.style(t,n)})(e,"mix-blend-mode",t.mixBlendMode),xn(e,"opacity",t.opacity)}function a5(e,t,n){e.each(function(r){const i=t(r);if(null!=i){const a=this.ownerDocument.createElementNS(tm.svg,"a");a.setAttribute("fill","inherit"),a.setAttributeNS(tm.xlink,"href",i),null!=n&&a.setAttribute("target",n),this.parentNode.insertBefore(a,this).appendChild(this)}})}function xn(e,t,n){null!=n&&e.attr(t,n)}function Tf(e,t,{x:n,y:r},i=Qs,a=Qs){i+=t.dx,a+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(a+=r.bandwidth()/2),(i||a)&&e.attr("transform",`translate(${i},${a})`)}function ea(e,t){if((e=Sl(e))!==t)return e}function b_(e,t){if((e=So(e))!==t)return e}const fte=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function PS(e){if(void 0===e)return`plot-${Math.random().toString(16).slice(2)}`;if(!fte.test(e=`${e}`))throw new Error(`invalid class name: ${e}`);return e}function RS(e,t){if("string"==typeof t)e.property("style",t);else if(null!=t)for(const n of e)Object.assign(n.style,t)}function FS({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:a,marginLeft:c}){return[/left$/.test(e)?c:/right$/.test(e)?t-i:(c+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-a:(r+n-a)/2]}function mte({x:e,y:t,fy:n,fx:r},i,{projection:a,aspectRatio:c},{width:d,marginTopDefault:p,marginRightDefault:v,marginBottomDefault:E,marginLeftDefault:D}){const T=n?n.scale.domain().length:1,P=function oee(e,t){if("function"==typeof e?.stream)return.618;if(Im(e)&&(e=e.type),null==e)return function see(e){for(const t of e)if(t.channels.geometry)return!0;return!1}(t)?.618:void 0;if("function"!=typeof e){const{aspectRatio:n}=I3(e);if(n)return n}return.618}(a,i);if(P){const G=r?r.scale.domain().length:1,Z=Math.max(.1,Math.min(10,(1.1*T-.1)/(1.1*G-.1)*P));return Math.round((d-D-v)*Z+p+E)}const N=t?Df(t)?t.scale.domain().length:Math.max(7,17/T):1;if(null!=c){if(c=+c,!(isFinite(c)&&c>0))throw new Error(`invalid aspectRatio: ${c}`);const G=l5("y",t)/(l5("x",e)*c),U=r?r.scale.bandwidth():1,Z=n?n.scale.bandwidth():1;return(G*(U*(d-D-v)-e.insetLeft-e.insetRight)+t.insetTop+t.insetBottom)/Z+p+E}return!(!t&&!n)*Math.max(1,Math.min(60,N*T))*20+30*!!r+60}function l5(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);const{type:n,domain:r}=t;let i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{const d=t.scale.exponent();i=p=>Math.pow(p,d);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}const[a,c]=Qp(r);return Math.abs(i(c)-i(a))}function OS(e,{fx:t,fy:n}){const r=u_(e),i=t?.value,a=n?.value;return t&&n?My(r,c=>(c.fx=i[c[0]],c.fy=a[c[0]],c),c=>i[c],c=>a[c]):t?My(r,c=>(c.fx=i[c[0]],c),c=>i[c]):My(r,c=>(c.fy=a[c[0]],c),c=>a[c])}function vte(e){const t=[],n=new Uint32Array(B0(e,r=>r.length));for(const r of e){let i=0;for(const a of e)r!==a&&(n.set(a,i),i+=a.length);t.push(n.slice(0,i))}return t}const bte=new Map([["top",LS],["right",BS],["bottom",NS],["left",zS],["top-left",bx(LS,zS)],["top-right",bx(LS,BS)],["bottom-left",bx(NS,zS)],["bottom-right",bx(NS,BS)],["top-empty",function wte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const a=t?.indexOf(r);if(a>0){const c=t[a-1];return e.find(d=>d.x===n&&d.y===c)?.empty}}],["right-empty",function Dte(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const a=t?.indexOf(n);if(ad.x===c&&d.y===r)?.empty}}],["bottom-empty",function Cte(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;const a=t?.indexOf(r);if(ad.x===n&&d.y===c)?.empty}}],["left-empty",function Ete(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;const a=t?.indexOf(n);if(a>0){const c=t[a-1];return e.find(d=>d.x===c&&d.y===r)?.empty}}],["empty",function Ste(e,t,{empty:n}){return n}]]);function LS(e,{y:t},{y:n}){return!t||0===t.indexOf(n)}function NS(e,{y:t},{y:n}){return!t||t.indexOf(n)===t.length-1}function zS(e,{x:t},{x:n}){return!t||0===t.indexOf(n)}function BS(e,{x:t},{x:n}){return!t||t.indexOf(n)===t.length-1}function bx(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function VS(e,{channels:{fx:t,fy:n},groups:r}){return e.map(t&&n?({x:i,y:a})=>r.get(i)?.get(a)??[]:t?({x:i})=>r.get(i)??[]:({y:i})=>r.get(i)??[])}function c5(e){return Df(e)&&void 0===e.interval?void 0:"tabular-nums"}function u5(e,t){if(null==t)return t;const n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function h5(e,t={},n,r){let{columns:i,tickFormat:a,fontVariant:c=c5(e),swatchSize:d=15,swatchWidth:p=d,swatchHeight:v=d,marginLeft:E=0,className:D,style:T,width:P}=t;const N=CS(t);D=PS(D),a=function Mte(e,t){return void 0===e?Ml(t)?o5:Sl:"function"==typeof e?e:("string"==typeof e?Ml(t)?s_:um:Mm)(e)}(a,e.domain);const G=ls("div",N).attr("class",D).attr("style",`\n --swatchWidth: ${+p}px;\n --swatchHeight: ${+v}px;\n `);let U;return null!=i?(U=`\n .${D}-swatch {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n }\n .${D}-swatch::before {\n flex-shrink: 0;\n }\n .${D}-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n `,G.style("columns",i).selectAll().data(e.domain).enter().append("div").attr("class",`${D}-swatch`).call(n,e).call(Z=>Z.append("div").attr("class",`${D}-label`).attr("title",a).text(a))):(U=`\n .${D} {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n }\n .${D}-swatch {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n }\n `,G.selectAll().data(e.domain).enter().append("span").attr("class",`${D}-swatch`).call(n,e).append(function(){return this.ownerDocument.createTextNode(a.apply(this,arguments))})),G.call(Z=>Z.insert("style","*").text(`\n .${D} {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;${void 0===E?"":`\n margin-left: ${+E}px;`}${void 0===P?"":`\n width: ${P}px;`}\n }\n ${r(D)}\n ${U}\n `)).style("font-variant",ea(c,"normal")).call(RS,T).node()}const xx=new Map([["symbol",function Ate(e,{fill:t=(void 0!==e.hint?.fill?e.hint.fill:"none"),fillOpacity:n=1,stroke:r=(void 0!==e.hint?.stroke?e.hint.stroke:Js(t)?"currentColor":"none"),strokeOpacity:i=1,strokeWidth:a=1.5,r:c=4.5,...d}={},p){const[v,E]=Tm(t),[D,T]=Tm(r),P=u5(p,v),N=u5(p,D),G=c*c*Math.PI;return n=As(n)[1],i=As(i)[1],a=As(a)[1],h5(e,d,U=>U.append("svg").attr("viewBox","-8 -8 16 16").attr("fill","color"===v?Z=>P.scale(Z):null).attr("stroke","color"===D?Z=>N.scale(Z):null).append("path").attr("d",Z=>{const ne=_f();return e.scale(Z).draw(ne,G),ne}),U=>`.${U}-swatch > svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n overflow: visible;\n fill: ${E};\n fill-opacity: ${n};\n stroke: ${T};\n stroke-width: ${a}px;\n stroke-opacity: ${i};\n }`)}],["color",d5],["opacity",function Pte({type:e,interpolate:t,...n},{legend:r=!0,color:i=Oh(0,0,0),...a}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(!0===r&&(r="ramp"),"ramp"!==`${r}`.toLowerCase())throw new Error(`${r} opacity legends are not supported`);return d5({type:e,...n,interpolate:Rte(i)},{legend:r,...a})}]]);function US(e,{label:t,ticks:n,tickFormat:r}={},i){return function IQ(e={},...t){let n=e;for(const r of t)for(const i in r)if(void 0===n[i]){const a=r[i];n===e?n={...n,[i]:a}:n[i]=a}return n}(i,e,{label:t,ticks:n,tickFormat:r})}function d5(e,{legend:t=!0,...n}){if(!0===t&&(t="ordinal"===e.type?"swatches":"ramp"),void 0!==e.domain)switch(`${t}`.toLowerCase()){case"swatches":return function Ite(e,{opacity:t,...n}={}){if(!Df(e)&&!r5(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return h5(e,n,(r,i)=>r.append("svg").attr("fill",i.scale).attr("fill-opacity",As(t)[1]).append("rect").attr("width","100%").attr("height","100%"),r=>`.${r}-swatch svg {\n width: var(--swatchWidth);\n height: var(--swatchHeight);\n margin-right: 0.5em;\n }`)}(e,n);case"ramp":return function Tte(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:a=44+r,marginTop:c=18,marginRight:d=0,marginBottom:p=16+r,marginLeft:v=0,style:E,ticks:D=(i-v-d)/64,tickFormat:T,fontVariant:P=c5(e),round:N=!0,opacity:G,className:U}=t;const Z=CS(t);U=PS(U),G=As(G)[1],null===T&&(T=()=>null);const ne=ls("svg",Z).attr("class",U).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",a).attr("viewBox",`0 0 ${i} ${a}`).call(st=>st.append("style").text(`\n .${U} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n }\n .${U} text {\n white-space: pre;\n }\n `)).call(RS,E);let re,X=st=>st.selectAll(".tick line").attr("y1",c+p-a);const fe=N?(st,Fe)=>st.rangeRound(Fe):(st,Fe)=>st.range(Fe),{type:ve,domain:Re,range:We,interpolate:Ke,scale:lt,pivot:Ue}=e;if(Ke){const st=void 0===We?Ke:CD(1===Ke.length?MS(Ke):Ke,We);re=fe(lt.copy(),El($o(v,i-d),Math.min(Re.length+(void 0!==Ue),void 0===We?1/0:We.length)));const Fe=256,le=Z.document.createElement("canvas");le.width=Fe,le.height=1;const de=le.getContext("2d");for(let pe=0,Oe=Fe-1;pele:"string"==typeof T?um(T):T;re=fe(PD().domain([-1,We.length-1]),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(We).enter().append("rect").attr("x",(le,de)=>re(de-1)).attr("y",c).attr("width",(le,de)=>re(de)-re(de-1)).attr("height",a-c-p).attr("fill",le=>le),D=Go(st,(le,de)=>de),T=le=>Fe(st[le],le)}else re=fe(Ob().domain(Re),[v,i-d]),ne.append("g").attr("fill-opacity",G).selectAll().data(Re).enter().append("rect").attr("x",re).attr("y",c).attr("width",Math.max(0,re.bandwidth()-1)).attr("height",a-c-p).attr("fill",lt),X=()=>{};return ne.append("g").attr("transform",`translate(0,${a-p})`).call(function XG(e){return G0(3,e)}(re).ticks(Array.isArray(D)?null:D,"string"==typeof T?T:void 0).tickFormat("function"==typeof T?T:void 0).tickSize(r).tickValues(Array.isArray(D)?D:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",ea(P,"normal")).call(X).call(st=>st.select(".domain").remove()),void 0!==n&&ne.append("text").attr("x",v).attr("y",c-6).attr("fill","currentColor").attr("font-weight","bold").text(n),ne.node()}(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function Rte(e){const{r:t,g:n,b:r}=Oh(e)||Oh(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function $S({filter:e,sort:t,reverse:n,transform:r,initializer:i,...a}={},c){if(void 0===r&&(null!=e&&(r=GS(e)),null!=t&&!Am(t)&&(r=jS(r,ZS(t))),n&&(r=jS(r,qS))),null!=c&&null!=i)throw new Error("transforms cannot be applied after initializers");return{...a,...(null===t||Am(t))&&{sort:t},transform:jS(r,c)}}function wx({filter:e,sort:t,reverse:n,initializer:r,...i}={},a){return void 0===r&&(null!=e&&(r=GS(e)),null!=t&&!Am(t)&&(r=HS(r,ZS(t))),n&&(r=HS(r,qS))),{...i,...(null===t||Am(t))&&{sort:t},initializer:HS(r,a)}}function jS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r){return({data:n,facets:r}=e.call(this,n,r)),t.call(this,Sc(n),r)}}function HS(e,t){return null==e?null===t?void 0:t:null==t?null===e?void 0:e:function(n,r,i,...a){let c,d,p,v,E,D;return({data:d=n,facets:p=r,channels:c}=e.call(this,n,r,i,...a)),({data:E=d,facets:D=p,channels:v}=t.call(this,d,p,{...i,...c},...a)),{data:E,facets:D,channels:{...c,...v}}}}function Cx(e,t){return(null!=e.initializer?wx:$S)(e,t)}function GS(e){return(t,n)=>{const r=Dc(t,e);return{data:t,facets:n.map(i=>i.filter(a=>r[a]))}}}function qS(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function ZS(e){return("function"==typeof e&&1!==e.length?Lte:f5)(e)}function Lte(e){return(t,n)=>{const r=(i,a)=>e(t[i],t[a]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function f5(e){let t,n;if(({channel:t,value:e,order:n=Sm}={...hS(e)}),"function"!=typeof n)switch(`${n}`.toLowerCase()){case"ascending":n=Sm;break;case"descending":n=a3;break;default:throw new Error(`invalid order: ${n}`)}return(r,i,a)=>{let c;if(void 0===t)c=Dc(r,e);else{if(void 0===a)throw new Error("channel sort requires an initializer");if(c=a[t],!c)return{};c=c.value}const d=(p,v)=>n(c[p],c[v]);return{data:r,facets:i.map(p=>p.slice().sort(d))}}}class Ic{constructor(t,n={},r={},i){const{facet:a="auto",facetAnchor:c,fx:d,fy:p,sort:v,dx:E=0,dy:D=0,margin:T=0,marginTop:P=T,marginRight:N=T,marginBottom:G=T,marginLeft:U=T,clip:Z,channels:ne}=r;if(this.data=t,this.sort=Am(v)?v:null,this.initializer=wx(r).initializer,this.transform=this.initializer?r.transform:$S(r).transform,null===a||!1===a?this.facet=null:(this.facet=Eu(!0===a?"include":a,"facet",["auto","include","exclude","super"]),this.fx=d,this.fy=p),this.facetAnchor=function xte(e){if(null==e)return null;const t=bte.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}(c),n=_3(n),void 0!==ne&&(n={..._3(ne),...n}),void 0!==i&&(n={...tte(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([X,re])=>{const{value:fe}=re;return sx(fe)&&(re={...re,value:fe.value},void 0!==fe.scale&&(re.scale=fe.scale)),[X,re]}).filter(([X,{value:re,optional:fe}])=>{if(null!=re)return!0;if(fe)return!1;throw new Error(`missing channel value: ${X}`)})),this.dx=+E,this.dy=+D,this.marginTop=+P,this.marginRight=+N,this.marginBottom=+G,this.marginLeft=+U,this.clip=function ute(e){return!0===e?e="frame":!1===e&&(e=null),p3(e,"clip",["frame","sphere"])}(Z),"super"===this.facet){if(d||p)throw new Error("super-faceting cannot use fx or fy");for(const X in this.channels){const{scale:re}=n[X];if("x"===re||"y"===re)throw new Error("super-faceting cannot use x or y")}}}initialize(t,n){let r=Sc(this.data);void 0===t&&null!=r&&(t=[u_(r)]);const i=t;null!=this.transform&&(({facets:t,data:r}=this.transform(r,t)),r=Sc(r)),void 0!==t&&(t.original=i);const a=function ZQ(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,m_(t,r,n)]))}(this.channels,r);return null!=this.sort&&function XQ(e,t,n,r,i){const{reverse:a,reduce:c=!0,limit:d}=i;for(const p in i){if(!ii.has(p))continue;let{value:v,reverse:E=a,reduce:D=c,limit:T=d}=hS(i[p]);if(void 0===E&&(E="width"===v||"height"===v),null==D||!1===D)continue;const P="fx"===p||"fy"===p?KQ(t,r[p]):YQ(n,p);if(!P)throw new Error(`missing channel for scale: ${p}`);const N=P.value,[G=0,U=1/0]=Vh(T)?T:T<0?[T]:[0,T];if(null==v)P.domain=()=>{let Z=Array.from(new pE(N));return E&&(Z=Z.reverse()),(0!==G||U!==1/0)&&(Z=Z.slice(G,U)),Z};else{const Z="data"===v?e:"height"===v?M3(n,"y1","y2"):"width"===v?M3(n,"x1","x2"):bS(n,v,"y"===v?"y2":"x"===v?"x2":void 0),ne=_S(!0===D?"max":D,Z);P.domain=()=>{let X=My(u_(N),re=>ne.reduceIndex(re,Z),re=>N[re]);return X=yE(X,E?QQ:JQ),(0!==G||U!==1/0)&&(X=X.slice(G,U)),X.map(d3)}}}}(r,t,a,n,this.sort),{data:r,facets:t,channels:a}}filter(t,n,r){for(const i in n){const{filter:a=Dl}=n[i];if(null!==a){const c=r[i];t=t.filter(d=>a(c[d]))}}return t}project(t,n,r){px("x","y",t,n,r),px("x1","y1",t,n,r),px("x2","y2",t,n,r)}scale(t,n,r){const i=function WQ(e,t){const n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:a}])=>{const c=null==i?null:t[i];return[r,null==c?a:Go(a,c)]}));return n.channels=e,n}(t,n);return r.projection&&this.project(t,i,r),i}}function p5(...e){return e.plot=Ic.prototype.plot,e}const m5=Math.PI/180;function g5({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=_5(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function y5({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=_5(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function _5(e,t,n){return void 0===e&&void 0===t&&void 0===n?Qs?[1,0]:[.5,.5]:[t,n]}function v5(e,{interval:t}){return(e={...hS(e)}).interval=uS(void 0===e.interval?t:e.interval),e}function Ex(e,t,n,r){const{[e]:i,[`${e}1`]:a,[`${e}2`]:c}=n,{value:d,interval:p}=v5(i,n);if(null==d||null==p&&!r)return n;const v=h_(i);if(null==p){let P;const N={transform:G=>P||(P=Dc(G,d)),label:v};return{...n,[e]:void 0,[`${e}1`]:void 0===a?N:a,[`${e}2`]:void 0===c?N:c}}let E,D;function T(P){return void 0!==D&&P===E?D:D=Go(Dc(E=P,d),N=>p.floor(N))}return t({...n,[e]:void 0,[`${e}1`]:void 0===a?{transform:T,label:v}:a,[`${e}2`]:void 0===c?{transform:P=>T(P).map(N=>p.offset(N)),label:v}:c})}function b5(e,t,n){const{[e]:r}=n,{value:i,interval:a}=v5(r,n);return null==i||null==a?n:t({...n,[e]:{label:h_(r),transform:c=>{const d=Go(Dc(c,i),v=>a.floor(v)),p=d.map(v=>a.offset(v));return d.map(Ml(d)?(v,E)=>null==v||isNaN(v=+v)||null==(E=p[E])||isNaN(E=+E)?void 0:new Date((v+E)/2):(v,E)=>null==v||null==(E=p[E])?NaN:(+v+ +E)/2)}}})}const x5={ariaLabel:"rule",fill:null,stroke:"currentColor"};class Ute extends Ic{constructor(t,n={}){const{x:r,y1:i,y2:a,inset:c=0,insetTop:d=c,insetBottom:p=c}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:a,scale:"y",optional:!0}},n,x5),this.insetTop=So(d),this.insetBottom=So(p)}render(t,n,r,i,a){const{x:c,y:d}=n,{x:p,y1:v,y2:E}=r,{width:D,height:T,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetTop:Z,insetBottom:ne}=this;return ls("svg:g",a).call(Sf,this,i).call(Tf,this,{x:p&&c},Qs,0).call(X=>X.selectAll().data(t).enter().append("line").call(Mf,this).attr("x1",p?re=>p[re]:(G+D-N)/2).attr("x2",p?re=>p[re]:(G+D-N)/2).attr("y1",v&&!yx(d)?re=>v[re]+Z:P+Z).attr("y2",E&&!yx(d)?d.bandwidth?re=>E[re]+d.bandwidth()-ne:re=>E[re]-ne:T-U-ne).call(v_,this,r)).node()}}class $te extends Ic{constructor(t,n={}){const{x1:r,x2:i,y:a,inset:c=0,insetRight:d=c,insetLeft:p=c}=n;super(t,{y:{value:a,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},n,x5),this.insetRight=So(d),this.insetLeft=So(p)}render(t,n,r,i,a){const{x:c,y:d}=n,{y:p,x1:v,x2:E}=r,{width:D,height:T,marginTop:P,marginRight:N,marginLeft:G,marginBottom:U}=i,{insetLeft:Z,insetRight:ne}=this;return ls("svg:g",a).call(Sf,this,i,a).call(Tf,this,{y:p&&d},0,Qs).call(X=>X.selectAll().data(t).enter().append("line").call(Mf,this).attr("x1",v&&!yx(c)?re=>v[re]+Z:G+Z).attr("x2",E&&!yx(c)?c.bandwidth?re=>E[re]+c.bandwidth()-ne:re=>E[re]-ne:D-N-ne).attr("y1",p?re=>p[re]:(P+T-U)/2).attr("y2",p?re=>p[re]:(P+T-U)/2).call(v_,this,r)).node()}}function jte(e,t){let{x:n=Cu,y:r,y1:i,y2:a,...c}=function zte(e={}){return Ex("y",y5,e)}(t);return[i,a]=w5(r,i,a),new Ute(e,{...c,x:n,y1:i,y2:a})}function Hte(e,t){let{y:n=Cu,x:r,x1:i,x2:a,...c}=function Nte(e={}){return Ex("x",g5,e)}(t);return[i,a]=w5(r,i,a),new $te(e,{...c,y:n,x1:i,x2:a})}function w5(e,t,n){if(void 0===e){if(void 0===t){if(void 0!==n)return[0,n]}else if(void 0===n)return[0,t]}else{if(void 0===t)return void 0===n?[0,e]:[e,n];if(void 0===n)return[e,t]}return[t,n]}function WS(e,...t){let n=t.length;for(let r=0,i=!0;r{let i=e[0];for(let a=0;aDc(t,e,Float64Array),label:h_(e)}),optional:!0},text:{value:a,filter:nS,optional:!0}},n,Gte),this.rotate=re,this.textAnchor=ea(d,"middle"),this.lineAnchor=Eu(p,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+v,this.lineWidth=+E,this.textOverflow=function qte(e){return null==e?null:Eu(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}(D),this.monospace=!!T,this.fontFamily=Sl(P),this.fontSize=ve,this.fontStyle=Sl(G),this.fontVariant=Sl(U),this.fontWeight=Sl(Z),this.frameAnchor=fS(c),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${E}`);var e;this.splitLines=function nne({monospace:e,lineWidth:t,textOverflow:n}){if(null!=n||t==1/0)return a=>a.split(/\r\n?|\n/g);const r=e?M5:S5,i=100*t;return a=>function ene(e,t,n){const r=[];let i,a=0;for(const[c,d,p]of function*tne(e){let t=0,n=0;const r=e.length;for(;ni&&n(e,i,d)>t&&(r.push(e.slice(i,a)+("\xad"===e[a-1]?"-":"")),i=c),p?(r.push(e.slice(i,d)),i=void 0):a=d;return r}(a,i,r)}(this),this.clipLine=function rne({monospace:e,lineWidth:t,textOverflow:n}){if(null==n||t==1/0)return a=>a;const r=e?M5:S5,i=100*t;switch(n){case"clip-start":return a=>I5(a,i,r,"");case"clip-end":return a=>T5(a,i,r,"");case"ellipsis-start":return a=>I5(a,i,r,"\u2026");case"ellipsis-middle":return a=>function ine(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const a=n(r)/2,[c,d]=Dx(e,t/2,n,a),[p]=Dx(e,i-t/2-d+a,n,-a);return p<0?r:e.slice(0,c).trimEnd()+r+e.slice(Rm(e,p)).trimStart()}(a,i,r,"\u2026");case"ellipsis-end":return a=>T5(a,i,r,"\u2026")}}(this)}render(t,n,r,i,a){const{x:c,y:d}=n,{x:p,y:v,rotate:E,text:D,title:T,fontSize:P}=r,{rotate:N}=this,[G,U]=FS(this,i);return ls("svg:g",a).call(Sf,this,i,a).call(Yte,this,D,i).call(Tf,this,{x:p&&c,y:v&&d}).call(Z=>Z.selectAll().data(t).enter().append("text").call(Mf,this).call(Zte,this,D,T).attr("transform",WS`translate(${p?ne=>p[ne]:G},${v?ne=>v[ne]:U})${E?ne=>` rotate(${E[ne]})`:N?` rotate(${N})`:""}`).call(xn,"font-size",P&&(ne=>P[ne])).call(v_,this,r)).node()}}function Zte(e,t,n,r){if(!n)return;const{lineAnchor:i,lineHeight:a,textOverflow:c,splitLines:d,clipLine:p}=t;e.each(function(v){const E=d(vx(n[v])??"").map(p),D=E.length,T="top"===i?.71:"bottom"===i?1-D:(164-100*D)/200;if(D>1)for(let P=0;Pt){for(a+=r;a>t&&c>0;)d=c,c=i.pop(),a-=n(e,c,d);return[c,t-a]}a+=v,i.push(c)}return[-1,0]}function T5(e,t,n,r){e=e.trim();const i=n(r),[a]=Dx(e,t,n,i);return a<0?e:e.slice(0,a).trimEnd()+r}function I5(e,t,n,r){const i=n(e=e.trim());if(i<=t)return e;const a=n(r),[c]=Dx(e,i-t+a,n,-a);return c<0?r:r+e.slice(Rm(e,c)).trimStart()}const YS=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,A5=/\p{Extended_Pictographic}/uy;function Rm(e,t){return t+=function one(e,t){const n=e.charCodeAt(t);if(n>=55296&&n<56320){const r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}(e,t)?2:1,function ane(e,t){return!k5(e,t)&&(YS.lastIndex=t,YS.test(e))}(e,t)&&(t=YS.lastIndex),function sne(e,t){return 8205===e.charCodeAt(t)}(e,t)?Rm(e,t+1):t}function k5(e,t){return e.charCodeAt(t)<128}function P5(e,t){return!k5(e,t)&&(A5.lastIndex=t,A5.test(e))}const R5={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},F5=3.5,lne=5*F5,O5={draw(e,t,n){const r=t*n/lne;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},cne=new Map([["arrow",O5],["spike",{draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}}]]);class KS extends Ic{constructor(t,n={}){const{x:r,y:i,r:a=F5,length:c,rotate:d,shape:p=O5,anchor:v="middle",frameAnchor:E}=n,[D,T]=As(c,12),[P,N]=As(d,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:D,scale:"length",optional:!0},rotate:{value:P,optional:!0}},n,R5),this.r=+a,this.length=T,this.rotate=N,this.shape=function hne(e){if(function une(e){return e&&"function"==typeof e.draw}(e))return e;const t=cne.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}(p),this.anchor=Eu(v,"anchor",["start","middle","end"]),this.frameAnchor=fS(E)}render(t,n,r,i,a){const{x:c,y:d}=n,{x:p,y:v,length:E,rotate:D}=r,{length:T,rotate:P,anchor:N,shape:G,r:U}=this,[Z,ne]=FS(this,i);return ls("svg:g",a).call(Sf,this,i,a).call(Tf,this,{x:p&&c,y:v&&d}).call(X=>X.selectAll().data(t).enter().append("path").call(Mf,this).attr("transform",WS`translate(${p?re=>p[re]:Z},${v?re=>v[re]:ne})${D?re=>` rotate(${D[re]})`:P?` rotate(${P})`:""}${"start"===N?"":"end"===N?E?re=>` translate(0,${E[re]})`:` translate(0,${T})`:E?re=>` translate(0,${E[re]/2})`:` translate(0,${T/2})`}`).attr("d",E?re=>{const fe=_f();return G.draw(fe,E[re],U),fe}:(()=>{const re=_f();return G.draw(re,T,U),re})()).call(v_,this,r)).node()}}function fne(e,t={}){const{x:n=Cu,...r}=t;return new KS(e,{...r,x:n})}function pne(e,t={}){const{y:n=Cu,...r}=t;return new KS(e,{...r,y:n})}function Uh(e,t){return arguments.length<2&&!Vh(e)&&(t=e,e=null),void 0===t&&(t={}),[e,t]}function Sx({anchor:e}={},t){return void 0===e?t[0]:Eu(e,"anchor",t)}function N5(e){return Sx(e,["left","right"])}function z5(e){return Sx(e,["right","left"])}function B5(e){return Sx(e,["bottom","top"])}function V5(e){return Sx(e,["top","bottom"])}function U5(){const[e,t]=Uh(...arguments);return j5("y",N5(t),e,t)}function mne(){const[e,t]=Uh(...arguments);return j5("fy",z5(t),e,t)}function $5(){const[e,t]=Uh(...arguments);return H5("x",B5(t),e,t)}function gne(){const[e,t]=Uh(...arguments);return H5("fx",V5(t),e,t)}function j5(e,t,n,{color:r="currentColor",opacity:i=1,stroke:a=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:E,textStroke:D,textStrokeOpacity:T,textStrokeWidth:P,tickSize:N=("y"===e?6:0),tickPadding:G,tickRotate:U,x:Z,marginTop:ne=20,marginRight:X=("right"===t?40:0),marginBottom:re=20,marginLeft:fe=("left"===t?40:0),label:ve,labelOffset:Re,labelAnchor:We,...Ke}){return N=So(N),G=So(G),U=So(U),void 0!==We&&(We=Eu(We,"labelAnchor",["center","top","bottom"])),p5(N&&!Js(a)?function yne(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:a=null,facetAnchor:c=t+("y"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetLeft:E=v,insetRight:D=v,dx:T=0,y:P=("y"===e?void 0:null),...N}){return Fm(pne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinecap:i,strokeLinejoin:a,facetAnchor:c,frameAnchor:d,y:P,...N,dx:"left"===t?+T-Qs+ +E:+T+Qs-D,anchor:"start",length:p,shape:"left"===t?Tne:Ine})}(e,t,n,{stroke:a,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,x:Z,...Ke}):null,Js(p)?null:function vne(e,t,n,{facetAnchor:r=t+("y"===e?"-empty":""),frameAnchor:i=t,tickSize:a,tickRotate:c=0,tickPadding:d=Math.max(3,9-a)+(Math.abs(c)>60?4*Math.cos(c*m5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:E=(Math.abs(c)>60?"middle":"left"===t?"end":"start"),lineAnchor:D=(c>60?"top":c<-60?"bottom":"middle"),fontVariant:T,inset:P=0,insetLeft:N=P,insetRight:G=P,dx:U=0,y:Z=("y"===e?void 0:null),...ne}){return Fm(Xte,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:E,lineAnchor:D,fontVariant:T,rotate:c,y:Z,...ne,dx:"left"===t?+U-a-d+ +N:+U+ +a+ +d-G},function(X,re,fe){void 0===T&&(this.fontVariant=X5(X)),void 0===v&&(fe.text=W5(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:T,strokeWidth:P,textAnchor:E,tickSize:N,tickPadding:G,tickRotate:U,x:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),Js(p)||null===ve?null:E5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="y"===e&&le.inset||le,et=We??(de.bandwidth?"center":"top"),_t=Re??("right"===t?Oe:Ze)-3;return"center"===et?(this.textAnchor=void 0,this.lineAnchor="right"===t?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor="right"===t?"end":"start",this.lineAnchor=et,this.frameAnchor=`${et}-${t}`,this.rotate=0),this.dy="top"===et?3-pe:"bottom"===et?Ye-3:0,this.dx="right"===t?_t:-_t,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?Y5(e,de,et):ve]}}}}}))}function H5(e,t,n,{color:r="currentColor",opacity:i=1,stroke:a=r,strokeOpacity:c=i,strokeWidth:d=1,fill:p=r,fillOpacity:v=i,textAnchor:E,textStroke:D,textStrokeOpacity:T,textStrokeWidth:P,tickSize:N=("x"===e?6:0),tickPadding:G,tickRotate:U,y:Z,marginTop:ne=("top"===t?30:0),marginRight:X=20,marginBottom:re=("bottom"===t?30:0),marginLeft:fe=20,label:ve,labelAnchor:Re,labelOffset:We,...Ke}){return N=So(N),G=So(G),U=So(U),void 0!==Re&&(Re=Eu(Re,"labelAnchor",["center","left","right"])),p5(N&&!Js(a)?function _ne(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:a=null,facetAnchor:c=t+("x"===e?"-empty":""),frameAnchor:d=t,tickSize:p,inset:v=0,insetTop:E=v,insetBottom:D=v,dy:T=0,x:P=("x"===e?void 0:null),...N}){return Fm(fne,e,`${e}-axis tick`,n,{strokeWidth:r,strokeLinejoin:a,strokeLinecap:i,facetAnchor:c,frameAnchor:d,x:P,...N,dy:"bottom"===t?+T-Qs-D:+T+Qs+ +E,anchor:"start",length:p,shape:"bottom"===t?Sne:Mne})}(e,t,n,{stroke:a,strokeOpacity:c,strokeWidth:d,tickSize:N,tickPadding:G,tickRotate:U,y:Z,...Ke}):null,Js(p)?null:function bne(e,t,n,{facetAnchor:r=t+("x"===e?"-empty":""),frameAnchor:i=t,tickSize:a,tickRotate:c=0,tickPadding:d=Math.max(3,9-a)+(Math.abs(c)>=10?4*Math.cos(c*m5):0),tickFormat:p,text:v=("function"==typeof p?p:void 0),textAnchor:E=(Math.abs(c)>=10?c<0^"bottom"===t?"start":"end":"middle"),lineAnchor:D=(Math.abs(c)>=10?"middle":"bottom"===t?"top":"bottom"),fontVariant:T,inset:P=0,insetTop:N=P,insetBottom:G=P,dy:U=0,x:Z=("x"===e?void 0:null),...ne}){return Fm(Wte,e,`${e}-axis tick label`,n,{facetAnchor:r,frameAnchor:i,text:void 0===v?null:v,textAnchor:E,lineAnchor:D,fontVariant:T,rotate:c,x:Z,...ne,dy:"bottom"===t?+U+ +a+ +d-G:+U-a-d+ +N},function(X,re,fe){void 0===T&&(this.fontVariant=X5(X)),void 0===v&&(fe.text=W5(X,re,p))})}(e,t,n,{fill:p,fillOpacity:v,stroke:D,strokeOpacity:T,strokeWidth:P,textAnchor:E,tickSize:N,tickPadding:G,tickRotate:U,y:Z,marginTop:ne,marginRight:X,marginBottom:re,marginLeft:fe,...Ke}),Js(p)||null===ve?null:E5([],{fill:p,fillOpacity:v,...Ke,lineWidth:void 0,textOverflow:void 0,facet:"super",x:null,y:null,initializer:function(lt,Ue,st,Fe,le){const de=Fe[e],{marginTop:pe,marginRight:Oe,marginBottom:Ye,marginLeft:Ze}="x"===e&&le.inset||le,et=Re??(de.bandwidth?"center":"right"),_t=We??("top"===t?pe:Ye)-3;return"center"===et?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${et}`,this.textAnchor="right"===et?"end":"start"),this.lineAnchor=t,this.dy="top"===t?-_t:_t,this.dx="right"===et?Oe-3:"left"===et?3-Ze:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[void 0===ve?Y5(e,de,et):ve]}}}}}))}function xne(){const[e,t]=Uh(...arguments);return G5("y",N5(t),e,t)}function wne(){const[e,t]=Uh(...arguments);return G5("fy",z5(t),e,t)}function Cne(){const[e,t]=Uh(...arguments);return q5("x",B5(t),e,t)}function Ene(){const[e,t]=Uh(...arguments);return q5("fx",V5(t),e,t)}function G5(e,t,n,{y:r=("y"===e?void 0:null),x:i=null,x1:a=("left"===t?i:null),x2:c=("right"===t?i:null),...d}){return Fm(Hte,e,`${e}-grid`,n,{y:r,x1:a,x2:c,...Z5(d)})}function q5(e,t,n,{x:r=("x"===e?void 0:null),y:i=null,y1:a=("top"===t?i:null),y2:c=("bottom"===t?i:null),...d}){return Fm(jte,e,`${e}-grid`,n,{x:r,y1:a,y2:c,...Z5(d)})}function Z5({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...a}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...a}}function Fm(e,t,n,r,i,a){let c;const d=e(r,wx(i,function(p,v,E,D){const{[t]:T}=D;if(!T)throw new Error(`missing scale: ${t}`);let{ticks:P,tickSpacing:N,interval:G}=i;if(n5(T)&&"string"==typeof P&&(G=P,P=void 0),null==p){if(Vh(P))p=Sc(P);else if(T.ticks)if(void 0!==P)p=T.ticks(P);else if(G=d_(void 0===G?T.interval:G,T.type),void 0!==G){const[U,Z]=Qp(T.domain());p=G.range(U,G.offset(G.floor(Z)))}else{const[U,Z]=Qp(T.range());P=(Z-U)/(void 0===N?"x"===t?80:35:N),p=T.ticks(P)}else p=T.domain();"y"===t||"x"===t?v=[u_(p)]:(c[t]={scale:t,value:Cu},v=void 0)}return a?.call(this,T,P,c),{data:p,facets:v,channels:Object.fromEntries(Object.entries(c).map(([U,Z])=>[U,{...Z,value:Dc(p,Z.value)}]))}}));return null==r?(c=d.channels,d.channels={}):c={},d.ariaLabel=n,d}function W5(e,t,n){return{value:Dne(e,t,n)}}function Dne(e,t,n){return e.tickFormat?e.tickFormat(Vh(t)?null:t,n):void 0===n?vx:"string"==typeof n?(Ml(e.domain())?s_:um)(n):Mm(n)}const Sne={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},Mne={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},Tne={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},Ine={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function X5(e){return e.bandwidth&&void 0===e.interval?void 0:"tabular-nums"}function Y5(e,t,n){const r=t.label;if(t.bandwidth||!r?.inferred)return r;const i=function Ane(e){return Math.sign(p_(e.domain()))*Math.sign(p_(e.range()))}(t);return i?"x"===e||"center"===n?"x"===e==i<0?`\u2190 ${r}`:`${r} \u2192`:`${i<0?"\u2191 ":"\u2193 "}${r}`:r}const kne={ariaLabel:"frame",fill:"none",stroke:"currentColor"},Pne={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square"};class Rne extends Ic{constructor(t={}){const{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:a=r,insetBottom:c=r,insetLeft:d=r,rx:p,ry:v}=t;super(void 0,void 0,t,null==n?kne:Pne),this.anchor=p3(n,"anchor",["top","right","bottom","left"]),this.insetTop=So(i),this.insetRight=So(a),this.insetBottom=So(c),this.insetLeft=So(d),this.rx=So(p),this.ry=So(v)}render(t,n,r,i,a){const{marginTop:c,marginRight:d,marginBottom:p,marginLeft:v,width:E,height:D}=i,{anchor:T,insetTop:P,insetRight:N,insetBottom:G,insetLeft:U,rx:Z,ry:ne}=this,X=v+U,re=E-d-N,fe=c+P,ve=D-p-G;return ls(T?"svg:line":"svg:rect",a).call(Sf,this,i,a).call(Mf,this).call(Tf,this,{}).call("left"===T?Re=>Re.attr("x1",X).attr("x2",X).attr("y1",fe).attr("y2",ve):"right"===T?Re=>Re.attr("x1",re).attr("x2",re).attr("y1",fe).attr("y2",ve):"top"===T?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",fe).attr("y2",fe):"bottom"===T?Re=>Re.attr("x1",X).attr("x2",re).attr("y1",ve).attr("y2",ve):Re=>Re.attr("x",X).attr("y",fe).attr("width",re-X).attr("height",ve-fe).attr("rx",Z).attr("ry",ne)).node()}}function K5(e={}){const{facet:t,style:n,caption:r,ariaLabel:i,ariaDescription:a}=e,c=PS(e.className),d=void 0===e.marks?[]:J5(e.marks),p=function Bne(e,t){if(null==e)return;const{x:n,y:r}=e;if(null==n&&null==r)return;const i=Sc(e.data??n??r);if(void 0===i)throw new Error("missing facet data");const a={};null!=n&&(a.fx=m_(i,{value:n,scale:"fx"})),null!=r&&(a.fy=m_(i,{value:r,scale:"fy"})),JS(a,t);return{channels:a,groups:OS(i,a),data:e.data}}(t,e),v=new Map;for(const Fe of d){const le=e4(Fe,p,e);le&&v.set(Fe,le)}const E=new Map;p&&x_(E,[p]),x_(E,v);const D=J5(function Vne(e,t,n){let{projection:r,x:i={},y:a={},fx:c={},fy:d={},axis:p,grid:v,facet:E={},facet:{axis:D=p,grid:T}=E,x:{axis:P=p,grid:N=(null===P?null:v)}=i,y:{axis:G=p,grid:U=(null===G?null:v)}=a,fx:{axis:Z=D,grid:ne=(null===Z?null:T)}=c,fy:{axis:X=D,grid:re=(null===X?null:T)}=d}=n;(r||!aS(i)&&!t4("x",e))&&(P=N=null),(r||!aS(a)&&!t4("y",e))&&(G=U=null),t.has("fx")||(Z=ne=null),t.has("fy")||(X=re=null),void 0===P&&(P=!Ix(e,"x")),void 0===G&&(G=!Ix(e,"y")),void 0===Z&&(Z=!Ix(e,"fx")),void 0===X&&(X=!Ix(e,"fy")),!0===P&&(P="bottom"),!0===G&&(G="left"),!0===Z&&(Z="top"===P||null===P?"bottom":"top"),!0===X&&(X="right"===G||null===G?"left":"right");const fe=[];return Tx(fe,re,wne,d),Mx(fe,X,mne,"right","left",E,d),Tx(fe,ne,Ene,c),Mx(fe,Z,gne,"top","bottom",E,c),Tx(fe,U,xne,a),Mx(fe,G,U5,"left","right",n,a),Tx(fe,N,Cne,i),Mx(fe,P,$5,"bottom","top",n,i),fe}(d,E,e));for(const Fe of D){const le=e4(Fe,p,e);le&&v.set(Fe,le)}d.unshift(...D);const T=function gte(e,t){const{fx:n,fy:r}=TS(e,t),i=n?.scale.domain(),a=r?.scale.domain();return i&&a?function kG(...e){const t="function"==typeof e[e.length-1]&&function AG(e){return t=>e(...t)}(e.pop()),n=(e=e.map(IG)).map(MG),r=e.length-1,i=new Array(r+1).fill(0),a=[];if(r<0||n.some(TG))return a;for(;;){a.push(i.map((d,p)=>e[p][d]));let c=r;for(;++i[c]===n[c];){if(0===c)return t?a.map(t):a;i[c--]=0}}}(i,a).map(([c,d],p)=>({x:c,y:d,i:p})):i?i.map((c,d)=>({x:c,i:d})):a?a.map((c,d)=>({y:c,i:d})):void 0}(E,e);if(void 0!==T){const Fe=p?VS(T,p):void 0;for(const de of d){if(null===de.facet||"super"===de.facet)continue;const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=null!=de.fx||null!=de.fy?VS(T,pe):Fe)}const le=new Set;for(const{facetsIndex:de}of v.values())de?.forEach((pe,Oe)=>{pe?.length>0&&le.add(Oe)});T.forEach(0de.empty=!le.has(pe):de=>de.empty=!1);for(const de of d)if("exclude"===de.facet){const pe=v.get(de);void 0!==pe&&(pe.facetsIndex=vte(pe.facetsIndex))}}for(const Fe of ii.keys())aS(e[Fe])&&"fx"!==Fe&&"fy"!==Fe&&E.set(Fe,[]);const P=new Map;for(const Fe of d){if(P.has(Fe))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:le,channels:de}=v.get(Fe)??{},{data:pe,facets:Oe,channels:Ye}=Fe.initialize(le,de);JS(Ye,e),P.set(Fe,{data:pe,facets:Oe,channels:Ye})}const N=TS(x_(E,P),e),G=W3(N),U=function pte(e,t,n={}){let r=.5-Qs,i=.5+Qs,a=.5+Qs,c=.5-Qs;for(const{marginTop:G,marginRight:U,marginBottom:Z,marginLeft:ne}of t)G>r&&(r=G),U>i&&(i=U),Z>a&&(a=Z),ne>c&&(c=ne);let{margin:d,marginTop:p=(void 0!==d?d:r),marginRight:v=(void 0!==d?d:i),marginBottom:E=(void 0!==d?d:a),marginLeft:D=(void 0!==d?d:c)}=n;p=+p,v=+v,E=+E,D=+D;let{width:T=640,height:P=mte(e,t,n,{width:T,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:a,marginLeftDefault:c})+Math.max(0,p-r+E-a)}=n;T=+T,P=+P;const N={width:T,height:P,marginTop:p,marginRight:v,marginBottom:E,marginLeft:D};if(e.fx||e.fy){let{margin:G,marginTop:U=(void 0!==G?G:p),marginRight:Z=(void 0!==G?G:v),marginBottom:ne=(void 0!==G?G:E),marginLeft:X=(void 0!==G?G:D)}=n.facet??{};U=+U,Z=+Z,ne=+ne,X=+X,N.facet={marginTop:U,marginRight:Z,marginBottom:ne,marginLeft:X}}return N}(N,d,e);!function Bee(e,t){const{x:n,y:r,fx:i,fy:a}=e,c=i||a?IS(t):t;i&&Y3(i,c),a&&K3(a,c);const d=i||a?X3(e,t):t;n&&Y3(n,d),r&&K3(r,d)}(N,U);const{fx:Z,fy:ne}=G,X=Z||ne?X3(N,U):U,re=Z||ne?function Zne({fx:e,fy:t},n){const{marginTop:r,marginRight:i,marginBottom:a,marginLeft:c,width:d,height:p}=IS(n),v=e&&n4(e),E=t&&n4(t);return{marginTop:t?E[0]:r,marginRight:e?d-v[1]:i,marginBottom:t?p-E[1]:a,marginLeft:e?v[0]:c,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:d,height:p}}(G,U):U,fe=CS(e,X),ve=new Set;for(const[Fe,le]of P)if(null!=Fe.initializer){const pe=Fe.initializer(le.data,le.facets,le.channels,G,"super"===Fe.facet?re:X,fe);if(void 0!==pe.data&&(le.data=pe.data),void 0!==pe.facets&&(le.facets=pe.facets),void 0!==pe.channels){zne(pe.channels),Object.assign(le.channels,pe.channels);for(const Ze of Object.values(pe.channels)){const{scale:et}=Ze;null!=et&&ii.get(et)!==Mc&&(Q5(Ze,e),ve.add(et))}const{fx:Oe,fy:Ye}=pe.channels;if(null!=Oe||null!=Ye){const Ze=v.get(Fe)??{channels:{}};null!=Oe&&(Ze.channels.fx=Oe),null!=Ye&&(Ze.channels.fy=Ye),Ze.groups=OS(le.data,Ze.channels),Ze.facetsIndex=le.facets=VS(T,Ze),v.set(Fe,Ze)}}}if(ve.size){const Fe=new Map;x_(Fe,P,pe=>ve.has(pe)),x_(E,P,pe=>ve.has(pe));const le=function qne(e,t){for(const n in e){const r=e[n],i=t[n];void 0===r.label&&i&&(r.label=i.label)}return e}(TS(Fe,e),N),de=W3(le);Object.assign(N,le),Object.assign(G,de)}for(const[Fe,le]of P)le.values=Fe.scale(le.channels,G,fe);const{width:Re,height:We}=U,Ke=ls("svg",fe).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",Re).attr("height",We).attr("viewBox",`0 0 ${Re} ${We}`).attr("aria-label",i).attr("aria-description",a).call(Fe=>Fe.append("style").text(`\n .${c} {\n display: block;\n background: white;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n }\n .${c} text,\n .${c} tspan {\n white-space: pre;\n }\n `)).call(RS,n).node();if(void 0!==T){const Fe={x:Z?.domain(),y:ne?.domain()};T.sort(function yte({x:e,y:t}){const n=e&&new Map(e.map((i,a)=>[i,a])),r=t&&new Map(t.map((i,a)=>[i,a]));return e&&t?(i,a)=>n.get(i.x)-n.get(a.x)||r.get(i.y)-r.get(a.y):e?(i,a)=>n.get(i.x)-n.get(a.x):(i,a)=>r.get(i.y)-r.get(a.y)}(Fe)),ZD(Ke).selectAll().data(T).enter().append("g").attr("aria-label","facet").attr("transform",function _te(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:a})=>`translate(${e(i)-r},${t(a)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}(Z,ne,U)).each(function(le){let de=!0;for(const pe of d){if("super"===pe.facet)continue;const{channels:Oe,values:Ye,facets:Ze}=P.get(pe);if(!(pe.facetAnchor?.(T,Fe,le)??!le.empty))continue;let et=null;if(Ze){if(et=Ze[v.has(pe)?le.i:0],et=pe.filter(et,Oe,Ye),0===et.length)continue;et.fi=le.i}const _t=pe.render(et,G,Ye,X,fe);null!=_t&&(de=!1,this.appendChild(_t))}de&&this.remove()})}for(const Fe of d){if(void 0!==T&&"super"!==Fe.facet)continue;const{channels:le,values:de,facets:pe}=P.get(Fe);let Oe=null;if(pe&&(Oe=pe[0],Oe=Fe.filter(Oe,le,de),0===Oe.length))continue;const Ye=Fe.render(Oe,G,de,re,fe);null!=Ye&&Ke.appendChild(Ye)}let lt=Ke;const Ue=function Fte(e,t,n){const r=[];for(const[i,a]of xx){const c=n[i];if(c?.legend&&i in e){const d=a(e[i],US(t,e[i],c),p=>e[p]);null!=d&&r.push(d)}}return r}(N,fe,e);if(null!=r||Ue.length>0){const{document:Fe}=fe;lt=Fe.createElement("figure"),lt.style.maxWidth="initial";for(const le of Ue)lt.appendChild(le);if(lt.appendChild(Ke),null!=r){const le=Fe.createElement("figcaption");le.appendChild(r instanceof Node?r:Fe.createTextNode(r)),lt.appendChild(le)}}lt.scale=function qee(e){return t=>{if(!ii.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return t in e?function i5({scale:e,type:t,domain:n,range:r,interpolate:i,interval:a,transform:c,percent:d,pivot:p}){if("identity"===t)return{type:"identity",apply:E=>E,invert:E=>E};const v=e.unknown?e.unknown():void 0;return{type:t,domain:sS(n),...void 0!==r&&{range:sS(r)},...void 0!==c&&{transform:c},...d&&{percent:d},...void 0!==v&&{unknown:v},...void 0!==a&&{interval:a},...void 0!==i&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...void 0!==p&&{pivot:p,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:E=>e(E),...e.invert&&{invert:E=>e.invert(E)}}}(e[t]):void 0}}(N),lt.legend=function kte(e,t,n={}){return(r,i)=>{if(!xx.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return xx.get(r)(e[r],US(t,n[r],i),a=>e[a])}}(N,fe,e);const st=function eee(){const e=xS;return xS=0,e}();return st>0&&ZD(Ke).append("text").attr("x",Re).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26a0\ufe0f").append("title").text(`${st.toLocaleString("en-US")} warning${1===st?"":"s"}. Please check the console.`),lt}function J5(e){return e.flat(1/0).filter(t=>null!=t).map(Lne)}function Lne(e){return"function"==typeof e.render?e:new Nne(e)}Ic.prototype.plot=function One({marks:e=[],...t}={}){return K5({...t,marks:[...e,this]})};class Nne extends Ic{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function JS(e,t){for(const n in e)Q5(e[n],t);return e}function Q5(e,t){const{scale:n}=e;if(null==n)return;const{type:r,percent:i,interval:a,transform:c=(i?d=>100*d:uS(a,r)?.floor)}=t[n]??{};null!=c&&(e.value=Go(e.value,c))}function zne(e){for(const t in e)S3(t,e[t])}function x_(e,t,n=yQ){for(const{channels:r}of t.values())for(const i in r){const a=r[i],{scale:c}=a;if(null!=c&&n(c)){const d=e.get(c);void 0!==d?d.push(a):e.set(c,[a])}}return e}function e4(e,t,n){if(null===e.facet||"super"===e.facet)return;const{fx:r,fy:i}=e;if(null!=r||null!=i){const p=Sc(e.data??r??i);if(void 0===p)throw new Error(`missing facet data in ${e.ariaLabel}`);if(null===p)return;const v={};return null!=r&&(v.fx=m_(p,{value:r,scale:"fx"})),null!=i&&(v.fy=m_(p,{value:i,scale:"fy"})),JS(v,n),{channels:v,groups:OS(p,v)}}if(void 0===t)return;const{channels:a,groups:c,data:d}=t;if("auto"!==e.facet||e.data===d)return{channels:a,groups:c};(c.size>1||1===c.size&&a.fx&&a.fy&&[...c][0][1].size>1)&&Sc(e.data)?.length===d.length&&Ef(`Warning: the ${e.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function Mx(e,t,n,r,i,a,c){if(!t)return;const d=function Une(e){return/^\s*both\s*$/i.test(e)}(t);c=function $ne(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:a,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:E,ariaDescription:D,label:T=t.label,labelAnchor:P,labelOffset:N}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:a,tickPadding:c,tickFormat:d,tickRotate:p,fontVariant:v,ariaLabel:E,ariaDescription:D,label:T,labelAnchor:P,labelOffset:N}}(d?r:t,a,c);const{line:p}=c;(n===U5||n===$5)&&p&&!f_(p)&&e.push(function Fne(e){return new Rne(e)}(function jne(e){const{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:!0===n?void 0:n}}(c))),e.push(n(c)),d&&e.push(n({...c,anchor:i,label:null}))}function Tx(e,t,n,r){!t||f_(t)||e.push(n(function Hne(e,{stroke:t=(ax(e)?e:void 0),ticks:n=(Gne(e)?e:void 0),tickSpacing:r,ariaLabel:i,ariaDescription:a}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:a}}(t,r)))}function Gne(e){switch(typeof e){case"number":return!0;case"string":return!ax(e)}return Vh(e)||"function"==typeof e?.range}function Ix(e,t){const n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function t4(e,t){for(const n of t)for(const r in n.channels)if(n.channels[r].scale===e)return!0;return!1}function n4(e){const t=e.domain();let n=e(t[0]),r=e(t[t.length-1]);return rre.selectAll().data(t).enter().append(ne?"circle":"path").call(Mf,this).call(ne?fe=>{fe.attr("cx",p?ve=>p[ve]:U).attr("cy",v?ve=>v[ve]:Z).attr("r",E?ve=>E[ve]:P)}:fe=>{fe.attr("transform",WS`translate(${p?ve=>p[ve]:U},${v?ve=>v[ve]:Z})${D?ve=>` rotate(${D[ve]})`:N?` rotate(${N})`:""}`).attr("d",E&&T?ve=>{const Re=_f();return T[ve].draw(Re,E[ve]*E[ve]*Math.PI),Re}:E?ve=>{const Re=_f();return G.draw(Re,E[ve]*E[ve]*Math.PI),Re}:T?ve=>{const Re=_f();return T[ve].draw(Re,X),Re}:(()=>{const ve=_f();return G.draw(ve,X),ve})())}).call(v_,this,r)).node()}}function Ax(e,t={}){let{x:n,y:r,...i}=t;return void 0===t.frameAnchor&&([n,r]=lS(n,r)),new QS(e,{...i,x:n,y:r})}const Yne=new Map([["basis",function OJ(e){return new ex(e)}],["basis-closed",function LJ(e){return new GN(e)}],["basis-open",function NJ(e){return new qN(e)}],["bundle",UJ],["bump-x",function BJ(e){return new ZN(e,!0)}],["bump-y",function VJ(e){return new ZN(e,!1)}],["cardinal",$J],["cardinal-closed",jJ],["cardinal-open",HJ],["catmull-rom",GJ],["catmull-rom-closed",qJ],["catmull-rom-open",ZJ],["linear",Yb],["linear-closed",function WJ(e){return new JN(e)}],["monotone-x",function XJ(e){return new nx(e)}],["monotone-y",function YJ(e){return new n3(e)}],["natural",function KJ(e){return new i3(e)}],["step",function JJ(e){return new rx(e,.5)}],["step-after",function eQ(e){return new rx(e,1)}],["step-before",function QJ(e){return new rx(e,0)}]]);function kx(e){return Yb(e)}function e2(e){if(null==e||!1===e)return null;if(!0===e)return r4;if("function"==typeof e)return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return ere;case"dot":return tre;case"circle":case"circle-fill":return r4;case"circle-stroke":return nre}throw new Error(`invalid marker: ${e}`)}function ere(e,t){return ls("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient","auto").attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(n=>n.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function tre(e,t){return ls("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function r4(e,t){return ls("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","white").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function nre(e,t){return ls("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","white").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}let rre=0;function ire(e,t,{stroke:n},r){return function i4(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},a=(()=>i),c){const d=new Map;function p(v){return function(E){const D=a(E);let T=d.get(v);T||d.set(v,T=new Map);let P=T.get(D);if(!P){const N=this.parentNode.insertBefore(v(D,c),this),G="plot-marker-"+ ++rre;N.setAttribute("id",G),T.set(D,P=`url(#${G})`)}return P}}t&&e.attr("marker-start",p(t)),n&&e.attr("marker-mid",p(n)),r&&e.attr("marker-end",p(r))}(e,t,n&&(([i])=>n[i]),r)}const ore={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class t2 extends Ic{constructor(t,n={}){const{x:r,y:i,z:a,curve:c,tension:d}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:m3(n),optional:!0}},n,ore),this.z=a,this.curve=function Jne(e=kx,t){return"function"!=typeof e&&"auto"===`${e}`.toLowerCase()?kx:function Kne(e=Yb,t){if("function"==typeof e)return e;const n=Yne.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(void 0!==t){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}(e,t)}(c,d),function Qne(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=e2(n),e.markerMid=e2(r),e.markerEnd=e2(i)}(this,n)}filter(t){return t}project(t,n,r){this.curve!==kx&&super.project(t,n,r)}render(t,n,r,i,a){const{x:c,y:d}=r,{curve:p}=this;return ls("svg:g",a).call(Sf,this,i,a).call(Tf,this,n).call(v=>v.selectAll().data(function*cte(e,t,{z:n},r){const{z:i}=r,a=function ate({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:a,strokeWidth:c,opacity:d,href:p}){return[e,t,n,r,i,a,c,d,p].filter(v=>void 0!==v)}(r),c=[...t,...a];for(const d of i?function lte(e,t,n){const r=XP(e,i=>t[i]);return void 0===n&&r.size>e.length>>1&&Ef("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}(e,i,n):[e]){let p,v;e:for(const E of d){for(const D of c)if(!Dl(D[E])){v&&v.push(-1);continue e}if(void 0!==p){v.push(E);for(let D=0;DcS(P[E])),v=[E];continue e}}else v&&(yield v),p=a.map(D=>cS(D[E])),v=[E]}v&&(yield v)}}(t,[c,d],this,r)).enter().append("path").call(Mf,this).call(ste,this,r).call(ire,this,r,a).attr("d",p===kx&&a.projection?function sre(e,t,n){const r=iD(e);return t=ox(t),n=ox(n),i=>{let a=[];const c=[a];for(const d of i)-1===d?(a=[],c.push(a)):a.push([t[d],n[d]]);return r({type:"MultiLineString",coordinates:c})}}(a.projection,c,d):function DJ(e,t){var n=Cm(!0),r=null,i=Yb,a=null,c=function wJ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Rb(t)}(d);function d(p){var v,D,P,E=(p=function xJ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(p)).length,T=!1;for(null==r&&(a=i(P=c())),v=0;v<=E;++v)!(vE>=0).x(E=>c[E]).y(E=>d[E]))).node()}}function o4(e,t={}){let{x:n,y:r,...i}=t;return[n,r]=lS(n,r),new t2(e,{...i,x:n,y:r})}function are(e,t={}){return s4(Object.fromEntries(["y","y1","y2"].filter(n=>null!=t[n]).map(n=>[n,e])),t)}const s4=function lre(e={},t={}){const n=m3(t),r=Object.entries(e).map(([i,a])=>{const c=function bQ(e,t){if(void 0!==t[e])return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y"}return t[e]}(i,t);if(null==c)throw new Error(`missing channel: ${i}`);const[d,p]=function g3(e){let t;return[{transform:()=>t,label:h_(e)},n=>t=n]}(c);return{key:i,input:c,output:d,setOutput:p,map:cre(a)}});return{...$S(t,(i,a)=>{const c=Dc(i,n),d=r.map(({input:v})=>Dc(i,v)),p=r.map(({setOutput:v})=>v(new Array(i.length)));for(const v of a)for(const E of c?XP(v,D=>c[D]).values():[v])r.forEach(({map:D},T)=>D.mapIndex(E,d[T],p[T]));return{data:i,facets:a}}),...Object.fromEntries(r.map(({key:i,output:a})=>[i,a]))}};function cre(e){if(null==e)throw new Error("missing map");if("function"==typeof e.mapIndex)return e;if("function"==typeof e.map&&Im(e))return function ure(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}(e);if("function"==typeof e)return n2(e);switch(`${e}`.toLowerCase()){case"cumsum":return dre;case"rank":return n2(nR);case"quantile":return n2(hre)}throw new Error(`invalid map: ${e}`)}function hre(e){const t=function SG(e,t){let n=0;if(void 0===t)for(let r of e)null!=r&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(i=+i)>=i&&++n}return n}(e)-1;return nR(e).map(n=>n/t)}function n2(e){return{mapIndex(t,n,r){const i=e(km(n,t));if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let a=0,c=t.length;a0))throw new Error(`invalid k: ${t}`);return function mre(e="mean"){if("string"==typeof e){if(/^p\d{2}$/i.test(e))return Px(f3(e));switch(e.toLowerCase()){case"deviation":return Px(GP);case"max":return Rx(Xs);case"mean":return gre;case"median":return Px(z0);case"min":return Rx(uf);case"mode":return Rx(eR);case"sum":return c4;case"variance":return Px(fE);case"difference":return vre;case"ratio":return bre;case"first":return xre;case"last":return wre}}if("function"!=typeof e)throw new Error(`invalid reduce: ${e}`);return Rx(e)}(n)(t,function fre(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}(i,t),a)}function r2(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Px(e){return(t,n,r)=>r?{mapIndex(i,a,c){const d=Float64Array.from(i,v=>null===a[v]?NaN:a[v]);let p=0;for(let v=0;vnull===a[p]?NaN:a[p]);for(let p=-n;p<0;++p)c[i[p+n]]=e(d.subarray(0,p+t));for(let p=0,v=i.length-n;pr?{mapIndex(i,a,c){let d=0;for(let p=0;p=n;--i){const a=e[t[i]];if(Dl(a))return a}}function u4(e,t,n,r){for(let i=n+r;n=n;--i){let a=e[t[i]];if(null!==a&&!isNaN(a=+a))return a}}function vre(e,t,n){return n?{mapIndex(r,i,a){for(let c=0,d=r.length-e;c{class e{constructor(){this.device={},this.cameraBearing=0,this.enableRotation=!1}ngOnInit(){}ngOnChanges(){this.addMarkerForDevice(this.device,this.map)}ngAfterViewInit(){this.map||(this.map=new Fx.Map({container:this.mapContainer.nativeElement,style:"https://pax.lab5e.com/map/styles/basic.json",center:[10.14,63.42],zoom:3,maxBounds:[[9.78,63.17],[10.97,63.56]]}),this.map.addControl(new Fx.NavigationControl),this.map.addControl(new Fx.AttributionControl({compact:!1,customAttribution:"Style \xa9 MapTiler | Data \xa9 OpenStreetMap contributors"})),this.addMarkerForDevice(this.device,this.map))}ngOnDestroy(){this.enableRotation=!1,this.map?.remove()}addMarkerForDevice(n,r){if(!(n&&r&&n.lat&&0!=n.lat&&n.lon&&0!=n.lon))return;let i=n.lat,a=n.lon,c=new Fx.Marker({color:"#ff0000"});c.setLngLat([i,a]),c.addTo(this.map),this.enableRotation&&(this.enableRotation=!1,this.cameraBearing=0),this.map?.flyTo({center:[i,a],zoom:16,pitch:45,bearing:0,speed:1,curve:1,easing:p=>p,essential:!0});let d=p=>{!this.enableRotation||(r.rotateTo(this.cameraBearing,{duration:0}),this.cameraBearing+=.25,this.cameraBearing>=360&&(this.cameraBearing=0),requestAnimationFrame(d))};this.map?.on("click",()=>{this.enableRotation=!1}),this.map?.once("moveend",()=>{this.enableRotation=!0,d(0)})}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=zs({type:e,selectors:[["app-device-map-view"]],viewQuery:function(n,r){if(1&n&&Fv(Cre,5),2&n){let i;$p(i=jp())&&(r.mapContainer=i.first)}},inputs:{device:"device"},features:[yt],decls:2,vars:0,consts:[[1,"map"],["map",""]],template:function(n,r){1&n&&xa(0,"div",0,1)},styles:[".map[_ngcontent-%COMP%]{overflow:hidden;border-radius:1em;border:solid 1px silver;width:100%;height:100%}"]}),e})();const Dre=["chart"];function Sre(e,t){if(1&e&&(jn(0,"div",8)(1,"div",9),zr(2),Wn(),jn(3,"div",10),zr(4),Wn()()),2&e){const n=t.$implicit;kr(2),Sh(n.bigText),kr(2),Sh(n.smallText)}}let Mre=(()=>{class e{constructor(n,r){this.paxService=n,this.renderer=r,this.device={},this.metrics=[],this.data=[],this.errorMessage="",this.lastPoll=new Date,this.chartIntervalHours=24}ngOnInit(){}ngAfterViewInit(){}ngOnChanges(n){this.loadData()}loadData(){let n=""+((new Date).getTime()-3600*this.chartIntervalHours*1e3),r=""+(new Date).getTime();this.paxService.paxServiceListData(n,r,19e6).subscribe({next:i=>{i.data&&i.data.forEach((a,c)=>{a.deviceId==this.device.id&&(this.data=a.samples?.map(d=>({time:new Date(parseInt(d.timestamp)),ble:d.bluetoothCount||0,wifi:d.wifiCount||0}))||[])})},error:i=>{this.errorMessage=i.message},complete:()=>{this.buildMetrics(),this.lastPoll=new Date,this.showChart()}})}showChart(){this.chart&&this.renderer.removeChild(this.chartRef?.nativeElement,this.chart,!1);let n=this.chartRef?.nativeElement.offsetWidth,r=this.chartRef?.nativeElement.height,i=uf(this.data,c=>c.time),a=Xs(this.data,c=>c.time);this.chart=K5({width:n,height:r,margin:50,inset:5,y:{grid:!0,label:"Antall"},x:{label:"Klokkeslett",grid:!0,tickFormat:s_("%H:%M"),domain:[i,a]},marks:[Ax(this.data,{x:c=>c.time,y:"ble",stroke:"blue",opacity:.2}),o4(this.data,a4({reduce:"mean",k:7,anchor:"middle"},{x:"time",y:"ble",stroke:"blue",strokeWidth:2,opacity:.8})),Ax(this.data,{x:"time",y:"wifi",stroke:"red",opacity:.3}),o4(this.data,a4({reduce:"mean",k:7,anchor:"middle"},{x:"time",y:"wifi",stroke:"red",strokeWidth:2,opacity:.9}))],color:{legend:!0,domain:["wifi","ble"],range:["red","blue"]},style:{fontFamily:"sans-serif",fontSize:"10pt",background:"#eeeeee",fill:"#808080",border:"solid 1px silver"}}),this.renderer.appendChild(this.chartRef?.nativeElement,this.chart)}buildMetrics(){let n=Xs(this.data,p=>p.ble)||0,r=Xs(this.data,p=>p.wifi)||0,i="Rolig",a=this.data.length-1,d=Math.round(100*(this.data[a].ble+this.data[a].wifi)/(n+r));d>=80&&(i="Sv\xe6rt h\xf8y"),d>=60&&d<80&&(i="H\xf8y"),d>=40&&d<60&&(i="Normal"),d>=25&&d<40&&(i="Lav"),d<25&&(i="Sv\xe6rt Lav"),this.metrics=[{bigText:String(n),smallText:"Maks antall BLE"},{bigText:String(r),smallText:"Maks antall WiFi"},{bigText:String(this.data.length),smallText:"M\xe5linger i perioden"},{bigText:i,smallText:"Folketetthet ("+d+"% av maks)"}]}}return e.\u0275fac=function(n){return new(n||e)(qe(Dy),qe(sc))},e.\u0275cmp=zs({type:e,selectors:[["app-device-view"]],viewQuery:function(n,r){if(1&n&&Fv(Dre,5),2&n){let i;$p(i=jp())&&(r.chartRef=i.first)}},inputs:{device:"device"},features:[yt],decls:10,vars:6,consts:[[1,"device-status-page"],[1,"data"],["id","chart",1,"chart"],["chart",""],[1,"device-info"],["class","metric",4,"ngFor","ngForOf"],[1,"location"],[3,"device"],[1,"metric"],[1,"metric-value"],[1,"metric-desc"]],template:function(n,r){1&n&&(jn(0,"div",0)(1,"div",1),xa(2,"div",2,3),zr(4),kv(5,"date"),Wn(),jn(6,"div",4),Dh(7,Sre,5,2,"div",5),Wn(),jn(8,"div",6),xa(9,"app-device-map-view",7),Wn()()),2&n&&(kr(4),Kd(" Sist oppdatert ",Pv(5,3,r.lastPoll,"YYYY-mm-dd HH:MM")," "),kr(3),Co("ngForOf",r.metrics),kr(2),Co("device",r.device))},dependencies:[n0,Ere,gC],styles:[".device-status-page[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);grid-row-gap:10px;grid-column-gap:10px;height:100%}.device-info[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:1fr 1fr;grid-column-gap:1em;grid-row-gap:1em}.info-title[_ngcontent-%COMP%]{font-size:24pt;color:#005aa7;grid-column:span 2;text-align:center}.metric[_ngcontent-%COMP%]{background-color:#2696f9;color:#fff;border-radius:1em;display:grid;grid-template-columns:1fr;grid-template-rows:3fr 1fr}.metric-value[_ngcontent-%COMP%]{font-size:6vh;text-align:center;margin-top:auto;margin-bottom:auto}.metric-desc[_ngcontent-%COMP%]{font-size:1vw;text-align:center}.location[_ngcontent-%COMP%]{background-color:#ddd;border-radius:1em}.data[_ngcontent-%COMP%]{grid-column:span 2;vertical-align:middle}#chart[_ngcontent-%COMP%]{display:flex}#chart[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{flex:1}"]}),e})();const d4=function(e){return{active:e}};function Tre(e,t){if(1&e){const n=function BM(){return He()}();jn(0,"div",6),Ri("click",function(){const a=function Zl(e){return Vt.lFrame.contextLView=e,e[8]}(n).$implicit;return function el(e){return Vt.lFrame.contextLView=null,e}(qg().setActiveDevice(a))}),jn(1,"div",7),zr(2),Wn(),jn(3,"div",8),zr(4),Wn()()}if(2&e){const n=t.$implicit,r=qg();Co("ngClass",ef(3,d4,r.activeDevice==n)),kr(2),Kd(" ",n.name," "),kr(2),Kd(" Id: ",n.id," ")}}function Ire(e,t){1&e&&xa(0,"app-main-chart")}function Are(e,t){1&e&&xa(0,"app-device-view",13),2&e&&Co("device",qg().activeDevice)}let kre=(()=>{class e{constructor(n){this.paxService=n,this.devices=[],n.paxServiceListDevices().subscribe({next:r=>{r.devices&&(this.devices=r.devices,this.devices.forEach(i=>{"17dj5j4ce8bkbg"==i.id&&(this.activeDevice=i)}))},error:r=>{console.error(r)},complete:()=>{}})}ngOnInit(){}setActiveDevice(n){this.activeDevice=n}}return e.\u0275fac=function(n){return new(n||e)(qe(Dy))},e.\u0275cmp=zs({type:e,selectors:[["app-main-page"]],decls:16,vars:6,consts:[[1,"page"],[1,"heading"],[1,"logo"],[1,"title"],[1,"content"],[1,"list"],[1,"list-item",3,"ngClass","click"],[1,"item-title"],[1,"item-subtitle"],["class","list-item",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"detail"],[4,"ngIf"],[3,"device",4,"ngIf"],[3,"device"]],template:function(n,r){1&n&&(jn(0,"div",0)(1,"div",1),xa(2,"span",2),jn(3,"span",3),zr(4," PAX "),Wn()(),jn(5,"div",4)(6,"div",5)(7,"div",6),Ri("click",function(){return r.setActiveDevice()}),jn(8,"div",7),zr(9," Alle "),Wn(),jn(10,"div",8),zr(11," Vis aggregerte data for alle tellere "),Wn()(),Dh(12,Tre,5,5,"div",9),Wn(),jn(13,"div",10),Dh(14,Ire,1,0,"app-main-chart",11),Dh(15,Are,1,1,"app-device-view",12),Wn()()()),2&n&&(kr(7),Co("ngClass",ef(4,d4,null==r.activeDevice)),kr(5),Co("ngForOf",r.devices),kr(2),Co("ngIf",null==r.activeDevice),kr(1),Co("ngIf",null!=r.activeDevice))},dependencies:[dC,n0,fC,DG,Mre],styles:[".page[_ngcontent-%COMP%]{margin:0;padding:0;width:100vw;height:100vh;background-color:#eee;display:flex;flex-direction:column}.heading[_ngcontent-%COMP%]{color:#fff;background-color:#009bdf;height:5em;padding:1em}.heading[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:24pt}.content[_ngcontent-%COMP%]{height:calc(100vh - 5em);background-color:gray;display:flex;flex-direction:row}.list[_ngcontent-%COMP%]{direction:rtl;width:20em;min-height:100%;background-color:#ddd;display:flex;flex-direction:column;overflow-y:auto}.list-item[_ngcontent-%COMP%]{direction:ltr;width:100%;height:6em!important}.list-item[_ngcontent-%COMP%]:not(.active){border-bottom:solid 1px #cccccc}.list-item[_ngcontent-%COMP%]:hover:not(.active){background-color:#80add3;cursor:pointer}.active[_ngcontent-%COMP%]{background-color:#eee;color:#000;box-shadow:10px 5px 5px silver}.item-title[_ngcontent-%COMP%]{font-size:14pt;margin-top:1em;margin-left:1em}.item-subtitle[_ngcontent-%COMP%]{font-size:10pt;color:gray;margin-top:.5em;margin-left:2em;margin-bottom:1em;font-weight:light}.detail[_ngcontent-%COMP%]{background-color:#eee;flex:auto 1;padding:1em}"]}),e})(),Pre=(()=>{class e{constructor(n){this.paxService=n,this.title="PAX",this.paxService.configuration.basePath="https://pax.lab5e.com"}}return e.\u0275fac=function(n){return new(n||e)(qe(Dy))},e.\u0275cmp=zs({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(n,r){1&n&&xa(0,"app-main-page")},dependencies:[kre]}),e})(),nz=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({}),e})();const v2=new Tt("NgModelWithFormControlWarning");let vz=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({imports:[nz]}),e})(),Pie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({imports:[vz]}),e})(),Rie=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:v2,useValue:n.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({imports:[vz]}),e})(),Bie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e}),e.\u0275inj=Di({imports:[jA]}),e})(),Vie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=li({type:e,bootstrap:[Pre]}),e.\u0275inj=Di({imports:[_9,oG,Pie,Rie,_G,Bie]}),e})();(function OU(){hA=!1})(),y9().bootstrapModule(Vie).catch(e=>console.error(e))},943:function(Lm){Lm.exports=function(){"use strict";var Au,ku,ar;function qh(b,wr){if(Au)if(ku){var ks="var sharedChunk = {}; ("+Au+")(sharedChunk); ("+ku+")(sharedChunk);",us={};Au(us),ar=wr(us),typeof window<"u"&&(ar.workerUrl=window.URL.createObjectURL(new Blob([ks],{type:"text/javascript"})))}else ku=wr;else Au=wr}return qh(0,function(b){var wr=ks;function ks(l,o,u,f){this.cx=3*l,this.bx=3*(u-l)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*o,this.by=3*(f-o)-this.cy,this.ay=1-this.cy-this.by,this.p1x=l,this.p1y=o,this.p2x=u,this.p2y=f}function us(l,o,u,f){const _=new wr(l,o,u,f);return function(x){return _.solve(x)}}ks.prototype={sampleCurveX:function(l){return((this.ax*l+this.bx)*l+this.cx)*l},sampleCurveY:function(l){return((this.ay*l+this.by)*l+this.cy)*l},sampleCurveDerivativeX:function(l){return(3*this.ax*l+2*this.bx)*l+this.cx},solveCurveX:function(l,o){if(void 0===o&&(o=1e-6),l<0)return 0;if(l>1)return 1;for(var u=l,f=0;f<8;f++){var _=this.sampleCurveX(u)-l;if(Math.abs(_)_?C=u:M=u,u=.5*(M-C)+C;return u},solve:function(l,o){return this.sampleCurveY(this.solveCurveX(l,o))}};const Il=us(.25,.1,.25,1);function Zt(l,o,u){return Math.min(u,Math.max(o,l))}function Ie(l,o,u){const f=u-o,_=((l-o)%f+f)%f+o;return _===o?u:_}function Bi(l,...o){for(const u of o)for(const f in u)l[f]=u[f];return l}let Ps=1;function Rs(l,o){l.forEach(u=>{o[u]&&(o[u]=o[u].bind(o))})}function Pa(l,o,u){const f={};for(const _ in l)f[_]=o.call(u||this,l[_],_,l);return f}function Al(l,o,u){const f={};for(const _ in l)o.call(u||this,l[_],_,l)&&(f[_]=l[_]);return f}function Ci(l){return Array.isArray(l)?l.map(Ci):"object"==typeof l&&l?Pa(l,Ci):l}const io={};function fn(l){io[l]||(typeof console<"u"&&console.warn(l),io[l]=!0)}function si(l,o,u){return(u.y-l.y)*(o.x-l.x)>(o.y-l.y)*(u.x-l.x)}function kc(l){let o=0;for(let u,f,_=0,x=l.length,C=x-1;_cancelAnimationFrame(o)}},getImageData(l,o=0){return this.getImageCanvasContext(l).getImageData(-o,-o,l.width+2*o,l.height+2*o)},getImageCanvasContext(l){const o=window.document.createElement("canvas"),u=o.getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("failed to create canvas 2d context");return o.width=l.width,o.height=l.height,u.drawImage(l,0,0,l.width,l.height),u},resolveURL:l=>(hs||(hs=document.createElement("a")),hs.href=l,hs.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==Gn&&(Gn=matchMedia("(prefers-reduced-motion: reduce)")),Gn.matches)}};var It=Wr;function Wr(l,o){this.x=l,this.y=o}Wr.prototype={clone:function(){return new Wr(this.x,this.y)},add:function(l){return this.clone()._add(l)},sub:function(l){return this.clone()._sub(l)},multByPoint:function(l){return this.clone()._multByPoint(l)},divByPoint:function(l){return this.clone()._divByPoint(l)},mult:function(l){return this.clone()._mult(l)},div:function(l){return this.clone()._div(l)},rotate:function(l){return this.clone()._rotate(l)},rotateAround:function(l,o){return this.clone()._rotateAround(l,o)},matMult:function(l){return this.clone()._matMult(l)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(l){return this.x===l.x&&this.y===l.y},dist:function(l){return Math.sqrt(this.distSqr(l))},distSqr:function(l){var o=l.x-this.x,u=l.y-this.y;return o*o+u*u},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith:function(l){return this.angleWithSep(l.x,l.y)},angleWithSep:function(l,o){return Math.atan2(this.x*o-this.y*l,this.x*l+this.y*o)},_matMult:function(l){var o=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=o,this},_add:function(l){return this.x+=l.x,this.y+=l.y,this},_sub:function(l){return this.x-=l.x,this.y-=l.y,this},_mult:function(l){return this.x*=l,this.y*=l,this},_div:function(l){return this.x/=l,this.y/=l,this},_multByPoint:function(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint:function(l){return this.x/=l.x,this.y/=l.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var l=this.y;return this.y=this.x,this.x=-l,this},_rotate:function(l){var o=Math.cos(l),u=Math.sin(l),f=u*this.x+o*this.y;return this.x=o*this.x-u*this.y,this.y=f,this},_rotateAround:function(l,o){var u=Math.cos(l),f=Math.sin(l),_=o.y+f*(this.x-o.x)+u*(this.y-o.y);return this.x=o.x+u*(this.x-o.x)-f*(this.y-o.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Wr.convert=function(l){return l instanceof Wr?l:Array.isArray(l)?new Wr(l[0],l[1]):l};const Fa={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,REGISTERED_PROTOCOLS:{}};class Os extends Error{constructor(o,u,f,_){super(`AJAXError: ${u} (${o}): ${f}`),this.status=o,this.statusText=u,this.url=f,this.body=_}}const Bn=To()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function Pc(l,o){const u=new AbortController,f=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,referrer:Bn(),signal:u.signal});let _=!1,x=!1;return"json"===l.type&&f.headers.set("Accept","application/json"),x||fetch(f).then(C=>{return C.ok?(M=C,void("arrayBuffer"===l.type?M.arrayBuffer():"json"===l.type?M.json():M.text()).then(A=>{x||(_=!0,o(null,A,M.headers.get("Cache-Control"),M.headers.get("Expires")))}).catch(A=>{x||o(new Error(A.message))})):C.blob().then(M=>o(new Os(C.status,C.statusText,l.url,M)));var M}).catch(C=>{20!==C.code&&o(new Error(C.message))}),{cancel:()=>{x=!0,_||u.abort()}}}const kl=function(l,o){if(/:\/\//.test(l.url)&&!/^https?:|^file:/.test(l.url)){if(To()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,o);if(!To()){const f=l.url.substring(0,l.url.indexOf("://"));return(Fa.REGISTERED_PROTOCOLS[f]||Pc)(l,o)}}if(!(/^file:/.test(u=l.url)||/^file:/.test(Bn())&&!/^\w+:/.test(u))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Pc(l,o);if(To()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",l,o,void 0,!0)}var u;return function(f,_){const x=new XMLHttpRequest;x.open(f.method||"GET",f.url,!0),"arrayBuffer"===f.type&&(x.responseType="arraybuffer");for(const C in f.headers)x.setRequestHeader(C,f.headers[C]);return"json"===f.type&&(x.responseType="text",x.setRequestHeader("Accept","application/json")),x.withCredentials="include"===f.credentials,x.onerror=()=>{_(new Error(x.statusText))},x.onload=()=>{if((x.status>=200&&x.status<300||0===x.status)&&null!==x.response){let C=x.response;if("json"===f.type)try{C=JSON.parse(x.response)}catch(M){return _(M)}_(null,C,x.getResponseHeader("Cache-Control"),x.getResponseHeader("Expires"))}else{const C=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});_(new Os(x.status,x.statusText,f.url,C))}},x.send(f.body),{cancel:()=>x.abort()}}(l,o)},Oa=function(l,o){return kl(Bi(l,{type:"arrayBuffer"}),o)};function Rc(l){const o=window.document.createElement("a");return o.href=l,o.protocol===window.document.location.protocol&&o.host===window.document.location.host}function pi(l,o,u){u[l]&&-1!==u[l].indexOf(o)||(u[l]=u[l]||[],u[l].push(o))}function La(l,o,u){if(u&&u[l]){const f=u[l].indexOf(o);-1!==f&&u[l].splice(f,1)}}class na{constructor(o,u={}){Bi(this,u),this.type=o}}class yr extends na{constructor(o,u={}){super("error",Bi({error:o},u))}}class tr{on(o,u){return this._listeners=this._listeners||{},pi(o,u,this._listeners),this}off(o,u){return La(o,u,this._listeners),La(o,u,this._oneTimeListeners),this}once(o,u){return u?(this._oneTimeListeners=this._oneTimeListeners||{},pi(o,u,this._oneTimeListeners),this):new Promise(f=>this.once(o,f))}fire(o,u){"string"==typeof o&&(o=new na(o,u||{}));const f=o.type;if(this.listens(f)){o.target=this;const _=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const M of _)M.call(this,o);const x=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const M of x)La(f,M,this._oneTimeListeners),M.call(this,o);const C=this._eventedParent;C&&(Bi(o,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),C.fire(o))}else o instanceof yr&&console.error(o.error);return this}listens(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)}setEventedParent(o,u){return this._eventedParent=o,this._eventedParentData=u,this}}var Ae={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Pe{constructor(o,u,f,_){this.message=(o?`${o}: `:"")+f,_&&(this.identifier=_),null!=u&&u.__line__&&(this.line=u.__line__)}}function Na(l){const o=l.value;return o?[new Pe(l.key,o,"constants have been deprecated as of v8")]:[]}function Vi(l,...o){for(const u of o)for(const f in u)l[f]=u[f];return l}function Vn(l){return l instanceof Number||l instanceof String||l instanceof Boolean?l.valueOf():l}function ds(l){if(Array.isArray(l))return l.map(ds);if(l instanceof Object&&!(l instanceof Number||l instanceof String||l instanceof Boolean)){const o={};for(const u in l)o[u]=ds(l[u]);return o}return Vn(l)}class Ui extends Error{constructor(o,u){super(u),this.message=u,this.key=o}}class Pl{constructor(o,u=[]){this.parent=o,this.bindings={};for(const[f,_]of u)this.bindings[f]=_}concat(o){return new Pl(this,o)}get(o){if(this.bindings[o])return this.bindings[o];if(this.parent)return this.parent.get(o);throw new Error(`${o} not found in scope.`)}has(o){return!!this.bindings[o]||!!this.parent&&this.parent.has(o)}}const fs={kind:"null"},rt={kind:"number"},Jt={kind:"string"},jt={kind:"boolean"},so={kind:"color"},ps={kind:"object"},At={kind:"value"},Ls={kind:"collator"},Ei={kind:"formatted"},ra={kind:"padding"},ao={kind:"resolvedImage"};function $i(l,o){return{kind:"array",itemType:l,N:o}}function Nn(l){if("array"===l.kind){const o=Nn(l.itemType);return"number"==typeof l.N?`array<${o}, ${l.N}>`:"value"===l.itemType.kind?"array":`array<${o}>`}return l.kind}const Fc=[fs,rt,Jt,jt,so,Ei,ps,$i(At),ra,ao];function lo(l,o){if("error"===o.kind)return null;if("array"===l.kind){if("array"===o.kind&&(0===o.N&&"value"===o.itemType.kind||!lo(l.itemType,o.itemType))&&("number"!=typeof l.N||l.N===o.N))return null}else{if(l.kind===o.kind)return null;if("value"===l.kind)for(const u of Fc)if(!lo(u,o))return null}return`Expected ${Nn(l)} but found ${Nn(o)} instead.`}function Rl(l,o){return o.some(u=>u.kind===l.kind)}function pn(l,o){return o.some(u=>"null"===u?null===l:"array"===u?Array.isArray(l):"object"===u?l&&!Array.isArray(l)&&"object"==typeof l:u===typeof l)}var ia,Oc={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function za(l){return(l=Math.round(l))<0?0:l>255?255:l}function Ru(l){return za("%"===l[l.length-1]?parseFloat(l)/100*255:parseInt(l))}function oa(l){return(o="%"===l[l.length-1]?parseFloat(l)/100:parseFloat(l))<0?0:o>1?1:o;var o}function Ba(l,o,u){return u<0?u+=1:u>1&&(u-=1),6*u<1?l+(o-l)*u*6:2*u<1?o:3*u<2?l+(o-l)*(2/3-u)*6:l}try{ia={}.parseCSSColor=function(l){var o,u=l.replace(/ /g,"").toLowerCase();if(u in Oc)return Oc[u].slice();if("#"===u[0])return 4===u.length?(o=parseInt(u.substr(1),16))>=0&&o<=4095?[(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,1]:null:7===u.length&&(o=parseInt(u.substr(1),16))>=0&&o<=16777215?[(16711680&o)>>16,(65280&o)>>8,255&o,1]:null;var f=u.indexOf("("),_=u.indexOf(")");if(-1!==f&&_+1===u.length){var x=u.substr(0,f),C=u.substr(f+1,_-(f+1)).split(","),M=1;switch(x){case"rgba":if(4!==C.length)return null;M=oa(C.pop());case"rgb":return 3!==C.length?null:[Ru(C[0]),Ru(C[1]),Ru(C[2]),M];case"hsla":if(4!==C.length)return null;M=oa(C.pop());case"hsl":if(3!==C.length)return null;var A=(parseFloat(C[0])%360+360)%360/360,F=oa(C[1]),O=oa(C[2]),B=O<=.5?O*(F+1):O+F-O*F,H=2*O-B;return[za(255*Ba(H,B,A+1/3)),za(255*Ba(H,B,A)),za(255*Ba(H,B,A-1/3)),M];default:return null}}return null}}catch{}class Sn{constructor(o,u,f,_=1){this.r=o,this.g=u,this.b=f,this.a=_}static parse(o){if(!o)return;if(o instanceof Sn)return o;if("string"!=typeof o)return;const u=ia(o);return u?new Sn(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3]):void 0}toString(){const[o,u,f,_]=this.toArray();return`rgba(${Math.round(o)},${Math.round(u)},${Math.round(f)},${_})`}toArray(){const{r:o,g:u,b:f,a:_}=this;return 0===_?[0,0,0,0]:[255*o/_,255*u/_,255*f/_,_]}}Sn.black=new Sn(0,0,0,1),Sn.white=new Sn(1,1,1,1),Sn.transparent=new Sn(0,0,0,0),Sn.red=new Sn(1,0,0,1);class Fl{constructor(o,u,f){this.sensitivity=o?u?"variant":"case":u?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(o,u){return this.collator.compare(o,u)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class co{constructor(o,u,f,_,x){this.text=o,this.image=u,this.scale=f,this.fontStack=_,this.textColor=x}}class Xr{constructor(o){this.sections=o}static fromString(o){return new Xr([new co(o,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(o=>0!==o.text.length||o.image&&0!==o.image.name.length)}static factory(o){return o instanceof Xr?o:Xr.fromString(o)}toString(){return 0===this.sections.length?"":this.sections.map(o=>o.text).join("")}}class $r{constructor(o){this.values=o.slice()}static parse(o){if(o instanceof $r)return o;if("number"==typeof o)return new $r([o,o,o,o]);if(Array.isArray(o)&&!(o.length<1||o.length>4)){for(const u of o)if("number"!=typeof u)return;switch(o.length){case 1:o=[o[0],o[0],o[0],o[0]];break;case 2:o=[o[0],o[1],o[0],o[1]];break;case 3:o=[o[0],o[1],o[2],o[1]]}return new $r(o)}}toString(){return JSON.stringify(this.values)}}class mi{constructor(o){this.name=o.name,this.available=o.available}toString(){return this.name}static fromString(o){return o?new mi({name:o,available:!1}):null}}function gi(l,o,u,f){return"number"==typeof l&&l>=0&&l<=255&&"number"==typeof o&&o>=0&&o<=255&&"number"==typeof u&&u>=0&&u<=255?void 0===f||"number"==typeof f&&f>=0&&f<=1?null:`Invalid rgba value [${[l,o,u,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof f?[l,o,u,f]:[l,o,u]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ns(l){if(null===l||"string"==typeof l||"boolean"==typeof l||"number"==typeof l||l instanceof Sn||l instanceof Fl||l instanceof Xr||l instanceof $r||l instanceof mi)return!0;if(Array.isArray(l)){for(const o of l)if(!Ns(o))return!1;return!0}if("object"==typeof l){for(const o in l)if(!Ns(l[o]))return!1;return!0}return!1}function J(l){if(null===l)return fs;if("string"==typeof l)return Jt;if("boolean"==typeof l)return jt;if("number"==typeof l)return rt;if(l instanceof Sn)return so;if(l instanceof Fl)return Ls;if(l instanceof Xr)return Ei;if(l instanceof $r)return ra;if(l instanceof mi)return ao;if(Array.isArray(l)){const o=l.length;let u;for(const f of l){const _=J(f);if(u){if(u===_)continue;u=At;break}u=_}return $i(u||At,o)}return ps}function V(l){const o=typeof l;return null===l?"":"string"===o||"number"===o||"boolean"===o?String(l):l instanceof Sn||l instanceof Xr||l instanceof $r||l instanceof mi?l.toString():JSON.stringify(l)}class ${constructor(o,u){this.type=o,this.value=u}static parse(o,u){if(2!==o.length)return u.error(`'literal' expression requires exactly one argument, but found ${o.length-1} instead.`);if(!Ns(o[1]))return u.error("invalid value");const f=o[1];let _=J(f);const x=u.expectedType;return"array"!==_.kind||0!==_.N||!x||"array"!==x.kind||"number"==typeof x.N&&0!==x.N||(_=x),new $(_,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class K{constructor(o){this.name="ExpressionEvaluationError",this.message=o}toJSON(){return this.message}}const te={string:Jt,number:rt,boolean:jt,object:ps};class ce{constructor(o,u){this.type=o,this.args=u}static parse(o,u){if(o.length<2)return u.error("Expected at least one argument.");let f,_=1;const x=o[0];if("array"===x){let M,A;if(o.length>2){const F=o[1];if("string"!=typeof F||!(F in te)||"object"===F)return u.error('The item type argument of "array" must be one of string, number, boolean',1);M=te[F],_++}else M=At;if(o.length>3){if(null!==o[2]&&("number"!=typeof o[2]||o[2]<0||o[2]!==Math.floor(o[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=o[2],_++}f=$i(M,A)}else{if(!te[x])throw new Error(`Types doesn't contain name = ${x}`);f=te[x]}const C=[];for(;_o.outputDefined())}}const ge={"to-boolean":jt,"to-color":so,"to-number":rt,"to-string":Jt};class he{constructor(o,u){this.type=o,this.args=u}static parse(o,u){if(o.length<2)return u.error("Expected at least one argument.");const f=o[0];if(!ge[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if(("to-boolean"===f||"to-string"===f)&&2!==o.length)return u.error("Expected one argument.");const _=ge[f],x=[];for(let C=1;C4?`Invalid rbga value ${JSON.stringify(u)}: expected an array containing either three or four numeric values.`:gi(u[0],u[1],u[2],u[3]),!f))return new Sn(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new K(f||`Could not parse color from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("padding"===this.type.kind){let u;for(const f of this.args){u=f.evaluate(o);const _=$r.parse(u);if(_)return _}throw new K(`Could not parse padding from value '${"string"==typeof u?u:JSON.stringify(u)}'`)}if("number"===this.type.kind){let u=null;for(const f of this.args){if(u=f.evaluate(o),null===u)return 0;const _=Number(u);if(!isNaN(_))return _}throw new K(`Could not convert ${JSON.stringify(u)} to number.`)}return"formatted"===this.type.kind?Xr.fromString(V(this.args[0].evaluate(o))):"resolvedImage"===this.type.kind?mi.fromString(V(this.args[0].evaluate(o))):V(this.args[0].evaluate(o))}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}const ue=["Unknown","Point","LineString","Polygon"];class xe{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ue[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(o){let u=this._parseColorCache[o];return u||(u=this._parseColorCache[o]=Sn.parse(o)),u}}class Me{constructor(o,u,f,_){this.name=o,this.type=u,this._evaluate=f,this.args=_}evaluate(o){return this._evaluate(o,this.args)}eachChild(o){this.args.forEach(o)}outputDefined(){return!1}static parse(o,u){const f=o[0],_=Me.definitions[f];if(!_)return u.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(_)?_[0]:_.type,C=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,M=C.filter(([F])=>!Array.isArray(F)||F.length===o.length-1);let A=null;for(const[F,O]of M){A=new Ol(u.registry,u.path,null,u.scope);const B=[];let H=!1;for(let q=1;q{return H=B,Array.isArray(H)?`(${H.map(Nn).join(", ")})`:`(${Nn(H.type)}...)`;var H}).join(" | "),O=[];for(let B=1;B=o[2]||l[1]<=o[1]||l[3]>=o[3])}function dt(l,o){const u=(180+l[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,_=Math.pow(2,o.z);return[Math.round(u*_*Te),Math.round(f*_*Te)]}function xt(l,o,u){const f=l[0]-o[0],_=l[1]-o[1],x=l[0]-u[0],C=l[1]-u[1];return f*C-x*_==0&&f*x<=0&&_*C<=0}function ln(l,o){let u=!1;for(let C=0,M=o.length;C(f=l)[1]!=(x=A[F+1])[1]>f[1]&&f[0]<(x[0]-_[0])*(f[1]-_[1])/(x[1]-_[1])+_[0]&&(u=!u)}}var f,_,x;return u}function qn(l,o){for(let u=0;u0&&M<0||C<0&&M>0}function an(l,o,u){for(const F of u)for(let O=0;Ou[2]){const _=.5*f;let x=l[0]-u[0]>_?-f:u[0]-l[0]>_?f:0;0===x&&(x=l[0]-u[2]>_?-f:u[2]-l[0]>_?f:0),l[0]+=x}Dt(o,l)}function kf(l,o,u,f){const _=Math.pow(2,f.z)*Te,x=[f.x*Te,f.y*Te],C=[];for(const M of l)for(const A of M){const F=[A.x+x[0],A.y+x[1]];Va(F,o,u,_),C.push(F)}return C}function Pf(l,o,u,f){const _=Math.pow(2,f.z)*Te,x=[f.x*Te,f.y*Te],C=[];for(const A of l){const F=[];for(const O of A){const B=[O.x+x[0],O.y+x[1]];Dt(o,B),F.push(B)}C.push(F)}if(o[2]-o[0]<=_/2){(M=o)[0]=M[1]=1/0,M[2]=M[3]=-1/0;for(const A of C)for(const F of A)Va(F,o,u,_)}var M;return C}class Ua{constructor(o,u){this.type=jt,this.geojson=o,this.geometries=u}static parse(o,u){if(2!==o.length)return u.error(`'within' expression requires exactly one argument, but found ${o.length-1} instead.`);if(Ns(o[1])){const f=o[1];if("FeatureCollection"===f.type)for(let _=0;_{o&&!Fu(u)&&(o=!1)}),o}function $a(l){if(l instanceof Me&&"feature-state"===l.name)return!1;let o=!0;return l.eachChild(u=>{o&&!$a(u)&&(o=!1)}),o}function sa(l,o){if(l instanceof Me&&o.indexOf(l.name)>=0)return!1;let u=!0;return l.eachChild(f=>{u&&!sa(f,o)&&(u=!1)}),u}class Ou{constructor(o,u){this.type=u.type,this.name=o,this.boundExpression=u}static parse(o,u){if(2!==o.length||"string"!=typeof o[1])return u.error("'var' expression requires exactly one string literal argument.");const f=o[1];return u.scope.has(f)?new Ou(f,u.scope.get(f)):u.error(`Unknown variable "${f}". Make sure "${f}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(o){return this.boundExpression.evaluate(o)}eachChild(){}outputDefined(){return!1}}class Cr{constructor(o,u=[],f,_=new Pl,x=[]){this.registry=o,this.path=u,this.key=u.map(C=>`[${C}]`).join(""),this.scope=_,this.errors=x,this.expectedType=f}parse(o,u,f,_,x={}){return u?this.concat(u,f,_)._parse(o,x):this._parse(o,x)}_parse(o,u){function f(_,x,C){return"assert"===C?new ce(x,[_]):"coerce"===C?new he(x,[_]):_}if(null!==o&&"string"!=typeof o&&"boolean"!=typeof o&&"number"!=typeof o||(o=["literal",o]),Array.isArray(o)){if(0===o.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=o[0];if("string"!=typeof _)return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const x=this.registry[_];if(x){let C=x.parse(o,this);if(!C)return null;if(this.expectedType){const M=this.expectedType,A=C.type;if("string"!==M.kind&&"number"!==M.kind&&"boolean"!==M.kind&&"object"!==M.kind&&"array"!==M.kind||"value"!==A.kind)if("color"!==M.kind&&"formatted"!==M.kind&&"resolvedImage"!==M.kind||"value"!==A.kind&&"string"!==A.kind)if("padding"!==M.kind||"value"!==A.kind&&"number"!==A.kind&&"array"!==A.kind){if(this.checkSubtype(M,A))return null}else C=f(C,M,u.typeAnnotation||"coerce");else C=f(C,M,u.typeAnnotation||"coerce");else C=f(C,M,u.typeAnnotation||"assert")}if(!(C instanceof $)&&"resolvedImage"!==C.type.kind&&Zh(C)){const M=new xe;try{C=new $(C.type,C.evaluate(M))}catch(A){return this.error(A.message),null}}return C}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===o?"'undefined' value invalid. Use null instead.":"object"==typeof o?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof o} instead.`)}concat(o,u,f){const _="number"==typeof o?this.path.concat(o):this.path,x=f?this.scope.concat(f):this.scope;return new Cr(this.registry,_,u||null,x,this.errors)}error(o,...u){const f=`${this.key}${u.map(_=>`[${_}]`).join("")}`;this.errors.push(new Ui(f,o))}checkSubtype(o,u){const f=lo(o,u);return f&&this.error(f),f}}var Ol=Cr;function Zh(l){if(l instanceof Ou)return Zh(l.boundExpression);if(l instanceof Me&&"error"===l.name||l instanceof je||l instanceof Ua)return!1;const o=l instanceof he||l instanceof ce;let u=!0;return l.eachChild(f=>{u=o?u&&Zh(f):u&&f instanceof $}),!!u&&Fu(l)&&sa(l,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ll(l,o){const u=l.length-1;let f,_,x=0,C=u,M=0;for(;x<=C;)if(M=Math.floor((x+C)/2),f=l[M],_=l[M+1],f<=o){if(M===u||o<_)return M;x=M+1}else{if(!(f>o))throw new K("Input is not a number.");C=M-1}return 0}class zn{constructor(o,u,f){this.type=o,this.input=u,this.labels=[],this.outputs=[];for(const[_,x]of f)this.labels.push(_),this.outputs.push(x)}static parse(o,u){if(o.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return u.error("Expected an even number of arguments.");const f=u.parse(o[1],1,rt);if(!f)return null;const _=[];let x=null;u.expectedType&&"value"!==u.expectedType.kind&&(x=u.expectedType);for(let C=1;C=M)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',F);const B=u.parse(A,O,x);if(!B)return null;x=x||B.type,_.push([M,B])}return new zn(x,f,_)}evaluate(o){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(o);const _=this.input.evaluate(o);if(_<=u[0])return f[0].evaluate(o);const x=u.length;return _>=u[x-1]?f[x-1].evaluate(o):f[Ll(u,_)].evaluate(o)}eachChild(o){o(this.input);for(const u of this.outputs)o(u)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function Kn(l,o,u){return l*(1-u)+o*u}var Mn=Object.freeze({__proto__:null,array:function(l,o,u){return l.map((f,_)=>Kn(f,o[_],u))},color:function(l,o,u){return new Sn(Kn(l.r,o.r,u),Kn(l.g,o.g,u),Kn(l.b,o.b,u),Kn(l.a,o.a,u))},number:Kn,padding:function(l,o,u){const f=l.values,_=o.values;return new $r([Kn(f[0],_[0],u),Kn(f[1],_[1],u),Kn(f[2],_[2],u),Kn(f[3],_[3],u)])}});const Jn=4/29,Mt=6/29,Nl=3*Mt*Mt,Ff=Math.PI/180,nt=180/Math.PI;function wn(l){return l>.008856451679035631?Math.pow(l,1/3):l/Nl+Jn}function $t(l){return l>Mt?l*l*l:Nl*(l-Jn)}function gn(l){return 255*(l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055)}function Wh(l){return(l/=255)<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Of(l){const o=Wh(l.r),u=Wh(l.g),f=Wh(l.b),_=wn((.4124564*o+.3575761*u+.1804375*f)/.95047),x=wn((.2126729*o+.7151522*u+.072175*f)/1);return{l:116*x-16,a:500*(_-x),b:200*(x-wn((.0193339*o+.119192*u+.9503041*f)/1.08883)),alpha:l.a}}function Xh(l){let o=(l.l+16)/116,u=isNaN(l.a)?o:o+l.a/500,f=isNaN(l.b)?o:o-l.b/200;return o=1*$t(o),u=.95047*$t(u),f=1.08883*$t(f),new Sn(gn(3.2404542*u-1.5371385*o-.4985314*f),gn(-.969266*u+1.8760108*o+.041556*f),gn(.0556434*u-.2040259*o+1.0572252*f),l.alpha)}function Nu(l,o,u){const f=o-l;return l+u*(f>180||f<-180?f-360*Math.round(f/360):f)}const Yr={forward:Of,reverse:Xh,interpolate:function(l,o,u){return{l:Kn(l.l,o.l,u),a:Kn(l.a,o.a,u),b:Kn(l.b,o.b,u),alpha:Kn(l.alpha,o.alpha,u)}}},Lc={forward:function(l){const{l:o,a:u,b:f}=Of(l),_=Math.atan2(f,u)*nt;return{h:_<0?_+360:_,c:Math.sqrt(u*u+f*f),l:o,alpha:l.a}},reverse:function(l){const o=l.h*Ff,u=l.c;return Xh({l:l.l,a:Math.cos(o)*u,b:Math.sin(o)*u,alpha:l.alpha})},interpolate:function(l,o,u){return{h:Nu(l.h,o.h,u),c:Kn(l.c,o.c,u),l:Kn(l.l,o.l,u),alpha:Kn(l.alpha,o.alpha,u)}}};var Lf=Object.freeze({__proto__:null,hcl:Lc,lab:Yr});class Io{constructor(o,u,f,_,x){this.type=o,this.operator=u,this.interpolation=f,this.input=_,this.labels=[],this.outputs=[];for(const[C,M]of x)this.labels.push(C),this.outputs.push(M)}static interpolationFactor(o,u,f,_){let x=0;if("exponential"===o.name)x=Zo(u,o.base,f,_);else if("linear"===o.name)x=Zo(u,1,f,_);else if("cubic-bezier"===o.name){const C=o.controlPoints;x=new wr(C[0],C[1],C[2],C[3]).solve(Zo(u,1,f,_))}return x}static parse(o,u){let[f,_,x,...C]=o;if(!Array.isArray(_)||0===_.length)return u.error("Expected an interpolation type expression.",1);if("linear"===_[0])_={name:"linear"};else if("exponential"===_[0]){const F=_[1];if("number"!=typeof F)return u.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:F}}else{if("cubic-bezier"!==_[0])return u.error(`Unknown interpolation type ${String(_[0])}`,1,0);{const F=_.slice(1);if(4!==F.length||F.some(O=>"number"!=typeof O||O<0||O>1))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:F}}}if(o.length-1<4)return u.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if((o.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(x=u.parse(x,2,rt),!x)return null;const M=[];let A=null;"interpolate-hcl"===f||"interpolate-lab"===f?A=so:u.expectedType&&"value"!==u.expectedType.kind&&(A=u.expectedType);for(let F=0;F=O)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const W=u.parse(B,q,A);if(!W)return null;A=A||W.type,M.push([O,W])}return"number"===A.kind||"color"===A.kind||"padding"===A.kind||"array"===A.kind&&"number"===A.itemType.kind&&"number"==typeof A.N?new Io(A,f,_,x,M):u.error(`Type ${Nn(A)} is not interpolatable.`)}evaluate(o){const u=this.labels,f=this.outputs;if(1===u.length)return f[0].evaluate(o);const _=this.input.evaluate(o);if(_<=u[0])return f[0].evaluate(o);const x=u.length;if(_>=u[x-1])return f[x-1].evaluate(o);const C=Ll(u,_),M=Io.interpolationFactor(this.interpolation,_,u[C],u[C+1]),A=f[C].evaluate(o),F=f[C+1].evaluate(o);return"interpolate"===this.operator?Mn[this.type.kind.toLowerCase()](A,F,M):"interpolate-hcl"===this.operator?Lc.reverse(Lc.interpolate(Lc.forward(A),Lc.forward(F),M)):Yr.reverse(Yr.interpolate(Yr.forward(A),Yr.forward(F),M))}eachChild(o){o(this.input);for(const u of this.outputs)o(u)}outputDefined(){return this.outputs.every(o=>o.outputDefined())}}function Zo(l,o,u,f){const _=f-u,x=l-u;return 0===_?0:1===o?x/_:(Math.pow(o,x)-1)/(Math.pow(o,_)-1)}class Yh{constructor(o,u){this.type=o,this.args=u}static parse(o,u){if(o.length<2)return u.error("Expectected at least one argument.");let f=null;const _=u.expectedType;_&&"value"!==_.kind&&(f=_);const x=[];for(const M of o.slice(1)){const A=u.parse(M,1+x.length,f,void 0,{typeAnnotation:"omit"});if(!A)return null;f=f||A.type,x.push(A)}if(!f)throw new Error("No output type");const C=_&&x.some(M=>lo(_,M.type));return new Yh(C?At:f,x)}evaluate(o){let u,f=null,_=0;for(const x of this.args)if(_++,f=x.evaluate(o),f&&f instanceof mi&&!f.available&&(u||(u=f.name),f=null,_===this.args.length&&(f=u)),null!==f)break;return f}eachChild(o){this.args.forEach(o)}outputDefined(){return this.args.every(o=>o.outputDefined())}}class zu{constructor(o,u){this.type=u.type,this.bindings=[].concat(o),this.result=u}evaluate(o){return this.result.evaluate(o)}eachChild(o){for(const u of this.bindings)o(u[1]);o(this.result)}static parse(o,u){if(o.length<4)return u.error(`Expected at least 3 arguments, but found ${o.length-1} instead.`);const f=[];for(let x=1;x=f.length)throw new K(`Array index out of bounds: ${u} > ${f.length-1}.`);if(u!==Math.floor(u))throw new K(`Array index must be an integer, but found ${u} instead.`);return f[u]}eachChild(o){o(this.index),o(this.input)}outputDefined(){return!1}}class Nf{constructor(o,u){this.type=jt,this.needle=o,this.haystack=u}static parse(o,u){if(3!==o.length)return u.error(`Expected 2 arguments, but found ${o.length-1} instead.`);const f=u.parse(o[1],1,At),_=u.parse(o[2],2,At);return f&&_?Rl(f.type,[jt,Jt,rt,fs,At])?new Nf(f,_):u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(f.type)} instead`):null}evaluate(o){const u=this.needle.evaluate(o),f=this.haystack.evaluate(o);if(!f)return!1;if(!pn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(J(u))} instead.`);if(!pn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${Nn(J(f))} instead.`);return f.indexOf(u)>=0}eachChild(o){o(this.needle),o(this.haystack)}outputDefined(){return!0}}class Bu{constructor(o,u,f){this.type=rt,this.needle=o,this.haystack=u,this.fromIndex=f}static parse(o,u){if(o.length<=2||o.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const f=u.parse(o[1],1,At),_=u.parse(o[2],2,At);if(!f||!_)return null;if(!Rl(f.type,[jt,Jt,rt,fs,At]))return u.error(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(f.type)} instead`);if(4===o.length){const x=u.parse(o[3],3,rt);return x?new Bu(f,_,x):null}return new Bu(f,_)}evaluate(o){const u=this.needle.evaluate(o),f=this.haystack.evaluate(o);if(!pn(u,["boolean","string","number","null"]))throw new K(`Expected first argument to be of type boolean, string, number or null, but found ${Nn(J(u))} instead.`);if(!pn(f,["string","array"]))throw new K(`Expected second argument to be of type array or string, but found ${Nn(J(f))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(o);return f.indexOf(u,_)}return f.indexOf(u)}eachChild(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)}outputDefined(){return!1}}class Vu{constructor(o,u,f,_,x,C){this.inputType=o,this.type=u,this.input=f,this.cases=_,this.outputs=x,this.otherwise=C}static parse(o,u){if(o.length<5)return u.error(`Expected at least 4 arguments, but found only ${o.length-1}.`);if(o.length%2!=1)return u.error("Expected an even number of arguments.");let f,_;u.expectedType&&"value"!==u.expectedType.kind&&(_=u.expectedType);const x={},C=[];for(let F=2;FNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof W&&Math.floor(W)!==W)return H.error("Numeric branch labels must be integer values.");if(f){if(H.checkSubtype(f,J(W)))return null}else f=J(W);if(void 0!==x[String(W)])return H.error("Branch labels must be unique.");x[String(W)]=C.length}const q=u.parse(B,F,_);if(!q)return null;_=_||q.type,C.push(q)}const M=u.parse(o[1],1,At);if(!M)return null;const A=u.parse(o[o.length-1],o.length-1,_);return A?"value"!==M.type.kind&&u.concat(1).checkSubtype(f,M.type)?null:new Vu(f,_,M,x,C,A):null}evaluate(o){const u=this.input.evaluate(o);return(J(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(o)}eachChild(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)}outputDefined(){return this.outputs.every(o=>o.outputDefined())&&this.otherwise.outputDefined()}}class Jh{constructor(o,u,f){this.type=o,this.branches=u,this.otherwise=f}static parse(o,u){if(o.length<4)return u.error(`Expected at least 3 arguments, but found only ${o.length-1}.`);if(o.length%2!=0)return u.error("Expected an odd number of arguments.");let f;u.expectedType&&"value"!==u.expectedType.kind&&(f=u.expectedType);const _=[];for(let C=1;Cu.outputDefined())&&this.otherwise.outputDefined()}}class Qh{constructor(o,u,f,_){this.type=o,this.input=u,this.beginIndex=f,this.endIndex=_}static parse(o,u){if(o.length<=2||o.length>=5)return u.error(`Expected 3 or 4 arguments, but found ${o.length-1} instead.`);const f=u.parse(o[1],1,At),_=u.parse(o[2],2,rt);if(!f||!_)return null;if(!Rl(f.type,[$i(At),Jt,At]))return u.error(`Expected first argument to be of type array or string, but found ${Nn(f.type)} instead`);if(4===o.length){const x=u.parse(o[3],3,rt);return x?new Qh(f.type,f,_,x):null}return new Qh(f.type,f,_)}evaluate(o){const u=this.input.evaluate(o),f=this.beginIndex.evaluate(o);if(!pn(u,["string","array"]))throw new K(`Expected first argument to be of type array or string, but found ${Nn(J(u))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(o);return u.slice(f,_)}return u.slice(f)}eachChild(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)}outputDefined(){return!1}}function ji(l,o){return"=="===l||"!="===l?"boolean"===o.kind||"string"===o.kind||"number"===o.kind||"null"===o.kind||"value"===o.kind:"string"===o.kind||"number"===o.kind||"value"===o.kind}function Rn(l,o,u,f){return 0===f.compare(o,u)}function zl(l,o,u){const f="=="!==l&&"!="!==l;return class xz{constructor(x,C,M){this.type=jt,this.lhs=x,this.rhs=C,this.collator=M,this.hasUntypedArgument="value"===x.type.kind||"value"===C.type.kind}static parse(x,C){if(3!==x.length&&4!==x.length)return C.error("Expected two or three arguments.");const M=x[0];let A=C.parse(x[1],1,At);if(!A)return null;if(!ji(M,A.type))return C.concat(1).error(`"${M}" comparisons are not supported for type '${Nn(A.type)}'.`);let F=C.parse(x[2],2,At);if(!F)return null;if(!ji(M,F.type))return C.concat(2).error(`"${M}" comparisons are not supported for type '${Nn(F.type)}'.`);if(A.type.kind!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return C.error(`Cannot compare types '${Nn(A.type)}' and '${Nn(F.type)}'.`);f&&("value"===A.type.kind&&"value"!==F.type.kind?A=new ce(F.type,[A]):"value"!==A.type.kind&&"value"===F.type.kind&&(F=new ce(A.type,[F])));let O=null;if(4===x.length){if("string"!==A.type.kind&&"string"!==F.type.kind&&"value"!==A.type.kind&&"value"!==F.type.kind)return C.error("Cannot use collator to compare non-string types.");if(O=C.parse(x[3],3,Ls),!O)return null}return new xz(A,F,O)}evaluate(x){const C=this.lhs.evaluate(x),M=this.rhs.evaluate(x);if(f&&this.hasUntypedArgument){const A=J(C),F=J(M);if(A.kind!==F.kind||"string"!==A.kind&&"number"!==A.kind)throw new K(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${A.kind}, ${F.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const A=J(C),F=J(M);if("string"!==A.kind||"string"!==F.kind)return o(x,C,M)}return this.collator?u(x,C,M,this.collator.evaluate(x)):o(x,C,M)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const M_=zl("==",function(l,o,u){return o===u},Rn),T_=zl("!=",function(l,o,u){return o!==u},function(l,o,u,f){return!Rn(0,o,u,f)}),zt=zl("<",function(l,o,u){return o",function(l,o,u){return o>u},function(l,o,u,f){return f.compare(o,u)>0}),Di=zl("<=",function(l,o,u){return o<=u},function(l,o,u,f){return f.compare(o,u)<=0}),Uu=zl(">=",function(l,o,u){return o>=u},function(l,o,u,f){return f.compare(o,u)>=0});class ed{constructor(o,u,f,_,x){this.type=Jt,this.number=o,this.locale=u,this.currency=f,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(o,u){if(3!==o.length)return u.error("Expected two arguments.");const f=u.parse(o[1],1,rt);if(!f)return null;const _=o[2];if("object"!=typeof _||Array.isArray(_))return u.error("NumberFormat options argument must be an object.");let x=null;if(_.locale&&(x=u.parse(_.locale,1,Jt),!x))return null;let C=null;if(_.currency&&(C=u.parse(_.currency,1,Jt),!C))return null;let M=null;if(_["min-fraction-digits"]&&(M=u.parse(_["min-fraction-digits"],1,rt),!M))return null;let A=null;return _["max-fraction-digits"]&&(A=u.parse(_["max-fraction-digits"],1,rt),!A)?null:new ed(f,x,C,M,A)}evaluate(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))}eachChild(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)}outputDefined(){return!1}}class Nc{constructor(o){this.type=Ei,this.sections=o}static parse(o,u){if(o.length<2)return u.error("Expected at least one argument.");const f=o[1];if(!Array.isArray(f)&&"object"==typeof f)return u.error("First argument must be an image or text section.");const _=[];let x=!1;for(let C=1;C<=o.length-1;++C){const M=o[C];if(x&&"object"==typeof M&&!Array.isArray(M)){x=!1;let A=null;if(M["font-scale"]&&(A=u.parse(M["font-scale"],1,rt),!A))return null;let F=null;if(M["text-font"]&&(F=u.parse(M["text-font"],1,$i(Jt)),!F))return null;let O=null;if(M["text-color"]&&(O=u.parse(M["text-color"],1,so),!O))return null;const B=_[_.length-1];B.scale=A,B.font=F,B.textColor=O}else{const A=u.parse(o[C],1,At);if(!A)return null;const F=A.type.kind;if("string"!==F&&"value"!==F&&"null"!==F&&"resolvedImage"!==F)return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:A,scale:null,font:null,textColor:null})}}return new Nc(_)}evaluate(o){return new Xr(this.sections.map(u=>{const f=u.content.evaluate(o);return J(f)===ao?new co("",f,null,null,null):new co(V(f),null,u.scale?u.scale.evaluate(o):null,u.font?u.font.evaluate(o).join(","):null,u.textColor?u.textColor.evaluate(o):null)}))}eachChild(o){for(const u of this.sections)o(u.content),u.scale&&o(u.scale),u.font&&o(u.font),u.textColor&&o(u.textColor)}outputDefined(){return!1}}class td{constructor(o){this.type=ao,this.input=o}static parse(o,u){if(2!==o.length)return u.error("Expected two arguments.");const f=u.parse(o[1],1,Jt);return f?new td(f):u.error("No image name provided.")}evaluate(o){const u=this.input.evaluate(o),f=mi.fromString(u);return f&&o.availableImages&&(f.available=o.availableImages.indexOf(u)>-1),f}eachChild(o){o(this.input)}outputDefined(){return!1}}class nd{constructor(o){this.type=rt,this.input=o}static parse(o,u){if(2!==o.length)return u.error(`Expected 1 argument, but found ${o.length-1} instead.`);const f=u.parse(o[1],1);return f?"array"!==f.type.kind&&"string"!==f.type.kind&&"value"!==f.type.kind?u.error(`Expected argument of type string or array, but found ${Nn(f.type)} instead.`):new nd(f):null}evaluate(o){const u=this.input.evaluate(o);if("string"==typeof u||Array.isArray(u))return u.length;throw new K(`Expected value to be of type string or array, but found ${Nn(J(u))} instead.`)}eachChild(o){o(this.input)}outputDefined(){return!1}}const ja={"==":M_,"!=":T_,">":zm,"<":zt,">=":Uu,"<=":Di,array:ce,at:Kh,boolean:ce,case:Jh,coalesce:Yh,collator:je,format:Nc,image:td,in:Nf,"index-of":Bu,interpolate:Io,"interpolate-hcl":Io,"interpolate-lab":Io,length:nd,let:zu,literal:$,match:Vu,number:ce,"number-format":ed,object:ce,slice:Qh,step:zn,string:ce,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:Ou,within:Ua};function mn(l,[o,u,f,_]){o=o.evaluate(l),u=u.evaluate(l),f=f.evaluate(l);const x=_?_.evaluate(l):1,C=gi(o,u,f,x);if(C)throw new K(C);return new Sn(o/255*x,u/255*x,f/255*x,x)}function $u(l,o){return l in o}function ju(l,o){const u=o[l];return void 0===u?null:u}function Ha(l){return{type:l}}function Rt(l){return{result:"success",value:l}}function aa(l){return{result:"error",value:l}}function Bl(l){return"data-driven"===l["property-type"]||"cross-faded-data-driven"===l["property-type"]}function uo(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function Hu(l){return!!l.expression&&l.expression.interpolated}function Un(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":null===l?"null":typeof l}function Wo(l){return"object"==typeof l&&null!==l&&!Array.isArray(l)}function Xo(l){return l}function Bm(l,o){const u="color"===o.type,f=l.stops&&"object"==typeof l.stops[0][0],_=f||!(f||void 0!==l.property),x=l.type||(Hu(o)?"exponential":"interval");if(u||"padding"===o.type){const F=u?Sn.parse:$r.parse;(l=Vi({},l)).stops&&(l.stops=l.stops.map(O=>[O[0],F(O[1])])),l.default=F(l.default?l.default:o.default)}if(l.colorSpace&&"rgb"!==l.colorSpace&&!Lf[l.colorSpace])throw new Error(`Unknown color space: ${l.colorSpace}`);let C,M,A;if("exponential"===x)C=Vm;else if("interval"===x)C=nr;else if("categorical"===x){C=ms,M=Object.create(null);for(const F of l.stops)M[F[0]]=F[1];A=typeof l.stops[0][0]}else{if("identity"!==x)throw new Error(`Unknown function type "${x}"`);C=I_}if(f){const F={},O=[];for(let q=0;qq[0]),evaluate:({zoom:q},W)=>Vm({stops:B,base:l.base},o,q).evaluate(q,W)}}if(_){const F="exponential"===x?{name:"exponential",base:void 0!==l.base?l.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:Io.interpolationFactor.bind(void 0,F),zoomStops:l.stops.map(O=>O[0]),evaluate:({zoom:O})=>C(l,o,O,M,A)}}return{kind:"source",evaluate(F,O){const B=O&&O.properties?O.properties[l.property]:void 0;return void 0===B?Gu(l.default,o.default):C(l,o,B,M,A)}}}function Gu(l,o,u){return void 0!==l?l:void 0!==o?o:void 0!==u?u:void 0}function ms(l,o,u,f,_){return Gu(typeof u===_?f[u]:void 0,l.default,o.default)}function nr(l,o,u){if("number"!==Un(u))return Gu(l.default,o.default);const f=l.stops.length;if(1===f||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[f-1][0])return l.stops[f-1][1];const _=Ll(l.stops.map(x=>x[0]),u);return l.stops[_][1]}function Vm(l,o,u){const f=void 0!==l.base?l.base:1;if("number"!==Un(u))return Gu(l.default,o.default);const _=l.stops.length;if(1===_||u<=l.stops[0][0])return l.stops[0][1];if(u>=l.stops[_-1][0])return l.stops[_-1][1];const x=Ll(l.stops.map(O=>O[0]),u),C=function(O,B,H,q){const W=q-H,se=O-H;return 0===W?0:1===B?se/W:(Math.pow(B,se)-1)/(Math.pow(B,W)-1)}(u,f,l.stops[x][0],l.stops[x+1][0]),M=l.stops[x][1],A=l.stops[x+1][1];let F=Mn[o.type]||Xo;if(l.colorSpace&&"rgb"!==l.colorSpace){const O=Lf[l.colorSpace];F=(B,H)=>O.reverse(O.interpolate(O.forward(B),O.forward(H),C))}return"function"==typeof M.evaluate?{evaluate(...O){const B=M.evaluate.apply(void 0,O),H=A.evaluate.apply(void 0,O);if(void 0!==B&&void 0!==H)return F(B,H,C)}}:F(M,A,C)}function I_(l,o,u){switch(o.type){case"color":u=Sn.parse(u);break;case"formatted":u=Xr.fromString(u.toString());break;case"resolvedImage":u=mi.fromString(u.toString());break;case"padding":u=$r.parse(u);break;default:Un(u)===o.type||"enum"===o.type&&o.values[u]||(u=void 0)}return Gu(u,l.default,o.default)}Me.register(ja,{error:[{kind:"error"},[Jt],(l,[o])=>{throw new K(o.evaluate(l))}],typeof:[Jt,[At],(l,[o])=>Nn(J(o.evaluate(l)))],"to-rgba":[$i(rt,4),[so],(l,[o])=>o.evaluate(l).toArray()],rgb:[so,[rt,rt,rt],mn],rgba:[so,[rt,rt,rt,rt],mn],has:{type:jt,overloads:[[[Jt],(l,[o])=>$u(o.evaluate(l),l.properties())],[[Jt,ps],(l,[o,u])=>$u(o.evaluate(l),u.evaluate(l))]]},get:{type:At,overloads:[[[Jt],(l,[o])=>ju(o.evaluate(l),l.properties())],[[Jt,ps],(l,[o,u])=>ju(o.evaluate(l),u.evaluate(l))]]},"feature-state":[At,[Jt],(l,[o])=>ju(o.evaluate(l),l.featureState||{})],properties:[ps,[],l=>l.properties()],"geometry-type":[Jt,[],l=>l.geometryType()],id:[At,[],l=>l.id()],zoom:[rt,[],l=>l.globals.zoom],"heatmap-density":[rt,[],l=>l.globals.heatmapDensity||0],"line-progress":[rt,[],l=>l.globals.lineProgress||0],accumulated:[At,[],l=>void 0===l.globals.accumulated?null:l.globals.accumulated],"+":[rt,Ha(rt),(l,o)=>{let u=0;for(const f of o)u+=f.evaluate(l);return u}],"*":[rt,Ha(rt),(l,o)=>{let u=1;for(const f of o)u*=f.evaluate(l);return u}],"-":{type:rt,overloads:[[[rt,rt],(l,[o,u])=>o.evaluate(l)-u.evaluate(l)],[[rt],(l,[o])=>-o.evaluate(l)]]},"/":[rt,[rt,rt],(l,[o,u])=>o.evaluate(l)/u.evaluate(l)],"%":[rt,[rt,rt],(l,[o,u])=>o.evaluate(l)%u.evaluate(l)],ln2:[rt,[],()=>Math.LN2],pi:[rt,[],()=>Math.PI],e:[rt,[],()=>Math.E],"^":[rt,[rt,rt],(l,[o,u])=>Math.pow(o.evaluate(l),u.evaluate(l))],sqrt:[rt,[rt],(l,[o])=>Math.sqrt(o.evaluate(l))],log10:[rt,[rt],(l,[o])=>Math.log(o.evaluate(l))/Math.LN10],ln:[rt,[rt],(l,[o])=>Math.log(o.evaluate(l))],log2:[rt,[rt],(l,[o])=>Math.log(o.evaluate(l))/Math.LN2],sin:[rt,[rt],(l,[o])=>Math.sin(o.evaluate(l))],cos:[rt,[rt],(l,[o])=>Math.cos(o.evaluate(l))],tan:[rt,[rt],(l,[o])=>Math.tan(o.evaluate(l))],asin:[rt,[rt],(l,[o])=>Math.asin(o.evaluate(l))],acos:[rt,[rt],(l,[o])=>Math.acos(o.evaluate(l))],atan:[rt,[rt],(l,[o])=>Math.atan(o.evaluate(l))],min:[rt,Ha(rt),(l,o)=>Math.min(...o.map(u=>u.evaluate(l)))],max:[rt,Ha(rt),(l,o)=>Math.max(...o.map(u=>u.evaluate(l)))],abs:[rt,[rt],(l,[o])=>Math.abs(o.evaluate(l))],round:[rt,[rt],(l,[o])=>{const u=o.evaluate(l);return u<0?-Math.round(-u):Math.round(u)}],floor:[rt,[rt],(l,[o])=>Math.floor(o.evaluate(l))],ceil:[rt,[rt],(l,[o])=>Math.ceil(o.evaluate(l))],"filter-==":[jt,[Jt,At],(l,[o,u])=>l.properties()[o.value]===u.value],"filter-id-==":[jt,[At],(l,[o])=>l.id()===o.value],"filter-type-==":[jt,[Jt],(l,[o])=>l.geometryType()===o.value],"filter-<":[jt,[Jt,At],(l,[o,u])=>{const f=l.properties()[o.value],_=u.value;return typeof f==typeof _&&f<_}],"filter-id-<":[jt,[At],(l,[o])=>{const u=l.id(),f=o.value;return typeof u==typeof f&&u":[jt,[Jt,At],(l,[o,u])=>{const f=l.properties()[o.value],_=u.value;return typeof f==typeof _&&f>_}],"filter-id->":[jt,[At],(l,[o])=>{const u=l.id(),f=o.value;return typeof u==typeof f&&u>f}],"filter-<=":[jt,[Jt,At],(l,[o,u])=>{const f=l.properties()[o.value],_=u.value;return typeof f==typeof _&&f<=_}],"filter-id-<=":[jt,[At],(l,[o])=>{const u=l.id(),f=o.value;return typeof u==typeof f&&u<=f}],"filter->=":[jt,[Jt,At],(l,[o,u])=>{const f=l.properties()[o.value],_=u.value;return typeof f==typeof _&&f>=_}],"filter-id->=":[jt,[At],(l,[o])=>{const u=l.id(),f=o.value;return typeof u==typeof f&&u>=f}],"filter-has":[jt,[At],(l,[o])=>o.value in l.properties()],"filter-has-id":[jt,[],l=>null!==l.id()&&void 0!==l.id()],"filter-type-in":[jt,[$i(Jt)],(l,[o])=>o.value.indexOf(l.geometryType())>=0],"filter-id-in":[jt,[$i(At)],(l,[o])=>o.value.indexOf(l.id())>=0],"filter-in-small":[jt,[Jt,$i(At)],(l,[o,u])=>u.value.indexOf(l.properties()[o.value])>=0],"filter-in-large":[jt,[Jt,$i(At)],(l,[o,u])=>function(f,_,x,C){for(;x<=C;){const M=x+C>>1;if(_[M]===f)return!0;_[M]>f?C=M-1:x=M+1}return!1}(l.properties()[o.value],u.value,0,u.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(l,[o,u])=>o.evaluate(l)&&u.evaluate(l)],[Ha(jt),(l,o)=>{for(const u of o)if(!u.evaluate(l))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(l,[o,u])=>o.evaluate(l)||u.evaluate(l)],[Ha(jt),(l,o)=>{for(const u of o)if(u.evaluate(l))return!0;return!1}]]},"!":[jt,[jt],(l,[o])=>!o.evaluate(l)],"is-supported-script":[jt,[Jt],(l,[o])=>{const u=l.globals&&l.globals.isSupportedScript;return!u||u(o.evaluate(l))}],upcase:[Jt,[Jt],(l,[o])=>o.evaluate(l).toUpperCase()],downcase:[Jt,[Jt],(l,[o])=>o.evaluate(l).toLowerCase()],concat:[Jt,Ha(At),(l,o)=>o.map(u=>V(u.evaluate(l))).join("")],"resolved-locale":[Jt,[Ls],(l,[o])=>o.evaluate(l).resolvedLocale()]});class la{constructor(o,u){var f;this.expression=o,this._warningHistory={},this._evaluator=new xe,this._defaultValue=u?"color"===(f=u).type&&Wo(f.default)?new Sn(0,0,0,0):"color"===f.type?Sn.parse(f.default)||null:"padding"===f.type?$r.parse(f.default)||null:void 0===f.default?null:f.default:null,this._enumValues=u&&"enum"===u.type?u.values:null}evaluateWithoutErrorHandling(o,u,f,_,x,C){return this._evaluator.globals=o,this._evaluator.feature=u,this._evaluator.featureState=f,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=C,this.expression.evaluate(this._evaluator)}evaluate(o,u,f,_,x,C){this._evaluator.globals=o,this._evaluator.feature=u||null,this._evaluator.featureState=f||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=C||null;try{const M=this.expression.evaluate(this._evaluator);if(null==M||"number"==typeof M&&M!=M)return this._defaultValue;if(this._enumValues&&!(M in this._enumValues))throw new K(`Expected value to be one of ${Object.keys(this._enumValues).map(A=>JSON.stringify(A)).join(", ")}, but found ${JSON.stringify(M)} instead.`);return M}catch(M){return this._warningHistory[M.message]||(this._warningHistory[M.message]=!0,typeof console<"u"&&console.warn(M.message)),this._defaultValue}}}function Cn(l){return Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in ja}function Ga(l,o){const u=new Ol(ja,[],o?function(_){const x={color:so,string:Jt,number:rt,enum:Jt,boolean:jt,formatted:Ei,padding:ra,resolvedImage:ao};return"array"===_.type?$i(x[_.value]||At,_.length):x[_.type]}(o):void 0),f=u.parse(l,void 0,void 0,void 0,o&&"string"===o.type?{typeAnnotation:"coerce"}:void 0);return f?Rt(new la(f,o)):aa(u.errors)}class zc{constructor(o,u){this.kind=o,this._styleExpression=u,this.isStateDependent="constant"!==o&&!$a(u.expression)}evaluateWithoutErrorHandling(o,u,f,_,x,C){return this._styleExpression.evaluateWithoutErrorHandling(o,u,f,_,x,C)}evaluate(o,u,f,_,x,C){return this._styleExpression.evaluate(o,u,f,_,x,C)}}class Bc{constructor(o,u,f,_){this.kind=o,this.zoomStops=f,this._styleExpression=u,this.isStateDependent="camera"!==o&&!$a(u.expression),this.interpolationType=_}evaluateWithoutErrorHandling(o,u,f,_,x,C){return this._styleExpression.evaluateWithoutErrorHandling(o,u,f,_,x,C)}evaluate(o,u,f,_,x,C){return this._styleExpression.evaluate(o,u,f,_,x,C)}interpolationFactor(o,u,f){return this.interpolationType?Io.interpolationFactor(this.interpolationType,o,u,f):0}}function rd(l,o){const u=Ga(l,o);if("error"===u.result)return u;const f=u.value.expression,_=Fu(f);if(!_&&!Bl(o))return aa([new Ui("","data expressions not supported")]);const x=sa(f,["zoom"]);if(!x&&!uo(o))return aa([new Ui("","zoom expressions not supported")]);const C=ca(f);return C||x?C instanceof Ui?aa([C]):C instanceof Io&&!Hu(o)?aa([new Ui("",'"interpolate" expressions cannot be used with this property')]):Rt(C?new Bc(_?"camera":"composite",u.value,C.labels,C instanceof Io?C.interpolation:void 0):new zc(_?"constant":"source",u.value)):aa([new Ui("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ao{constructor(o,u){this._parameters=o,this._specification=u,Vi(this,Bm(this._parameters,this._specification))}static deserialize(o){return new Ao(o._parameters,o._specification)}static serialize(o){return{_parameters:o._parameters,_specification:o._specification}}}function ca(l){let o=null;if(l instanceof zu)o=ca(l.result);else if(l instanceof Yh){for(const u of l.args)if(o=ca(u),o)break}else(l instanceof zn||l instanceof Io)&&l.input instanceof Me&&"zoom"===l.input.name&&(o=l);return o instanceof Ui||l.eachChild(u=>{const f=ca(u);f instanceof Ui?o=f:!o&&f?o=new Ui("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):o&&f&&o!==f&&(o=new Ui("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),o}function ko(l){const o=l.key,u=l.value,f=l.valueSpec||{},_=l.objectElementValidators||{},x=l.style,C=l.styleSpec,M=l.validateSpec;let A=[];const F=Un(u);if("object"!==F)return[new Pe(o,u,`object expected, ${F} found`)];for(const O in u){const B=O.split(".")[0],H=f[B]||f["*"];let q;if(_[B])q=_[B];else if(f[B])q=M;else if(_["*"])q=_["*"];else{if(!f["*"]){A.push(new Pe(o,u[O],`unknown property "${O}"`));continue}q=M}A=A.concat(q({key:(o&&`${o}.`)+O,value:u[O],valueSpec:H,style:x,styleSpec:C,object:u,objectKey:O,validateSpec:M},u))}for(const O in f)_[O]||f[O].required&&void 0===f[O].default&&void 0===u[O]&&A.push(new Pe(o,u,`missing required property "${O}"`));return A}function zs(l){const o=l.value,u=l.valueSpec,f=l.style,_=l.styleSpec,x=l.key,C=l.arrayElementValidator||l.validateSpec;if("array"!==Un(o))return[new Pe(x,o,`array expected, ${Un(o)} found`)];if(u.length&&o.length!==u.length)return[new Pe(x,o,`array length ${u.length} expected, length ${o.length} found`)];if(u["min-length"]&&o.lengthf.maximum?[new Pe(o,u,`${u} is greater than the maximum value ${f.maximum}`)]:[]}function od(l){const o=l.valueSpec,u=Vn(l.value.type);let f,_,x,C={};const M="categorical"!==u&&void 0===l.value.property,A=!M,F="array"===Un(l.value.stops)&&"array"===Un(l.value.stops[0])&&"object"===Un(l.value.stops[0][0]),O=ko({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function(q){if("identity"===u)return[new Pe(q.key,q.value,'identity function may not have a "stops" property')];let W=[];const se=q.value;return W=W.concat(zs({key:q.key,value:se,valueSpec:q.valueSpec,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,arrayElementValidator:B})),"array"===Un(se)&&0===se.length&&W.push(new Pe(q.key,se,"array must have at least one stop")),W},default:function(q){return q.validateSpec({key:q.key,value:q.value,valueSpec:o,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec})}}});return"identity"===u&&M&&O.push(new Pe(l.key,l.value,'missing required property "property"')),"identity"===u||l.value.stops||O.push(new Pe(l.key,l.value,'missing required property "stops"')),"exponential"===u&&l.valueSpec.expression&&!Hu(l.valueSpec)&&O.push(new Pe(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(A&&!Bl(l.valueSpec)?O.push(new Pe(l.key,l.value,"property functions not supported")):M&&!uo(l.valueSpec)&&O.push(new Pe(l.key,l.value,"zoom functions not supported"))),"categorical"!==u&&!F||void 0!==l.value.property||O.push(new Pe(l.key,l.value,'"property" property is required')),O;function B(q){let W=[];const se=q.value,oe=q.key;if("array"!==Un(se))return[new Pe(oe,se,`array expected, ${Un(se)} found`)];if(2!==se.length)return[new Pe(oe,se,`array length 2 expected, length ${se.length} found`)];if(F){if("object"!==Un(se[0]))return[new Pe(oe,se,`object expected, ${Un(se[0])} found`)];if(void 0===se[0].zoom)return[new Pe(oe,se,"object stop key must have zoom")];if(void 0===se[0].value)return[new Pe(oe,se,"object stop key must have value")];if(x&&x>Vn(se[0].zoom))return[new Pe(oe,se[0].zoom,"stop zoom values must appear in ascending order")];Vn(se[0].zoom)!==x&&(x=Vn(se[0].zoom),_=void 0,C={}),W=W.concat(ko({key:`${oe}[0]`,value:se[0],valueSpec:{zoom:{}},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,objectElementValidators:{zoom:id,value:H}}))}else W=W.concat(H({key:`${oe}[0]`,value:se[0],valueSpec:{},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec},se));return Cn(ds(se[1]))?W.concat([new Pe(`${oe}[1]`,se[1],"expressions are not allowed in function stops.")]):W.concat(q.validateSpec({key:`${oe}[1]`,value:se[1],valueSpec:o,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec}))}function H(q,W){const se=Un(q.value),oe=Vn(q.value),be=null!==q.value?q.value:W;if(f){if(se!==f)return[new Pe(q.key,be,`${se} stop domain type must match previous stop domain type ${f}`)]}else f=se;if("number"!==se&&"string"!==se&&"boolean"!==se)return[new Pe(q.key,be,"stop domain value must be a number, string, or boolean")];if("number"!==se&&"categorical"!==u){let Ce=`number expected, ${se} found`;return Bl(o)&&void 0===u&&(Ce+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pe(q.key,be,Ce)]}return"categorical"!==u||"number"!==se||isFinite(oe)&&Math.floor(oe)===oe?"categorical"!==u&&"number"===se&&void 0!==_&&oe<_?[new Pe(q.key,be,"stop domain values must appear in ascending order")]:(_=oe,"categorical"===u&&oe in C?[new Pe(q.key,be,"stop domain values must be unique")]:(C[oe]=!0,[])):[new Pe(q.key,be,`integer expected, found ${oe}`)]}}function qa(l){const o=("property"===l.expressionContext?rd:Ga)(ds(l.value),l.valueSpec);if("error"===o.result)return o.value.map(f=>new Pe(`${l.key}${f.key}`,l.value,f.message));const u=o.value.expression||o.value._styleExpression.expression;if("property"===l.expressionContext&&"text-font"===l.propertyKey&&!u.outputDefined())return[new Pe(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===l.expressionContext&&"layout"===l.propertyType&&!$a(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===l.expressionContext&&!$a(u))return[new Pe(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&0===l.expressionContext.indexOf("cluster")){if(!sa(u,["zoom","feature-state"]))return[new Pe(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===l.expressionContext&&!Fu(u))return[new Pe(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function li(l){const o=l.key,u=l.value,f=l.valueSpec,_=[];return Array.isArray(f.values)?-1===f.values.indexOf(Vn(u))&&_.push(new Pe(o,u,`expected one of [${f.values.join(", ")}], ${JSON.stringify(u)} found`)):-1===Object.keys(f.values).indexOf(Vn(u))&&_.push(new Pe(o,u,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(u)} found`)),_}function qu(l){if(!0===l||!1===l)return!0;if(!Array.isArray(l)||0===l.length)return!1;switch(l[0]){case"has":return l.length>=2&&"$id"!==l[1]&&"$type"!==l[1];case"in":return l.length>=3&&("string"!=typeof l[1]||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==l.length||Array.isArray(l[1])||Array.isArray(l[2]);case"any":case"all":for(const o of l.slice(1))if(!qu(o)&&"boolean"!=typeof o)return!1;return!0;default:return!0}}const zf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ot(l){if(null==l)return{filter:()=>!0,needGeometry:!1};qu(l)||(l=Kr(l));const o=Ga(l,zf);if("error"===o.result)throw new Error(o.value.map(u=>`${u.key}: ${u.message}`).join(", "));return{filter:(u,f,_)=>o.value.evaluate(u,f,{},_),needGeometry:Lt(l)}}function Hi(l,o){return lo?1:0}function Lt(l){if(!Array.isArray(l))return!1;if("within"===l[0])return!0;for(let o=1;o"===o||"<="===o||">="===o?kt(l[1],l[2],o):"any"===o?(u=l.slice(1),["any"].concat(u.map(Kr))):"all"===o?["all"].concat(l.slice(1).map(Kr)):"none"===o?["all"].concat(l.slice(1).map(Kr).map(nn)):"in"===o?Bs(l[1],l.slice(2)):"!in"===o?nn(Bs(l[1],l.slice(2))):"has"===o?cn(l[1]):"!has"===o?nn(cn(l[1])):"within"!==o||l;var u}function kt(l,o,u){switch(l){case"$type":return[`filter-type-${u}`,o];case"$id":return[`filter-id-${u}`,o];default:return[`filter-${u}`,l,o]}}function Bs(l,o){if(0===o.length)return!1;switch(l){case"$type":return["filter-type-in",["literal",o]];case"$id":return["filter-id-in",["literal",o]];default:return o.length>200&&!o.some(u=>typeof u!=typeof o[0])?["filter-in-large",l,["literal",o.sort(Hi)]]:["filter-in-small",l,["literal",o]]}}function cn(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function nn(l){return["!",l]}function ut(l){return qu(ds(l.value))?qa(Vi({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wt(l)}function Wt(l){const o=l.value,u=l.key;if("array"!==Un(o))return[new Pe(u,o,`array expected, ${Un(o)} found`)];const f=l.styleSpec;let _,x=[];if(o.length<1)return[new Pe(u,o,"filter array must have at least 1 element")];switch(x=x.concat(li({key:`${u}[0]`,value:o[0],valueSpec:f.filter_operator,style:l.style,styleSpec:l.styleSpec})),Vn(o[0])){case"<":case"<=":case">":case">=":o.length>=2&&"$type"===Vn(o[1])&&x.push(new Pe(u,o,`"$type" cannot be use with operator "${o[0]}"`));case"==":case"!=":3!==o.length&&x.push(new Pe(u,o,`filter array for operator "${o[0]}" must have 3 elements`));case"in":case"!in":o.length>=2&&(_=Un(o[1]),"string"!==_&&x.push(new Pe(`${u}[1]`,o[1],`string expected, ${_} found`)));for(let C=2;C{F in u&&o.push(new Pe(f,u[F],`"${F}" is prohibited for ref layers`))}),_.layers.forEach(F=>{Vn(F.id)===M&&(A=F)}),A?A.ref?o.push(new Pe(f,u.ref,"ref cannot reference another ref layer")):C=Vn(A.type):o.push(new Pe(f,u.ref,`ref layer "${M}" not found`))}else if("background"!==C)if(u.source){const A=_.sources&&_.sources[u.source],F=A&&Vn(A.type);A?"vector"===F&&"raster"===C?o.push(new Pe(f,u.source,`layer "${u.id}" requires a raster source`)):"raster"===F&&"raster"!==C?o.push(new Pe(f,u.source,`layer "${u.id}" requires a vector source`)):"vector"!==F||u["source-layer"]?"raster-dem"===F&&"hillshade"!==C?o.push(new Pe(f,u.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==C||!u.paint||!u.paint["line-gradient"]||"geojson"===F&&A.lineMetrics||o.push(new Pe(f,u,`layer "${u.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new Pe(f,u,`layer "${u.id}" must specify a "source-layer"`)):o.push(new Pe(f,u.source,`source "${u.source}" not found`))}else o.push(new Pe(f,u,'missing required property "source"'));return o=o.concat(ko({key:f,value:u,valueSpec:x.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${f}.type`,value:u.type,valueSpec:x.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:u,objectKey:"type"}),filter:ut,layout:A=>ko({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>ua(Vi({layerType:C},F))}}),paint:A=>ko({layer:u,key:A.key,value:A.value,style:A.style,styleSpec:A.styleSpec,validateSpec:A.validateSpec,objectElementValidators:{"*":F=>Gi(Vi({layerType:C},F))}})}})),o}function qi(l){const o=l.value,u=l.key,f=Un(o);return"string"!==f?[new Pe(u,o,`string expected, ${f} found`)]:[]}const _r={promoteId:function({key:l,value:o}){if("string"===Un(o))return qi({key:l,value:o});{const u=[];for(const f in o)u.push(...qi({key:`${l}.${f}`,value:o[f]}));return u}}};function Za(l){const o=l.value,u=l.key,f=l.styleSpec,_=l.style,x=l.validateSpec;if(!o.type)return[new Pe(u,o,'"type" is required')];const C=Vn(o.type);let M;switch(C){case"vector":case"raster":case"raster-dem":return M=ko({key:u,value:o,valueSpec:f[`source_${C.replace("-","_")}`],style:l.style,styleSpec:f,objectElementValidators:_r,validateSpec:x}),M;case"geojson":if(M=ko({key:u,value:o,valueSpec:f.source_geojson,style:_,styleSpec:f,validateSpec:x,objectElementValidators:_r}),o.cluster)for(const A in o.clusterProperties){const[F,O]=o.clusterProperties[A],B="string"==typeof F?[F,["accumulated"],["get",A]]:F;M.push(...qa({key:`${u}.${A}.map`,value:O,validateSpec:x,expressionContext:"cluster-map"})),M.push(...qa({key:`${u}.${A}.reduce`,value:B,validateSpec:x,expressionContext:"cluster-reduce"}))}return M;case"video":return ko({key:u,value:o,valueSpec:f.source_video,style:_,validateSpec:x,styleSpec:f});case"image":return ko({key:u,value:o,valueSpec:f.source_image,style:_,validateSpec:x,styleSpec:f});case"canvas":return[new Pe(u,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return li({key:`${u}.type`,value:o.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,validateSpec:x,styleSpec:f})}}function Wa(l){const o=l.value,u=l.styleSpec,f=u.light,_=l.style;let x=[];const C=Un(o);if(void 0===o)return x;if("object"!==C)return x=x.concat([new Pe("light",o,`object expected, ${C} found`)]),x;for(const M in o){const A=M.match(/^(.*)-transition$/);x=x.concat(A&&f[A[1]]&&f[A[1]].transition?l.validateSpec({key:M,value:o[M],valueSpec:u.transition,validateSpec:l.validateSpec,style:_,styleSpec:u}):f[M]?l.validateSpec({key:M,value:o[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,o[M],`unknown property "${M}"`)])}return x}function Xt(l){const o=l.value,u=l.styleSpec,f=u.terrain,_=l.style;let x=[];const C=Un(o);if(void 0===o)return x;if("object"!==C)return x=x.concat([new Pe("terrain",o,`object expected, ${C} found`)]),x;for(const M in o)x=x.concat(f[M]?l.validateSpec({key:M,value:o[M],valueSpec:f[M],validateSpec:l.validateSpec,style:_,styleSpec:u}):[new Pe(M,o[M],`unknown property "${M}"`)]);return x}function Vc(l){let o=[];const u=l.value,f=l.key;if(Array.isArray(u)){const _=[],x=[];for(const C in u)u[C].id&&_.includes(u[C].id)&&o.push(new Pe(f,u,`all the sprites' ids must be unique, but ${u[C].id} is duplicated`)),_.push(u[C].id),u[C].url&&x.includes(u[C].url)&&o.push(new Pe(f,u,`all the sprites' URLs must be unique, but ${u[C].url} is duplicated`)),x.push(u[C].url),o=o.concat(ko({key:`${f}[${C}]`,value:u[C],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return o}return qi({key:f,value:u})}const Xa={"*":()=>[],array:zs,boolean:function(l){const o=l.value,u=l.key,f=Un(o);return"boolean"!==f?[new Pe(u,o,`boolean expected, ${f} found`)]:[]},number:id,color:function(l){const o=l.key,u=l.value,f=Un(u);return"string"!==f?[new Pe(o,u,`color expected, ${f} found`)]:null===ia(u)?[new Pe(o,u,`color expected, "${u}" found`)]:[]},constants:Na,enum:li,filter:ut,function:od,layer:jr,object:ko,source:Za,light:Wa,terrain:Xt,string:qi,formatted:function(l){return 0===qi(l).length?[]:qa(l)},resolvedImage:function(l){return 0===qi(l).length?[]:qa(l)},padding:function(l){const o=l.key,u=l.value;if("array"===Un(u)){if(u.length<1||u.length>4)return[new Pe(o,u,`padding requires 1 to 4 values; ${u.length} values found`)];const f={type:"number"};let _=[];for(let x=0;x[]}})),l.constants&&(u=u.concat(Na({key:"constants",value:l.constants,style:l,styleSpec:o,validateSpec:Ya}))),Ka(u)}function ho(l){return function(o){return l({...o,validateSpec:Ya})}}function Ka(l){return[].concat(l).sort((o,u)=>o.line-u.line)}function Hr(l){return function(...o){return Ka(l.apply(this,o))}}ur.source=Hr(ho(Za)),ur.sprite=Hr(ho(Vc)),ur.glyphs=Hr(ho(ha)),ur.light=Hr(ho(Wa)),ur.terrain=Hr(ho(Xt)),ur.layer=Hr(ho(jr)),ur.filter=Hr(ho(ut)),ur.paintProperty=Hr(ho(Gi)),ur.layoutProperty=Hr(ho(ua));const Yo=ur,sd=Yo.light,$n=Yo.paintProperty,Um=Yo.layoutProperty;function ad(l,o){let u=!1;if(o&&o.length)for(const f of o)l.fire(new yr(new Error(f.message))),u=!0;return u}class Vs{constructor(o,u,f){const _=this.cells=[];if(o instanceof ArrayBuffer){this.arrayBuffer=o;const C=new Int32Array(this.arrayBuffer);o=C[0],this.d=(u=C[1])+2*(f=C[2]);for(let A=0;A=B[W+0]&&_>=B[W+1])?(M[q]=!0,C.push(O[q])):M[q]=!1}}}}_forEachCell(o,u,f,_,x,C,M,A){const F=this._convertToCellCoord(o),O=this._convertToCellCoord(u),B=this._convertToCellCoord(f),H=this._convertToCellCoord(_);for(let q=F;q<=B;q++)for(let W=O;W<=H;W++){const se=this.d*W+q;if((!A||A(this._convertFromCellCoord(q),this._convertFromCellCoord(W),this._convertFromCellCoord(q+1),this._convertFromCellCoord(W+1)))&&x.call(this,o,u,f,_,se,C,M,A))return}}_convertFromCellCoord(o){return(o-this.padding)/this.scale}_convertToCellCoord(o){return Math.max(0,Math.min(this.d-1,Math.floor(o*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const o=this.cells,u=3+this.cells.length+1+1;let f=0;for(let C=0;C=0)continue;const C=l[x];_[x]=gs[f].shallow.indexOf(x)>=0?C:fo(C,o)}l instanceof Error&&(_.message=l.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==f&&(_.$name=f),_}throw new Error("can't serialize object of type "+typeof l)}function Er(l){if(null==l||"boolean"==typeof l||"number"==typeof l||"string"==typeof l||l instanceof Boolean||l instanceof Number||l instanceof String||l instanceof Date||l instanceof RegExp||l instanceof Blob||da(l)||oo(l)||ArrayBuffer.isView(l)||l instanceof ImageData)return l;if(Array.isArray(l))return l.map(Er);if("object"==typeof l){const o=l.$name||"Object";if(!gs[o])throw new Error(`can't deserialize unregistered class ${o}`);const{klass:u}=gs[o];if(!u)throw new Error(`can't deserialize unregistered class ${o}`);if(u.deserialize)return u.deserialize(l);const f=Object.create(u.prototype);for(const _ of Object.keys(l)){if("$name"===_)continue;const x=l[_];f[_]=gs[o].shallow.indexOf(_)>=0?x:Er(x)}return f}throw new Error("can't deserialize object of type "+typeof l)}class Bf{constructor(){this.first=!0}update(o,u){const f=Math.floor(o);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=o,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=u):this.lastFloorZooml>=128&&l<=255,Arabic:l=>l>=1536&&l<=1791,"Arabic Supplement":l=>l>=1872&&l<=1919,"Arabic Extended-A":l=>l>=2208&&l<=2303,"Hangul Jamo":l=>l>=4352&&l<=4607,"Unified Canadian Aboriginal Syllabics":l=>l>=5120&&l<=5759,Khmer:l=>l>=6016&&l<=6143,"Unified Canadian Aboriginal Syllabics Extended":l=>l>=6320&&l<=6399,"General Punctuation":l=>l>=8192&&l<=8303,"Letterlike Symbols":l=>l>=8448&&l<=8527,"Number Forms":l=>l>=8528&&l<=8591,"Miscellaneous Technical":l=>l>=8960&&l<=9215,"Control Pictures":l=>l>=9216&&l<=9279,"Optical Character Recognition":l=>l>=9280&&l<=9311,"Enclosed Alphanumerics":l=>l>=9312&&l<=9471,"Geometric Shapes":l=>l>=9632&&l<=9727,"Miscellaneous Symbols":l=>l>=9728&&l<=9983,"Miscellaneous Symbols and Arrows":l=>l>=11008&&l<=11263,"CJK Radicals Supplement":l=>l>=11904&&l<=12031,"Kangxi Radicals":l=>l>=12032&&l<=12255,"Ideographic Description Characters":l=>l>=12272&&l<=12287,"CJK Symbols and Punctuation":l=>l>=12288&&l<=12351,Hiragana:l=>l>=12352&&l<=12447,Katakana:l=>l>=12448&&l<=12543,Bopomofo:l=>l>=12544&&l<=12591,"Hangul Compatibility Jamo":l=>l>=12592&&l<=12687,Kanbun:l=>l>=12688&&l<=12703,"Bopomofo Extended":l=>l>=12704&&l<=12735,"CJK Strokes":l=>l>=12736&&l<=12783,"Katakana Phonetic Extensions":l=>l>=12784&&l<=12799,"Enclosed CJK Letters and Months":l=>l>=12800&&l<=13055,"CJK Compatibility":l=>l>=13056&&l<=13311,"CJK Unified Ideographs Extension A":l=>l>=13312&&l<=19903,"Yijing Hexagram Symbols":l=>l>=19904&&l<=19967,"CJK Unified Ideographs":l=>l>=19968&&l<=40959,"Yi Syllables":l=>l>=40960&&l<=42127,"Yi Radicals":l=>l>=42128&&l<=42191,"Hangul Jamo Extended-A":l=>l>=43360&&l<=43391,"Hangul Syllables":l=>l>=44032&&l<=55215,"Hangul Jamo Extended-B":l=>l>=55216&&l<=55295,"Private Use Area":l=>l>=57344&&l<=63743,"CJK Compatibility Ideographs":l=>l>=63744&&l<=64255,"Arabic Presentation Forms-A":l=>l>=64336&&l<=65023,"Vertical Forms":l=>l>=65040&&l<=65055,"CJK Compatibility Forms":l=>l>=65072&&l<=65103,"Small Form Variants":l=>l>=65104&&l<=65135,"Arabic Presentation Forms-B":l=>l>=65136&&l<=65279,"Halfwidth and Fullwidth Forms":l=>l>=65280&&l<=65519};function po(l){for(const o of l)if(Vl(o.charCodeAt(0)))return!0;return!1}function ld(l){for(const o of l)if(!Zu(o.charCodeAt(0)))return!1;return!0}function Zu(l){return!(Xe.Arabic(l)||Xe["Arabic Supplement"](l)||Xe["Arabic Extended-A"](l)||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l))}function Vl(l){return!(746!==l&&747!==l&&(l<4352||!(Xe["Bopomofo Extended"](l)||Xe.Bopomofo(l)||Xe["CJK Compatibility Forms"](l)&&!(l>=65097&&l<=65103)||Xe["CJK Compatibility Ideographs"](l)||Xe["CJK Compatibility"](l)||Xe["CJK Radicals Supplement"](l)||Xe["CJK Strokes"](l)||!(!Xe["CJK Symbols and Punctuation"](l)||l>=12296&&l<=12305||l>=12308&&l<=12319||12336===l)||Xe["CJK Unified Ideographs Extension A"](l)||Xe["CJK Unified Ideographs"](l)||Xe["Enclosed CJK Letters and Months"](l)||Xe["Hangul Compatibility Jamo"](l)||Xe["Hangul Jamo Extended-A"](l)||Xe["Hangul Jamo Extended-B"](l)||Xe["Hangul Jamo"](l)||Xe["Hangul Syllables"](l)||Xe.Hiragana(l)||Xe["Ideographic Description Characters"](l)||Xe.Kanbun(l)||Xe["Kangxi Radicals"](l)||Xe["Katakana Phonetic Extensions"](l)||Xe.Katakana(l)&&12540!==l||!(!Xe["Halfwidth and Fullwidth Forms"](l)||65288===l||65289===l||65293===l||l>=65306&&l<=65310||65339===l||65341===l||65343===l||l>=65371&&l<=65503||65507===l||l>=65512&&l<=65519)||!(!Xe["Small Form Variants"](l)||l>=65112&&l<=65118||l>=65123&&l<=65126)||Xe["Unified Canadian Aboriginal Syllabics"](l)||Xe["Unified Canadian Aboriginal Syllabics Extended"](l)||Xe["Vertical Forms"](l)||Xe["Yijing Hexagram Symbols"](l)||Xe["Yi Syllables"](l)||Xe["Yi Radicals"](l))))}function Po(l){return!(Vl(l)||(o=l,Xe["Latin-1 Supplement"](o)&&(167===o||169===o||174===o||177===o||188===o||189===o||190===o||215===o||247===o)||Xe["General Punctuation"](o)&&(8214===o||8224===o||8225===o||8240===o||8241===o||8251===o||8252===o||8258===o||8263===o||8264===o||8265===o||8273===o)||Xe["Letterlike Symbols"](o)||Xe["Number Forms"](o)||Xe["Miscellaneous Technical"](o)&&(o>=8960&&o<=8967||o>=8972&&o<=8991||o>=8996&&o<=9e3||9003===o||o>=9085&&o<=9114||o>=9150&&o<=9165||9167===o||o>=9169&&o<=9179||o>=9186&&o<=9215)||Xe["Control Pictures"](o)&&9251!==o||Xe["Optical Character Recognition"](o)||Xe["Enclosed Alphanumerics"](o)||Xe["Geometric Shapes"](o)||Xe["Miscellaneous Symbols"](o)&&!(o>=9754&&o<=9759)||Xe["Miscellaneous Symbols and Arrows"](o)&&(o>=11026&&o<=11055||o>=11088&&o<=11097||o>=11192&&o<=11243)||Xe["CJK Symbols and Punctuation"](o)||Xe.Katakana(o)||Xe["Private Use Area"](o)||Xe["CJK Compatibility Forms"](o)||Xe["Small Form Variants"](o)||Xe["Halfwidth and Fullwidth Forms"](o)||8734===o||8756===o||8757===o||o>=9984&&o<=10087||o>=10102&&o<=10131||65532===o||65533===o));var o}function Uc(l){return l>=1424&&l<=2303||Xe["Arabic Presentation Forms-A"](l)||Xe["Arabic Presentation Forms-B"](l)}function cd(l,o){return!(!o&&Uc(l)||l>=2304&&l<=3583||l>=3840&&l<=4255||Xe.Khmer(l))}function Ro(l){for(const o of l)if(Uc(o.charCodeAt(0)))return!0;return!1}const Ul="deferred",Vf="loading",Uf="loaded";let $f=null,mo="unavailable",Us=null;const $m=function(l){l&&"string"==typeof l&&l.indexOf("NetworkError")>-1&&(mo="error"),$f&&$f(l)};function Wu(){jf.fire(new na("pluginStateChange",{pluginStatus:mo,pluginURL:Us}))}const jf=new tr,$l=function(){return mo},jm=function(){if(mo!==Ul||!Us)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");mo=Vf,Wu(),Us&&Oa({url:Us},l=>{l?$m(l):(mo=Uf,Wu())})},go={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>mo===Uf||null!=go.applyArabicShaping,isLoading:()=>mo===Vf,setState(l){if(!To())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");mo=l.pluginStatus,Us=l.pluginURL},isParsed(){if(!To())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=go.applyArabicShaping&&null!=go.processBidirectionalText&&null!=go.processStyledBidirectionalText},getPluginURL(){if(!To())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Us}};class hr{constructor(o,u){this.zoom=o,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Bf,this.transition={})}isSupportedScript(o){return function(u,f){for(const _ of u)if(!cd(_.charCodeAt(0),f))return!1;return!0}(o,go.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const o=this.zoom,u=o-Math.floor(o),f=this.crossFadingFactor();return o>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*u}}}class $c{constructor(o,u){this.property=o,this.value=u,this.expression=function(f,_){if(Wo(f))return new Ao(f,_);if(Cn(f)){const x=rd(f,_);if("error"===x.result)throw new Error(x.value.map(C=>`${C.key}: ${C.message}`).join(", "));return x.value}{let x=f;return"color"===_.type&&"string"==typeof f?x=Sn.parse(f):"padding"!==_.type||"number"!=typeof f&&!Array.isArray(f)||(x=$r.parse(f)),{kind:"constant",evaluate:()=>x}}}(void 0===u?o.specification.default:u,o.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(o,u,f){return this.property.possiblyEvaluate(this,o,u,f)}}class ud{constructor(o){this.property=o,this.value=new $c(o,void 0)}transitioned(o,u){return new Yu(this.property,this.value,u,Bi({},o.transition,this.transition),o.now)}untransitioned(){return new Yu(this.property,this.value,null,{},0)}}class Xu{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitionablePropertyValues)}getValue(o){return Ci(this._values[o].value.value)}setValue(o,u){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new ud(this._values[o].property)),this._values[o].value=new $c(this._values[o].property,null===u?void 0:Ci(u))}getTransition(o){return Ci(this._values[o].transition)}setTransition(o,u){Object.prototype.hasOwnProperty.call(this._values,o)||(this._values[o]=new ud(this._values[o].property)),this._values[o].transition=Ci(u)||void 0}serialize(){const o={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(o[u]=f);const _=this.getTransition(u);void 0!==_&&(o[`${u}-transition`]=_)}return o}transitioned(o,u){const f=new hd(this._properties);for(const _ of Object.keys(this._values))f._values[_]=this._values[_].transitioned(o,u._values[_]);return f}untransitioned(){const o=new hd(this._properties);for(const u of Object.keys(this._values))o._values[u]=this._values[u].untransitioned();return o}}class Yu{constructor(o,u,f,_,x){this.property=o,this.value=u,this.begin=x+_.delay||0,this.end=this.begin+_.duration||0,o.specification.transition&&(_.delay||_.duration)&&(this.prior=f)}possiblyEvaluate(o,u,f){const _=o.now||0,x=this.value.possiblyEvaluate(o,u,f),C=this.prior;if(C){if(_>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(_=1)return 1;const F=A*A,O=F*A;return 4*(A<.5?O:3*(A-F)+O-.75)}(M))}}return x}}class hd{constructor(o){this._properties=o,this._values=Object.create(o.defaultTransitioningPropertyValues)}possiblyEvaluate(o,u,f){const _=new _s(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(o,u,f);return _}hasTransition(){for(const o of Object.keys(this._values))if(this._values[o].prior)return!0;return!1}}class dd{constructor(o){this._properties=o,this._values=Object.create(o.defaultPropertyValues)}getValue(o){return Ci(this._values[o].value)}setValue(o,u){this._values[o]=new $c(this._values[o].property,null===u?void 0:Ci(u))}serialize(){const o={};for(const u of Object.keys(this._values)){const f=this.getValue(u);void 0!==f&&(o[u]=f)}return o}possiblyEvaluate(o,u,f){const _=new _s(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(o,u,f);return _}}class ys{constructor(o,u,f){this.property=o,this.value=u,this.parameters=f}isConstant(){return"constant"===this.value.kind}constantOr(o){return"constant"===this.value.kind?this.value.value:o}evaluate(o,u,f,_){return this.property.evaluate(this.value,this.parameters,o,u,f,_)}}class _s{constructor(o){this._properties=o,this._values=Object.create(o.defaultPossiblyEvaluatedValues)}get(o){return this._values[o]}}class wt{constructor(o){this.specification=o}possiblyEvaluate(o,u){if(o.isDataDriven())throw new Error("Value should not be data driven");return o.expression.evaluate(u)}interpolate(o,u,f){const _=Mn[this.specification.type];return _?_(o,u,f):o}}class yt{constructor(o,u){this.specification=o,this.overrides=u}possiblyEvaluate(o,u,f,_){return new ys(this,"constant"===o.expression.kind||"camera"===o.expression.kind?{kind:"constant",value:o.expression.evaluate(u,null,{},f,_)}:o.expression,u)}interpolate(o,u,f){if("constant"!==o.value.kind||"constant"!==u.value.kind)return o;if(void 0===o.value.value||void 0===u.value.value)return new ys(this,{kind:"constant",value:void 0},o.parameters);const _=Mn[this.specification.type];return _?new ys(this,{kind:"constant",value:_(o.value.value,u.value.value,f)},o.parameters):o}evaluate(o,u,f,_,x,C){return"constant"===o.kind?o.value:o.evaluate(u,f,_,x,C)}}class Ja extends yt{possiblyEvaluate(o,u,f,_){if(void 0===o.value)return new ys(this,{kind:"constant",value:void 0},u);if("constant"===o.expression.kind){const x=o.expression.evaluate(u,null,{},f,_),C="resolvedImage"===o.property.specification.type&&"string"!=typeof x?x.name:x,M=this._calculate(C,C,C,u);return new ys(this,{kind:"constant",value:M},u)}if("camera"===o.expression.kind){const x=this._calculate(o.expression.evaluate({zoom:u.zoom-1}),o.expression.evaluate({zoom:u.zoom}),o.expression.evaluate({zoom:u.zoom+1}),u);return new ys(this,{kind:"constant",value:x},u)}return new ys(this,o.expression,u)}evaluate(o,u,f,_,x,C){if("source"===o.kind){const M=o.evaluate(u,f,_,x,C);return this._calculate(M,M,M,u)}return"composite"===o.kind?this._calculate(o.evaluate({zoom:Math.floor(u.zoom)-1},f,_),o.evaluate({zoom:Math.floor(u.zoom)},f,_),o.evaluate({zoom:Math.floor(u.zoom)+1},f,_),u):o.value}_calculate(o,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:o,to:u}:{from:f,to:u}}interpolate(o){return o}}class fd{constructor(o){this.specification=o}possiblyEvaluate(o,u,f,_){if(void 0!==o.value){if("constant"===o.expression.kind){const x=o.expression.evaluate(u,null,{},f,_);return this._calculate(x,x,x,u)}return this._calculate(o.expression.evaluate(new hr(Math.floor(u.zoom-1),u)),o.expression.evaluate(new hr(Math.floor(u.zoom),u)),o.expression.evaluate(new hr(Math.floor(u.zoom+1),u)),u)}}_calculate(o,u,f,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:o,to:u}:{from:f,to:u}}interpolate(o){return o}}class pd{constructor(o){this.specification=o}possiblyEvaluate(o,u,f,_){return!!o.expression.evaluate(u,null,{},f,_)}interpolate(){return!1}}class Si{constructor(o){this.properties=o,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const u in o){const f=o[u];f.specification.overridable&&this.overridableProperties.push(u);const _=this.defaultPropertyValues[u]=new $c(f,void 0),x=this.defaultTransitionablePropertyValues[u]=new ud(f);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=_.possiblyEvaluate({})}}}ct("DataDrivenProperty",yt),ct("DataConstantProperty",wt),ct("CrossFadedDataDrivenProperty",Ja),ct("CrossFadedProperty",fd),ct("ColorRampProperty",pd);const jc="-transition";class Ko extends tr{constructor(o,u){if(super(),this.id=o.id,this.type=o.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==o.type&&(this.metadata=o.metadata,this.minzoom=o.minzoom,this.maxzoom=o.maxzoom,"background"!==o.type&&(this.source=o.source,this.sourceLayer=o["source-layer"],this.filter=o.filter),u.layout&&(this._unevaluatedLayout=new dd(u.layout)),u.paint)){this._transitionablePaint=new Xu(u.paint);for(const f in o.paint)this.setPaintProperty(f,o.paint[f],{validate:!1});for(const f in o.layout)this.setLayoutProperty(f,o.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _s(u.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(o){return"visibility"===o?this.visibility:this._unevaluatedLayout.getValue(o)}setLayoutProperty(o,u,f={}){null!=u&&this._validate(Um,`layers.${this.id}.layout.${o}`,o,u,f)||("visibility"!==o?this._unevaluatedLayout.setValue(o,u):this.visibility=u)}getPaintProperty(o){return o.endsWith(jc)?this._transitionablePaint.getTransition(o.slice(0,-jc.length)):this._transitionablePaint.getValue(o)}setPaintProperty(o,u,f={}){if(null!=u&&this._validate($n,`layers.${this.id}.paint.${o}`,o,u,f))return!1;if(o.endsWith(jc))return this._transitionablePaint.setTransition(o.slice(0,-jc.length),u||void 0),!1;{const _=this._transitionablePaint._values[o],x="cross-faded-data-driven"===_.property.specification["property-type"],C=_.value.isDataDriven(),M=_.value;this._transitionablePaint.setValue(o,u),this._handleSpecialPaintPropertyUpdate(o);const A=this._transitionablePaint._values[o].value;return A.isDataDriven()||C||x||this._handleOverridablePaintPropertyUpdate(o,M,A)}}_handleSpecialPaintPropertyUpdate(o){}_handleOverridablePaintPropertyUpdate(o,u,f){return!1}isHidden(o){return!!(this.minzoom&&o=this.maxzoom)||"none"===this.visibility}updateTransitions(o){this._transitioningPaint=this._transitionablePaint.transitioned(o,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(o,u){o.getCrossfadeParameters&&(this._crossfadeParameters=o.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(o,void 0,u)),this.paint=this._transitioningPaint.possiblyEvaluate(o,void 0,u)}serialize(){const o={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&&(o.layout=o.layout||{},o.layout.visibility=this.visibility),Al(o,(u,f)=>!(void 0===u||"layout"===f&&!Object.keys(u).length||"paint"===f&&!Object.keys(u).length))}_validate(o,u,f,_,x={}){return(!x||!1!==x.validate)&&ad(this,o.call(Yo,{key:u,layerType:this.type,objectKey:f,value:_,styleSpec:Ae,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const o in this.paint._values){const u=this.paint.get(o);if(u instanceof ys&&Bl(u.property.specification)&&("source"===u.value.kind||"composite"===u.value.kind)&&u.value.isStateDependent)return!0}return!1}}const md={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ku{constructor(o,u){this._structArray=o,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Tn{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(o,u){return o._trim(),u&&(o.isTransferred=!0,u.push(o.arrayBuffer)),{length:o.length,arrayBuffer:o.arrayBuffer}}static deserialize(o){const u=Object.create(this.prototype);return u.arrayBuffer=o.arrayBuffer,u.length=o.length,u.capacity=o.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u}_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(o){this.reserve(o),this.length=o}reserve(o){if(o>this.capacity){this.capacity=Math.max(o,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Dr(l,o=1){let u=0,f=0;return{members:l.map(_=>{const x=md[_.type].BYTES_PER_ELEMENT,C=u=Hf(u,Math.max(o,x)),M=_.components||1;return f=Math.max(f,x),u+=x*M,{name:_.name,type:_.type,components:M,offset:C}}),size:Hf(u,Math.max(f,o)),alignment:o}}function Hf(l,o){return Math.ceil(l/o)*o}class Qa extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u){const f=this.length;return this.resize(f+1),this.emplace(f,o,u)}emplace(o,u,f){const _=2*o;return this.int16[_+0]=u,this.int16[_+1]=f,o}}Qa.prototype.bytesPerElement=4,ct("StructArrayLayout2i4",Qa);class Ju extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,o,u,f)}emplace(o,u,f,_){const x=3*o;return this.int16[x+0]=u,this.int16[x+1]=f,this.int16[x+2]=_,o}}Ju.prototype.bytesPerElement=6,ct("StructArrayLayout3i6",Ju);class Hc extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,o,u,f,_)}emplace(o,u,f,_,x){const C=4*o;return this.int16[C+0]=u,this.int16[C+1]=f,this.int16[C+2]=_,this.int16[C+3]=x,o}}Hc.prototype.bytesPerElement=8,ct("StructArrayLayout4i8",Hc);class Sr extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,o,u,f,_,x,C)}emplace(o,u,f,_,x,C,M){const A=6*o;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=C,this.int16[A+5]=M,o}}Sr.prototype.bytesPerElement=12,ct("StructArrayLayout2i4i12",Sr);class Gc extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,o,u,f,_,x,C)}emplace(o,u,f,_,x,C,M){const A=4*o,F=8*o;return this.int16[A+0]=u,this.int16[A+1]=f,this.uint8[F+4]=_,this.uint8[F+5]=x,this.uint8[F+6]=C,this.uint8[F+7]=M,o}}Gc.prototype.bytesPerElement=8,ct("StructArrayLayout2i4ub8",Gc);class Qu extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u){const f=this.length;return this.resize(f+1),this.emplace(f,o,u)}emplace(o,u,f){const _=2*o;return this.float32[_+0]=u,this.float32[_+1]=f,o}}Qu.prototype.bytesPerElement=8,ct("StructArrayLayout2f8",Qu);class jl extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,f,_,x,C,M,A,F,O){const B=this.length;return this.resize(B+1),this.emplace(B,o,u,f,_,x,C,M,A,F,O)}emplace(o,u,f,_,x,C,M,A,F,O,B){const H=10*o;return this.uint16[H+0]=u,this.uint16[H+1]=f,this.uint16[H+2]=_,this.uint16[H+3]=x,this.uint16[H+4]=C,this.uint16[H+5]=M,this.uint16[H+6]=A,this.uint16[H+7]=F,this.uint16[H+8]=O,this.uint16[H+9]=B,o}}jl.prototype.bytesPerElement=20,ct("StructArrayLayout10ui20",jl);class Mi extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,f,_,x,C,M,A,F,O,B,H){const q=this.length;return this.resize(q+1),this.emplace(q,o,u,f,_,x,C,M,A,F,O,B,H)}emplace(o,u,f,_,x,C,M,A,F,O,B,H,q){const W=12*o;return this.int16[W+0]=u,this.int16[W+1]=f,this.int16[W+2]=_,this.int16[W+3]=x,this.uint16[W+4]=C,this.uint16[W+5]=M,this.uint16[W+6]=A,this.uint16[W+7]=F,this.int16[W+8]=O,this.int16[W+9]=B,this.int16[W+10]=H,this.int16[W+11]=q,o}}Mi.prototype.bytesPerElement=24,ct("StructArrayLayout4i4ui4i24",Mi);class eh extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,o,u,f)}emplace(o,u,f,_){const x=3*o;return this.float32[x+0]=u,this.float32[x+1]=f,this.float32[x+2]=_,o}}eh.prototype.bytesPerElement=12,ct("StructArrayLayout3f12",eh);class Hl extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(o){const u=this.length;return this.resize(u+1),this.emplace(u,o)}emplace(o,u){return this.uint32[1*o+0]=u,o}}Hl.prototype.bytesPerElement=4,ct("StructArrayLayout1ul4",Hl);class fa extends Tn{_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(o,u,f,_,x,C,M,A,F){const O=this.length;return this.resize(O+1),this.emplace(O,o,u,f,_,x,C,M,A,F)}emplace(o,u,f,_,x,C,M,A,F,O){const B=10*o,H=5*o;return this.int16[B+0]=u,this.int16[B+1]=f,this.int16[B+2]=_,this.int16[B+3]=x,this.int16[B+4]=C,this.int16[B+5]=M,this.uint32[H+3]=A,this.uint16[B+8]=F,this.uint16[B+9]=O,o}}fa.prototype.bytesPerElement=20,ct("StructArrayLayout6i1ul2ui20",fa);class Ti extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,f,_,x,C){const M=this.length;return this.resize(M+1),this.emplace(M,o,u,f,_,x,C)}emplace(o,u,f,_,x,C,M){const A=6*o;return this.int16[A+0]=u,this.int16[A+1]=f,this.int16[A+2]=_,this.int16[A+3]=x,this.int16[A+4]=C,this.int16[A+5]=M,o}}Ti.prototype.bytesPerElement=12,ct("StructArrayLayout2i2i2i12",Ti);class gd extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(o,u,f,_,x){const C=this.length;return this.resize(C+1),this.emplace(C,o,u,f,_,x)}emplace(o,u,f,_,x,C){const M=4*o,A=8*o;return this.float32[M+0]=u,this.float32[M+1]=f,this.float32[M+2]=_,this.int16[A+6]=x,this.int16[A+7]=C,o}}gd.prototype.bytesPerElement=16,ct("StructArrayLayout2f1f2i16",gd);class Gl extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,o,u,f,_)}emplace(o,u,f,_,x){const C=12*o,M=3*o;return this.uint8[C+0]=u,this.uint8[C+1]=f,this.float32[M+1]=_,this.float32[M+2]=x,o}}Gl.prototype.bytesPerElement=12,ct("StructArrayLayout2ub2f12",Gl);class th extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,o,u,f)}emplace(o,u,f,_){const x=3*o;return this.uint16[x+0]=u,this.uint16[x+1]=f,this.uint16[x+2]=_,o}}th.prototype.bytesPerElement=6,ct("StructArrayLayout3ui6",th);class vs extends Tn{_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(o,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be){const Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,o,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be)}emplace(o,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce){const me=24*o,Ee=12*o,$e=48*o;return this.int16[me+0]=u,this.int16[me+1]=f,this.uint16[me+2]=_,this.uint16[me+3]=x,this.uint32[Ee+2]=C,this.uint32[Ee+3]=M,this.uint32[Ee+4]=A,this.uint16[me+10]=F,this.uint16[me+11]=O,this.uint16[me+12]=B,this.float32[Ee+7]=H,this.float32[Ee+8]=q,this.uint8[$e+36]=W,this.uint8[$e+37]=se,this.uint8[$e+38]=oe,this.uint32[Ee+10]=be,this.int16[me+22]=Ce,o}}vs.prototype.bytesPerElement=48,ct("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",vs);class $s extends Tn{_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(o,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot){const it=this.length;return this.resize(it+1),this.emplace(it,o,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot)}emplace(o,u,f,_,x,C,M,A,F,O,B,H,q,W,se,oe,be,Ce,me,Ee,$e,Ve,gt,Ct,at,tt,Qe,ot,it){const Ge=34*o,Et=17*o;return this.int16[Ge+0]=u,this.int16[Ge+1]=f,this.int16[Ge+2]=_,this.int16[Ge+3]=x,this.int16[Ge+4]=C,this.int16[Ge+5]=M,this.int16[Ge+6]=A,this.int16[Ge+7]=F,this.uint16[Ge+8]=O,this.uint16[Ge+9]=B,this.uint16[Ge+10]=H,this.uint16[Ge+11]=q,this.uint16[Ge+12]=W,this.uint16[Ge+13]=se,this.uint16[Ge+14]=oe,this.uint16[Ge+15]=be,this.uint16[Ge+16]=Ce,this.uint16[Ge+17]=me,this.uint16[Ge+18]=Ee,this.uint16[Ge+19]=$e,this.uint16[Ge+20]=Ve,this.uint16[Ge+21]=gt,this.uint16[Ge+22]=Ct,this.uint32[Et+12]=at,this.float32[Et+13]=tt,this.float32[Et+14]=Qe,this.float32[Et+15]=ot,this.float32[Et+16]=it,o}}$s.prototype.bytesPerElement=68,ct("StructArrayLayout8i15ui1ul4f68",$s);class ql extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o){const u=this.length;return this.resize(u+1),this.emplace(u,o)}emplace(o,u){return this.float32[1*o+0]=u,o}}ql.prototype.bytesPerElement=4,ct("StructArrayLayout1f4",ql);class Vt extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,o,u,f)}emplace(o,u,f,_){const x=4*o;return this.uint32[2*o+0]=u,this.uint16[x+2]=f,this.uint16[x+3]=_,o}}Vt.prototype.bytesPerElement=8,ct("StructArrayLayout1ul2ui8",Vt);class nh extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o,u){const f=this.length;return this.resize(f+1),this.emplace(f,o,u)}emplace(o,u,f){const _=2*o;return this.uint16[_+0]=u,this.uint16[_+1]=f,o}}nh.prototype.bytesPerElement=4,ct("StructArrayLayout2ui4",nh);class yd extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(o){const u=this.length;return this.resize(u+1),this.emplace(u,o)}emplace(o,u){return this.uint16[1*o+0]=u,o}}yd.prototype.bytesPerElement=2,ct("StructArrayLayout1ui2",yd);class _d extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(o,u,f,_){const x=this.length;return this.resize(x+1),this.emplace(x,o,u,f,_)}emplace(o,u,f,_,x){const C=4*o;return this.float32[C+0]=u,this.float32[C+1]=f,this.float32[C+2]=_,this.float32[C+3]=x,o}}_d.prototype.bytesPerElement=16,ct("StructArrayLayout4f16",_d);class Gf extends Ku{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new It(this.anchorPointX,this.anchorPointY)}}Gf.prototype.size=20;class vd extends fa{get(o){return new Gf(this,o)}}ct("CollisionBoxArray",vd);class qc extends Ku{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(o){this._structArray.uint8[this._pos1+37]=o}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(o){this._structArray.uint8[this._pos1+38]=o}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(o){this._structArray.uint32[this._pos4+10]=o}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}qc.prototype.size=48;class bd extends vs{get(o){return new qc(this,o)}}ct("PlacedSymbolArray",bd);class rh extends Ku{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(o){this._structArray.uint32[this._pos4+12]=o}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}rh.prototype.size=68;class He extends $s{get(o){return new rh(this,o)}}ct("SymbolInstanceArray",He);class en extends ql{getoffsetX(o){return this.float32[1*o+0]}}ct("GlyphOffsetArray",en);class Zl extends Ju{getx(o){return this.int16[3*o+0]}gety(o){return this.int16[3*o+1]}gettileUnitDistanceFromAnchor(o){return this.int16[3*o+2]}}ct("SymbolLineVertexArray",Zl);class el extends Ku{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]}}el.prototype.size=8;class Rr extends Vt{get(o){return new el(this,o)}}ct("FeatureIndexArray",Rr);class ih extends Qa{}class js extends Qa{}class bs extends Qa{}class xd extends Sr{}class oh extends Gc{}class A_ extends Qu{}class pa extends jl{}class g extends Mi{}class s extends eh{}class h extends Hl{}class m extends Ti{}class y extends Gl{}class w extends th{}class S extends nh{}const I=Dr([{name:"a_pos",components:2,type:"Int16"}],4),{members:k}=I;class R{constructor(o=[]){this.segments=o}prepareSegment(o,u,f,_){let x=this.segments[this.segments.length-1];return o>R.MAX_VERTEX_ARRAY_LENGTH&&fn(`Max vertices per segment is ${R.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${o}`),(!x||x.vertexLength+o>R.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==_)&&(x={vertexOffset:u.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},void 0!==_&&(x.sortKey=_),this.segments.push(x)),x}get(){return this.segments}destroy(){for(const o of this.segments)for(const u in o.vaos)o.vaos[u].destroy()}static simpleSegment(o,u,f,_){return new R([{vertexOffset:o,primitiveOffset:u,vertexLength:f,primitiveLength:_,vaos:{},sortKey:0}])}}function z(l,o){return 256*(l=Zt(Math.floor(l),0,255))+Zt(Math.floor(o),0,255)}R.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ct("SegmentVector",R);const L=Dr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var j={},Q={get exports(){return j},set exports(l){j=l}},ee={};({get exports(){return ee},set exports(l){ee=l}}).exports=function(l,o){var u,f,_,x,C,M,A,F;for(f=l.length-(u=3&l.length),_=o,C=3432918353,M=461845907,F=0;F>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(A=0,u){case 3:A^=(255&l.charCodeAt(F+2))<<16;case 2:A^=(255&l.charCodeAt(F+1))<<8;case 1:_^=A=(65535&(A=(A=(65535&(A^=255&l.charCodeAt(F)))*C+(((A>>>16)*C&65535)<<16)&4294967295)<<15|A>>>17))*M+(((A>>>16)*M&65535)<<16)&4294967295}return _^=l.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Y={};({get exports(){return Y},set exports(l){Y=l}}).exports=function(l,o){for(var u,f=l.length,_=o^f,x=0;f>=4;)u=1540483477*(65535&(u=255&l.charCodeAt(x)|(255&l.charCodeAt(++x))<<8|(255&l.charCodeAt(++x))<<16|(255&l.charCodeAt(++x))<<24))+((1540483477*(u>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(u=1540483477*(65535&(u^=u>>>24))+((1540483477*(u>>>16)&65535)<<16)),f-=4,++x;switch(f){case 3:_^=(255&l.charCodeAt(x+2))<<16;case 2:_^=(255&l.charCodeAt(x+1))<<8;case 1:_=1540483477*(65535&(_^=255&l.charCodeAt(x)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var ae=ee,_e=Y;Q.exports=ae,j.murmur3=ae,j.murmur2=_e;class ye{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(o,u,f,_){this.ids.push(ie(o)),this.positions.push(u,f,_)}getPositions(o){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const u=ie(o);let f=0,_=this.ids.length-1;for(;f<_;){const C=f+_>>1;this.ids[C]>=u?_=C:f=C+1}const x=[];for(;this.ids[f]===u;)x.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return x}static serialize(o,u){const f=new Float64Array(o.ids),_=new Uint32Array(o.positions);return we(f,_,0,f.length-1),u&&u.push(f.buffer,_.buffer),{ids:f,positions:_}}static deserialize(o){const u=new ye;return u.ids=o.ids,u.positions=o.positions,u.indexed=!0,u}}function ie(l){const o=+l;return!isNaN(o)&&o<=Number.MAX_SAFE_INTEGER?o:j(String(l))}function we(l,o,u,f){for(;u>1];let x=u-1,C=f+1;for(;;){do{x++}while(l[x]<_);do{C--}while(l[C]>_);if(x>=C)break;De(l,x,C),De(o,3*x,3*C),De(o,3*x+1,3*C+1),De(o,3*x+2,3*C+2)}C-u`u_${_}`),this.type=f}setUniform(o,u,f){o.set(f.constantOr(this.value))}getBinding(o,u,f){return"color"===this.type?new Le(o,u):new ke(o,u)}}class Pt{constructor(o,u){this.uniformNames=u.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(o,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=o.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=o.tlbr}setUniform(o,u,f,_){const x="u_pattern_to"===_?this.patternTo:"u_pattern_from"===_?this.patternFrom:"u_pixel_ratio_to"===_?this.pixelRatioTo:"u_pixel_ratio_from"===_?this.pixelRatioFrom:null;x&&o.set(x)}getBinding(o,u,f){return"u_pattern"===f.substr(0,9)?new Be(o,u):new ke(o,u)}}class Nt{constructor(o,u,f,_){this.expression=o,this.type=f,this.maxValue=0,this.paintVertexAttributes=u.map(x=>({name:`a_${x}`,type:"Float32",components:"color"===f?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(o,u,f,_,x){const C=this.paintVertexArray.length,M=this.expression.evaluate(new hr(0),u,{},_,[],x);this.paintVertexArray.resize(o),this._setPaintValue(C,o,M)}updatePaintArray(o,u,f,_){const x=this.expression.evaluate({zoom:0},f,_);this._setPaintValue(o,u,x)}_setPaintValue(o,u,f){if("color"===this.type){const _=ze(f);for(let x=o;x`u_${M}_t`),this.type=f,this.useIntegerZoom=_,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=u.map(M=>({name:`a_${M}`,type:"Float32",components:"color"===f?4:2,offset:0})),this.paintVertexArray=new C}populatePaintArray(o,u,f,_,x){const C=this.expression.evaluate(new hr(this.zoom),u,{},_,[],x),M=this.expression.evaluate(new hr(this.zoom+1),u,{},_,[],x),A=this.paintVertexArray.length;this.paintVertexArray.resize(o),this._setPaintValue(A,o,C,M)}updatePaintArray(o,u,f,_){const x=this.expression.evaluate({zoom:this.zoom},f,_),C=this.expression.evaluate({zoom:this.zoom+1},f,_);this._setPaintValue(o,u,x,C)}_setPaintValue(o,u,f,_){if("color"===this.type){const x=ze(f),C=ze(_);for(let M=o;M`#define HAS_UNIFORM_${_}`))}return o}getBinderAttributes(){const o=[];for(const u in this.binders){const f=this.binders[u];if(f instanceof Nt||f instanceof mt)for(let _=0;_!0)){this.programConfigurations={};for(const _ of o)this.programConfigurations[_.id]=new An(_,u,f);this.needsUpload=!1,this._featureMap=new ye,this._bufferOffset=0}populatePaintArrays(o,u,f,_,x,C){for(const M in this.programConfigurations)this.programConfigurations[M].populatePaintArrays(o,u,_,x,C);void 0!==u.id&&this._featureMap.add(u.id,f,this._bufferOffset,o),this._bufferOffset=o,this.needsUpload=!0}updatePaintArrays(o,u,f,_){for(const x of f)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(o,this._featureMap,u,x,_)||this.needsUpload}get(o){return this.programConfigurations[o]}upload(o){if(this.needsUpload){for(const u in this.programConfigurations)this.programConfigurations[u].upload(o);this.needsUpload=!1}}destroy(){for(const o in this.programConfigurations)this.programConfigurations[o].destroy()}}function rn(l,o){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[l]||[l.replace(`${o}-`,"").replace(/-/g,"_")]}function Fn(l,o,u){const _={"line-pattern":{source:pa,composite:pa},"fill-pattern":{source:pa,composite:pa},"fill-extrusion-pattern":{source:pa,composite:pa}}[l];return _&&_[u]||{color:{source:Qu,composite:_d},number:{source:ql,composite:Qu}}[o][u]}ct("ConstantBinder",ft),ct("CrossFadedConstantBinder",Pt),ct("SourceExpressionBinder",Nt),ct("CrossFadedCompositeBinder",In),ct("CompositeExpressionBinder",mt),ct("ProgramConfiguration",An,{omit:["_buffers"]}),ct("ProgramConfigurationSet",Ht);var yn=8192;const yo=Math.pow(2,14)-1,Fo=-yo-1;function vr(l){const o=yn/l.extent,u=l.loadGeometry();for(let f=0;fC.x+1||AC.y+1)&&fn("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return u}function ci(l,o){return{type:l.type,id:l.id,properties:l.properties,geometry:o?vr(l):[]}}function Ii(l,o,u,f,_){l.emplaceBack(2*o+(f+1)/2,2*u+(_+1)/2)}class Jo{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(u=>u.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new js,this.indexArray=new w,this.segments=new R,this.programConfigurations=new Ht(o.layers,o.zoom),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,f){const _=this.layers[0],x=[];let C=null,M=!1;"circle"===_.type&&(C=_.layout.get("circle-sort-key"),M=!C.isConstant());for(const{feature:A,id:F,index:O,sourceLayerIndex:B}of o){const H=this.layers[0]._featureFilter.needGeometry,q=ci(A,H);if(!this.layers[0]._featureFilter.filter(new hr(this.zoom),q,f))continue;const W=M?C.evaluate(q,{},f):void 0,se={id:F,properties:A.properties,type:A.type,sourceLayerIndex:B,index:O,geometry:H?q.geometry:vr(A),patterns:{},sortKey:W};x.push(se)}M&&x.sort((A,F)=>A.sortKey-F.sortKey);for(const A of x){const{geometry:F,index:O,sourceLayerIndex:B}=A,H=o[O].feature;this.addFeature(A,F,O,f),u.featureIndex.insert(H,F,O,B,this.index)}}update(o,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,k),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(o,u,f,_){for(const x of u)for(const C of x){const M=C.x,A=C.y;if(M<0||M>=yn||A<0||A>=yn)continue;const F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,o.sortKey),O=F.vertexLength;Ii(this.layoutVertexArray,M,A,-1,-1),Ii(this.layoutVertexArray,M,A,1,-1),Ii(this.layoutVertexArray,M,A,1,1),Ii(this.layoutVertexArray,M,A,-1,1),this.indexArray.emplaceBack(O,O+1,O+2),this.indexArray.emplaceBack(O,O+3,O+2),F.vertexLength+=4,F.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,f,{},_)}}function Oo(l,o){for(let u=0;u1){if(On(l,o))return!0;for(let f=0;f1?u:u.sub(o)._mult(_)._add(o))}function Qo(l,o){let u,f,_,x=!1;for(let C=0;Co.y!=_.y>o.y&&o.x<(_.x-f.x)*(o.y-f.y)/(_.y-f.y)+f.x&&(x=!x)}return x}function Wi(l,o){let u=!1;for(let f=0,_=l.length-1;fo.y!=C.y>o.y&&o.x<(C.x-x.x)*(o.y-x.y)/(C.y-x.y)+x.x&&(u=!u)}return u}function sh(l,o,u){const f=u[0],_=u[2];if(l.x_.x&&o.x>_.x||l.y_.y&&o.y>_.y)return!1;const x=si(l,o,u[0]);return x!==si(l,o,u[1])||x!==si(l,o,u[2])||x!==si(l,o,u[3])}function ma(l,o,u){const f=o.paint.get(l).value;return"constant"===f.kind?f.value:u.programConfigurations.get(o.id).getMaxValue(l)}function Hs(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function ah(l,o,u,f,_){if(!o[0]&&!o[1])return l;const x=It.convert(o)._mult(_);"viewport"===u&&x._rotate(-f);const C=[];for(let M=0;Ml.width||_.height>l.height||u.x>l.width-_.width||u.y>l.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>o.width||_.height>o.height||f.x>o.width-_.width||f.y>o.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const C=l.data,M=o.data;if(C===M)throw new Error("srcData equals dstData, so image is already copied");for(let A=0;A<_.height;A++){const F=((u.y+A)*l.width+u.x)*x,O=((f.y+A)*o.width+f.x)*x;for(let B=0;B<_.width*x;B++)M[O+B]=C[F+B]}return o}class uh{constructor(o,u){ch(this,o,1,u)}resize(o){Ed(this,o,1)}clone(){return new uh({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(o,u,f,_,x){qm(o,u,f,_,x,1)}}class Lo{constructor(o,u){ch(this,o,4,u)}resize(o){Ed(this,o,4)}replace(o,u){u?this.data.set(o):this.data=o instanceof Uint8ClampedArray?new Uint8Array(o.buffer):o}clone(){return new Lo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(o,u,f,_,x){qm(o,u,f,_,x,4)}}function Zm(l){const o={},u=l.resolution||256,f=l.clips?l.clips.length:1,_=l.image||new Lo({width:u,height:f});if(Math.log(u)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${u}`);const x=(C,M,A)=>{o[l.evaluationKey]=A;const F=l.expression.evaluate(o);_.data[C+M+0]=Math.floor(255*F.r/F.a),_.data[C+M+1]=Math.floor(255*F.g/F.a),_.data[C+M+2]=Math.floor(255*F.b/F.a),_.data[C+M+3]=Math.floor(255*F.a)};if(l.clips)for(let C=0,M=0;C80*u){f=x=l[0],_=C=l[1];for(var W=u;Wx&&(x=M),A>C&&(C=A);F=0!==(F=Math.max(x-f,C-_))?32767/F:0}return ya(H,q,u,f,_,F,0),q}function Wm(l,o,u,f,_){var x,C;if(_===O_(l,o,u,f)>0)for(x=o;x=o;x-=f)C=Wx(x,l[x],l[x+1],C);return C&&Km(C,C.next)&&(Jf(C),C=C.next),C}function Xl(l,o){if(!l)return l;o||(o=l);var u,f=l;do{if(u=!1,f.steiner||!Km(f,f.next)&&0!==ir(f.prev,f,f.next))f=f.next;else{if(Jf(f),(f=o=f.prev)===f.next)break;u=!0}}while(u||f!==o);return o}function ya(l,o,u,f,_,x,C){if(l){!C&&x&&function(O,B,H,q){var W=O;do{0===W.z&&(W.z=Yl(W.x,W.y,B,H,q)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next}while(W!==O);W.prevZ.nextZ=null,W.prevZ=null,function(se){var oe,be,Ce,me,Ee,$e,Ve,gt,Ct=1;do{for(be=se,se=null,Ee=null,$e=0;be;){for($e++,Ce=be,Ve=0,oe=0;oe0||gt>0&&Ce;)0!==Ve&&(0===gt||!Ce||be.z<=Ce.z)?(me=be,be=be.nextZ,Ve--):(me=Ce,Ce=Ce.nextZ,gt--),Ee?Ee.nextZ=me:se=me,me.prevZ=Ee,Ee=me;be=Ce}Ee.nextZ=null,Ct*=2}while($e>1)}(W)}(l,f,_,x);for(var M,A,F=l;l.prev!==l.next;)if(M=l.prev,A=l.next,x?Xi(l,f,_,x):Gx(l))o.push(M.i/u|0),o.push(l.i/u|0),o.push(A.i/u|0),Jf(l),l=A.next,F=A.next;else if((l=A)===F){C?1===C?ya(l=Xm(Xl(l),o,u),o,u,f,_,x,2):2===C&&qx(l,o,u,f,_,x):ya(Xl(l),o,u,f,_,x,1);break}}}function Gx(l){var o=l.prev,u=l,f=l.next;if(ir(o,u,f)>=0)return!1;for(var _=o.x,x=u.x,C=f.x,M=o.y,A=u.y,F=f.y,O=_x?_>C?_:C:x>C?x:C,q=M>A?M>F?M:F:A>F?A:F,W=f.next;W!==o;){if(W.x>=O&&W.x<=H&&W.y>=B&&W.y<=q&&Zc(_,M,x,A,C,F,W.x,W.y)&&ir(W.prev,W,W.next)>=0)return!1;W=W.next}return!0}function Xi(l,o,u,f){var _=l.prev,x=l,C=l.next;if(ir(_,x,C)>=0)return!1;for(var M=_.x,A=x.x,F=C.x,O=_.y,B=x.y,H=C.y,q=MA?M>F?M:F:A>F?A:F,oe=O>B?O>H?O:H:B>H?B:H,be=Yl(q,W,o,u,f),Ce=Yl(se,oe,o,u,f),me=l.prevZ,Ee=l.nextZ;me&&me.z>=be&&Ee&&Ee.z<=Ce;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==C&&Zc(M,O,A,B,F,H,me.x,me.y)&&ir(me.prev,me,me.next)>=0||(me=me.prevZ,Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==C&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&ir(Ee.prev,Ee,Ee.next)>=0))return!1;Ee=Ee.nextZ}for(;me&&me.z>=be;){if(me.x>=q&&me.x<=se&&me.y>=W&&me.y<=oe&&me!==_&&me!==C&&Zc(M,O,A,B,F,H,me.x,me.y)&&ir(me.prev,me,me.next)>=0)return!1;me=me.prevZ}for(;Ee&&Ee.z<=Ce;){if(Ee.x>=q&&Ee.x<=se&&Ee.y>=W&&Ee.y<=oe&&Ee!==_&&Ee!==C&&Zc(M,O,A,B,F,H,Ee.x,Ee.y)&&ir(Ee.prev,Ee,Ee.next)>=0)return!1;Ee=Ee.nextZ}return!0}function Xm(l,o,u){var f=l;do{var _=f.prev,x=f.next.next;!Km(_,x)&&R_(_,f,f.next,x)&&Kf(_,x)&&Kf(x,_)&&(o.push(_.i/u|0),o.push(f.i/u|0),o.push(x.i/u|0),Jf(f),Jf(f.next),f=l=x),f=f.next}while(f!==l);return Xl(f)}function qx(l,o,u,f,_,x){var C=l;do{for(var M=C.next.next;M!==C.prev;){if(C.i!==M.i&&Ym(C,M)){var A=Zx(C,M);return C=Xl(C,C.next),A=Xl(A,A.next),ya(C,o,u,f,_,x,0),void ya(A,o,u,f,_,x,0)}M=M.next}C=C.next}while(C!==l)}function P_(l,o){return l.x-o.x}function Dd(l,o){var u=function(_,x){var C,M=x,A=_.x,F=_.y,O=-1/0;do{if(F<=M.y&&F>=M.next.y&&M.next.y!==M.y){var B=M.x+(F-M.y)*(M.next.x-M.x)/(M.next.y-M.y);if(B<=A&&B>O&&(O=B,C=M.x=M.x&&M.x>=W&&A!==M.x&&Zc(FC.x||M.x===C.x&&hh(C,M)))&&(C=M,oe=H)),M=M.next}while(M!==q);return C}(l,o);if(!u)return o;var f=Zx(u,l);return Xl(f,f.next),Xl(u,u.next)}function hh(l,o){return ir(l.prev,l,o.prev)<0&&ir(o.next,l,l.next)<0}function Yl(l,o,u,f,_){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-u)*_|0)|l<<8))|l<<4))|l<<2))|l<<1))|(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=(o-f)*_|0)|o<<8))|o<<4))|o<<2))|o<<1))<<1}function dh(l){var o=l,u=l;do{(o.x=(l-C)*(x-M)&&(l-C)*(f-M)>=(u-C)*(o-M)&&(u-C)*(x-M)>=(_-C)*(f-M)}function Ym(l,o){return l.next.i!==o.i&&l.prev.i!==o.i&&!function(u,f){var _=u;do{if(_.i!==u.i&&_.next.i!==u.i&&_.i!==f.i&&_.next.i!==f.i&&R_(_,_.next,u,f))return!0;_=_.next}while(_!==u);return!1}(l,o)&&(Kf(l,o)&&Kf(o,l)&&function(u,f){var _=u,x=!1,C=(u.x+f.x)/2,M=(u.y+f.y)/2;do{_.y>M!=_.next.y>M&&_.next.y!==_.y&&C<(_.next.x-_.x)*(M-_.y)/(_.next.y-_.y)+_.x&&(x=!x),_=_.next}while(_!==u);return x}(l,o)&&(ir(l.prev,l,o.prev)||ir(l,o.prev,o))||Km(l,o)&&ir(l.prev,l,l.next)>0&&ir(o.prev,o,o.next)>0)}function ir(l,o,u){return(o.y-l.y)*(u.x-o.x)-(o.x-l.x)*(u.y-o.y)}function Km(l,o){return l.x===o.x&&l.y===o.y}function R_(l,o,u,f){var _=Jm(ir(l,o,u)),x=Jm(ir(l,o,f)),C=Jm(ir(u,f,l)),M=Jm(ir(u,f,o));return _!==x&&C!==M||!(0!==_||!Tt(l,u,o))||!(0!==x||!Tt(l,f,o))||!(0!==C||!Tt(u,l,f))||!(0!==M||!Tt(u,o,f))}function Tt(l,o,u){return o.x<=Math.max(l.x,u.x)&&o.x>=Math.min(l.x,u.x)&&o.y<=Math.max(l.y,u.y)&&o.y>=Math.min(l.y,u.y)}function Jm(l){return l>0?1:l<0?-1:0}function Kf(l,o){return ir(l.prev,l,l.next)<0?ir(l,o,l.next)>=0&&ir(l,l.prev,o)>=0:ir(l,o,l.prev)<0||ir(l,l.next,o)<0}function Zx(l,o){var u=new F_(l.i,l.x,l.y),f=new F_(o.i,o.x,o.y),_=l.next,x=o.prev;return l.next=o,o.prev=l,u.next=_,_.prev=u,f.next=u,u.prev=f,x.next=f,f.prev=x,f}function Wx(l,o,u,f){var _=new F_(l,o,u);return f?(_.next=f.next,_.prev=f,f.next.prev=_,f.next=_):(_.prev=_,_.next=_),_}function Jf(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function F_(l,o,u){this.i=l,this.x=o,this.y=u,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O_(l,o,u,f){for(var _=0,x=o,C=u-f;xu;){if(f-u>600){var x=f-u+1,C=o-u+1,M=Math.log(x),A=.5*Math.exp(2*M/3),F=.5*Math.sqrt(M*A*(x-A)/x)*(C-x/2<0?-1:1);Xx(l,o,Math.max(u,Math.floor(o-C*A/x+F)),Math.min(f,Math.floor(o+(x-C)*A/x+F)),_)}var O=l[o],B=u,H=f;for(Qf(l,u,o),_(l[f],O)>0&&Qf(l,u,f);B0;)H--}0===_(l[u],O)?Qf(l,u,H):Qf(l,++H,f),H<=o&&(u=H+1),o<=H&&(f=H-1)}}function Qf(l,o,u){var f=l[o];l[o]=l[u],l[u]=f}function ui(l,o){return lo?1:0}function Md(l,o){const u=l.length;if(u<=1)return[l];const f=[];let _,x;for(let C=0;C1)for(let C=0;C0&&u.holes.push(f+=l[_-1].length)}return u};class _o{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(u=>u.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bs,this.indexArray=new w,this.indexArray2=new S,this.programConfigurations=new Ht(o.layers,o.zoom),this.segments=new R,this.segments2=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,f){this.hasPattern=L_("fill",this.layers,u);const _=this.layers[0].layout.get("fill-sort-key"),x=!_.isConstant(),C=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of o){const B=this.layers[0]._featureFilter.needGeometry,H=ci(M,B);if(!this.layers[0]._featureFilter.filter(new hr(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f,u.availableImages):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:vr(M),patterns:{},sortKey:q};C.push(W)}x&&C.sort((M,A)=>M.sortKey-A.sortKey);for(const M of C){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=Qm("fill",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(o[F].feature,A,F,O,this.index)}}update(o,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,f)}addFeatures(o,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Xf),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.indexBuffer2=o.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(o),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(o,u,f,_,x){for(const C of Md(u,500)){let M=0;for(const q of C)M+=q.length;const A=this.segments.prepareSegment(M,this.layoutVertexArray,this.indexArray),F=A.vertexLength,O=[],B=[];for(const q of C){if(0===q.length)continue;q!==C[0]&&B.push(O.length/2);const W=this.segments2.prepareSegment(q.length,this.layoutVertexArray,this.indexArray2),se=W.vertexLength;this.layoutVertexArray.emplaceBack(q[0].x,q[0].y),this.indexArray2.emplaceBack(se+q.length-1,se),O.push(q[0].x),O.push(q[0].y);for(let oe=1;oe>3}if(_--,1===f||2===f)x+=l.readSVarint(),C+=l.readSVarint(),1===f&&(o&&M.push(o),o=[]),o.push(new Yx(x,C));else{if(7!==f)throw new Error("unknown command "+f);o&&o.push(o[0].clone())}}return o&&M.push(o),M},Ad.prototype.bbox=function(){var l=this._pbf;l.pos=this._geometry;for(var o=l.readVarint()+l.pos,u=1,f=0,_=0,x=0,C=1/0,M=-1/0,A=1/0,F=-1/0;l.pos>3}if(f--,1===u||2===u)(_+=l.readSVarint())M&&(M=_),(x+=l.readSVarint())F&&(F=x);else if(7!==u)throw new Error("unknown command "+u)}return[C,A,M,F]},Ad.prototype.toGeoJSON=function(l,o,u){var f,_,x=this.extent*Math.pow(2,u),C=this.extent*l,M=this.extent*o,A=this.loadGeometry(),F=Ad.types[this.type];function O(q){for(var W=0;W>3;_=1===C?f.readString():2===C?f.readFloat():3===C?f.readDouble():4===C?f.readVarint64():5===C?f.readVarint():6===C?f.readSVarint():7===C?f.readBoolean():null}return _}(u))}Jx.prototype.feature=function(l){if(l<0||l>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[l];var o=this._pbf.readVarint()+this._pbf.pos;return new eg(this._pbf,o,this.extent,this._keys,this._values)};var Qx=Wc;function e1(l,o,u){if(3===l){var f=new Qx(u,u.readVarint()+u.pos);f.length&&(o[f.name]=f)}}Kl.VectorTile=function(l,o){this.layers=l.readFields(e1,{},o)},Kl.VectorTileFeature=Kx,Kl.VectorTileLayer=Wc;const t1=Kl.VectorTileFeature.types,tg=Math.pow(2,13);function kd(l,o,u,f,_,x,C,M){l.emplaceBack(o,u,2*Math.floor(f*tg)+C,_*tg*2,x*tg*2,Math.round(M))}class ng{constructor(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(u=>u.id),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new xd,this.centroidVertexArray=new ih,this.indexArray=new w,this.programConfigurations=new Ht(o.layers,o.zoom),this.segments=new R,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,f){this.features=[],this.hasPattern=L_("fill-extrusion",this.layers,u);for(const{feature:_,id:x,index:C,sourceLayerIndex:M}of o){const A=this.layers[0]._featureFilter.needGeometry,F=ci(_,A);if(!this.layers[0]._featureFilter.filter(new hr(this.zoom),F,f))continue;const O={id:x,sourceLayerIndex:M,index:C,geometry:A?F.geometry:vr(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(Qm("fill-extrusion",this.layers,O,this.zoom,u)):this.addFeature(O,O.geometry,C,f,{}),u.featureIndex.insert(_,O.geometry,C,M,this.index,!0)}}addFeatures(o,u,f){for(const _ of this.features){const{geometry:x}=_;this.addFeature(_,x,_.index,u,f)}}update(o,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,f)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,z_),this.centroidVertexBuffer=o.createVertexBuffer(this.centroidVertexArray,Id.members,!0),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(o,u,f,_,x){const C={x:0,y:0,vertexCount:0};for(const M of Md(u,500)){let A=0;for(const W of M)A+=W.length;let F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const W of M){if(0===W.length||((l=W).every(o=>o.x<0)||l.every(o=>o.x>yn)||l.every(o=>o.y<0)||l.every(o=>o.y>yn)))continue;let se=0;for(let oe=0;oe=1){const Ce=W[oe-1];if(!rg(be,Ce)){F.vertexLength+4>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const me=be.sub(Ce)._perp()._unit(),Ee=Ce.dist(be);se+Ee>32768&&(se=0),kd(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,0,se),kd(this.layoutVertexArray,be.x,be.y,me.x,me.y,0,1,se),C.x+=2*be.x,C.y+=2*be.y,C.vertexCount+=2,se+=Ee,kd(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,0,se),kd(this.layoutVertexArray,Ce.x,Ce.y,me.x,me.y,0,1,se),C.x+=2*Ce.x,C.y+=2*Ce.y,C.vertexCount+=2;const $e=F.vertexLength;this.indexArray.emplaceBack($e,$e+2,$e+1),this.indexArray.emplaceBack($e+1,$e+2,$e+3),F.vertexLength+=4,F.primitiveLength+=2}}}}if(F.vertexLength+A>R.MAX_VERTEX_ARRAY_LENGTH&&(F=this.segments.prepareSegment(A,this.layoutVertexArray,this.indexArray)),"Polygon"!==t1[o.type])continue;const O=[],B=[],H=F.vertexLength;for(const W of M)if(0!==W.length){W!==M[0]&&B.push(O.length/2);for(let se=0;seyn)||l.y===o.y&&(l.y<0||l.y>yn)}ct("FillExtrusionBucket",ng,{omit:["layers","features"]});var S2={paint:new Si({"fill-extrusion-opacity":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ja(Ae["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yt(Ae["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new wt(Ae["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function il(l,o){return l.x*o.x+l.y*o.y}function np(l,o){if(1===l.length){let u=0;const f=o[u++];let _;for(;!_||f.equals(_);)if(_=o[u++],!_)return 1/0;for(;uu.id),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(u=>{this.gradients[u.id]={}}),this.layoutVertexArray=new oh,this.layoutVertexArray2=new A_,this.indexArray=new w,this.programConfigurations=new Ht(o.layers,o.zoom),this.segments=new R,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id)}populate(o,u,f){this.hasPattern=L_("line",this.layers,u);const _=this.layers[0].layout.get("line-sort-key"),x=!_.isConstant(),C=[];for(const{feature:M,id:A,index:F,sourceLayerIndex:O}of o){const B=this.layers[0]._featureFilter.needGeometry,H=ci(M,B);if(!this.layers[0]._featureFilter.filter(new hr(this.zoom),H,f))continue;const q=x?_.evaluate(H,{},f):void 0,W={id:A,properties:M.properties,type:M.type,sourceLayerIndex:O,index:F,geometry:B?H.geometry:vr(M),patterns:{},sortKey:q};C.push(W)}x&&C.sort((M,A)=>M.sortKey-A.sortKey);for(const M of C){const{geometry:A,index:F,sourceLayerIndex:O}=M;if(this.hasPattern){const B=Qm("line",this.layers,M,this.zoom,u);this.patternFeatures.push(B)}else this.addFeature(M,A,F,f,{});u.featureIndex.insert(o[F].feature,A,F,O,this.index)}}update(o,u,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,f)}addFeatures(o,u,f){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,u,f)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(o){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=o.createVertexBuffer(this.layoutVertexArray2,i1)),this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,n1),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(o){if(o.properties&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(o.properties,"mapbox_clip_end"))return{start:+o.properties.mapbox_clip_start,end:+o.properties.mapbox_clip_end}}addFeature(o,u,f,_,x){const C=this.layers[0].layout,M=C.get("line-join").evaluate(o,{}),A=C.get("line-cap"),F=C.get("line-miter-limit"),O=C.get("line-round-limit");this.lineClips=this.lineFeatureClips(o);for(const B of u)this.addLine(B,o,M,A,F,O);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,f,x,_)}addLine(o,u,f,_,x,C){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be=2&&o[A-1].equals(o[A-2]);)A--;let F=0;for(;F0;if(gt&&be>F){const Qe=H.dist(q);if(Qe>2*O){const ot=H.sub(H.sub(q)._mult(O/Qe)._round());this.updateDistance(q,ot),this.addCurrentVertex(ot,se,0,0,B),q=ot}}const at=q&&W;let tt=at?f:M?"butt":_;if(at&&"round"===tt&&($ex&&(tt="bevel"),"bevel"===tt&&($e>2&&(tt="flipbevel"),$e100)Ce=oe.mult(-1);else{const Qe=$e*se.add(oe).mag()/se.sub(oe).mag();Ce._perp()._mult(Qe*(Ct?-1:1))}this.addCurrentVertex(H,Ce,0,0,B),this.addCurrentVertex(H,Ce.mult(-1),0,0,B)}else if("bevel"===tt||"fakeround"===tt){const Qe=-Math.sqrt($e*$e-1),ot=Ct?Qe:0,it=Ct?0:Qe;if(q&&this.addCurrentVertex(H,se,ot,it,B),"fakeround"===tt){const Ge=Math.round(180*Ve/Math.PI/20);for(let Et=1;Et2*O){const ot=H.add(W.sub(H)._mult(O/Qe)._round());this.updateDistance(H,ot),this.addCurrentVertex(ot,oe,0,0,B),H=ot}}}}addCurrentVertex(o,u,f,_,x,C=!1){const M=u.y*_-u.x,A=-u.y-u.x*_;this.addHalfVertex(o,u.x+u.y*f,u.y-u.x*f,C,!1,f,x),this.addHalfVertex(o,M,A,C,!0,-_,x),this.distance>Xc/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(o,u,f,_,x,C))}addHalfVertex({x:o,y:u},f,_,x,C,M,A){const F=.5*(this.lineClips?this.scaledDistance*(Xc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((o<<1)+(x?1:0),(u<<1)+(C?1:0),Math.round(63*f)+128,Math.round(63*_)+128,1+(0===M?0:M<0?-1:1)|(63&F)<<2,F>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const O=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,O),A.primitiveLength++),C?this.e2=O:this.e1=O}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(o,u){this.distance+=o.dist(u),this.updateScaledDistance()}}ct("LineBucket",ig,{omit:["layers","patternFeatures"]});const St=new Si({"line-cap":new wt(Ae.layout_line["line-cap"]),"line-join":new yt(Ae.layout_line["line-join"]),"line-miter-limit":new wt(Ae.layout_line["line-miter-limit"]),"line-round-limit":new wt(Ae.layout_line["line-round-limit"]),"line-sort-key":new yt(Ae.layout_line["line-sort-key"])});var og={paint:new Si({"line-opacity":new yt(Ae.paint_line["line-opacity"]),"line-color":new yt(Ae.paint_line["line-color"]),"line-translate":new wt(Ae.paint_line["line-translate"]),"line-translate-anchor":new wt(Ae.paint_line["line-translate-anchor"]),"line-width":new yt(Ae.paint_line["line-width"]),"line-gap-width":new yt(Ae.paint_line["line-gap-width"]),"line-offset":new yt(Ae.paint_line["line-offset"]),"line-blur":new yt(Ae.paint_line["line-blur"]),"line-dasharray":new fd(Ae.paint_line["line-dasharray"]),"line-pattern":new Ja(Ae.paint_line["line-pattern"]),"line-gradient":new pd(Ae.paint_line["line-gradient"])}),layout:St};const Or=new class extends yt{possiblyEvaluate(l,o){return o=new hr(Math.floor(o.zoom),{now:o.now,fadeDuration:o.fadeDuration,zoomHistory:o.zoomHistory,transition:o.transition}),super.possiblyEvaluate(l,o)}evaluate(l,o,u,f){return o=Bi({},o,{zoom:Math.floor(o.zoom)}),super.evaluate(l,o,u,f)}}(og.paint.properties["line-width"].specification);function ip(l,o){return o>0?o+2*l:l}Or.useIntegerZoom=!0;const Rd=Dr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),o1=Dr([{name:"a_projected_pos",components:3,type:"Float32"}],4);Dr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const s1=Dr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Dr([{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 $_=Dr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),sg=Dr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Fd(l,o,u){return l.sections.forEach(f=>{f.text=function(_,x,C){const M=x.layout.get("text-transform").evaluate(C,{});return"uppercase"===M?_=_.toLocaleUpperCase():"lowercase"===M&&(_=_.toLocaleLowerCase()),go.applyArabicShaping&&(_=go.applyArabicShaping(_)),_}(f.text,o,u)}),l}Dr([{name:"triangle",components:3,type:"Uint16"}]),Dr([{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"}]),Dr([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Dr([{type:"Float32",name:"offsetX"}]),Dr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const fh={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var ag=Ln,lg=function(l,o,u,f,_){var x,C,M=8*_-f-1,A=(1<>1,O=-7,B=u?_-1:0,H=u?-1:1,q=l[o+B];for(B+=H,x=q&(1<<-O)-1,q>>=-O,O+=M;O>0;x=256*x+l[o+B],B+=H,O-=8);for(C=x&(1<<-O)-1,x>>=-O,O+=f;O>0;C=256*C+l[o+B],B+=H,O-=8);if(0===x)x=1-F;else{if(x===A)return C?NaN:1/0*(q?-1:1);C+=Math.pow(2,f),x-=F}return(q?-1:1)*C*Math.pow(2,x-f)},ph=function(l,o,u,f,_,x){var C,M,A,F=8*x-_-1,O=(1<>1,H=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,q=f?0:x-1,W=f?1:-1,se=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(M=isNaN(o)?1:0,C=O):(C=Math.floor(Math.log(o)/Math.LN2),o*(A=Math.pow(2,-C))<1&&(C--,A*=2),(o+=C+B>=1?H/A:H*Math.pow(2,1-B))*A>=2&&(C++,A/=2),C+B>=O?(M=0,C=O):C+B>=1?(M=(o*A-1)*Math.pow(2,_),C+=B):(M=o*Math.pow(2,B-1)*Math.pow(2,_),C=0));_>=8;l[u+q]=255&M,q+=W,M/=256,_-=8);for(C=C<<_|M,F+=_;F>0;l[u+q]=255&C,q+=W,C/=256,F-=8);l[u+q-W]|=128*se};function Ln(l){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(l)?l:new Uint8Array(l||0),this.pos=0,this.type=0,this.length=this.buf.length}Ln.Varint=0,Ln.Fixed64=1,Ln.Bytes=2,Ln.Fixed32=5;var ol,cg=4294967296,j_=1/cg,Yc=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ts(l){return l.type===Ln.Bytes?l.readVarint()+l.pos:l.pos+1}function a1(l,o,u){var f=o<=16383?1:o<=2097151?2:o<=268435455?3:Math.floor(Math.log(o)/(7*Math.LN2));u.realloc(f);for(var _=u.pos-1;_>=l;_--)u.buf[_+f]=u.buf[_]}function H_(l,o){for(var u=0;u>>8,l[u+2]=o>>>16,l[u+3]=o>>>24}function ug(l,o){return(l[o]|l[o+1]<<8|l[o+2]<<16)+(l[o+3]<<24)}function T2(l,o,u){1===l&&u.readMessage(f1,o)}function f1(l,o,u){if(3===l){const{id:f,bitmap:_,width:x,height:C,left:M,top:A,advance:F}=u.readMessage(p1,{});o.push({id:f,bitmap:new uh({width:x+6,height:C+6},_),metrics:{width:x,height:C,left:M,top:A,advance:F}})}}function p1(l,o,u){1===l?o.id=u.readVarint():2===l?o.bitmap=u.readBytes():3===l?o.width=u.readVarint():4===l?o.height=u.readVarint():5===l?o.left=u.readSVarint():6===l?o.top=u.readSVarint():7===l&&(o.advance=u.readVarint())}function sp(l){let o=0,u=0;for(const C of l)o+=C.w*C.h,u=Math.max(u,C.w);l.sort((C,M)=>M.h-C.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(o/.95)),u),h:1/0}];let _=0,x=0;for(const C of l)for(let M=f.length-1;M>=0;M--){const A=f[M];if(!(C.w>A.w||C.h>A.h)){if(C.x=A.x,C.y=A.y,x=Math.max(x,C.y+C.h),_=Math.max(_,C.x+C.w),C.w===A.w&&C.h===A.h){const F=f.pop();M>3,x=this.pos;this.type=7&f,l(_,o,this),this.pos===x&&this.skip(f)}return o},readMessage:function(l,o){return this.readFields(l,o,this.readVarint()+this.pos)},readFixed32:function(){var l=Od(this.buf,this.pos);return this.pos+=4,l},readSFixed32:function(){var l=ug(this.buf,this.pos);return this.pos+=4,l},readFixed64:function(){var l=Od(this.buf,this.pos)+Od(this.buf,this.pos+4)*cg;return this.pos+=8,l},readSFixed64:function(){var l=Od(this.buf,this.pos)+ug(this.buf,this.pos+4)*cg;return this.pos+=8,l},readFloat:function(){var l=lg(this.buf,this.pos,!0,23,4);return this.pos+=4,l},readDouble:function(){var l=lg(this.buf,this.pos,!0,52,8);return this.pos+=8,l},readVarint:function(l){var o,u,f=this.buf;return o=127&(u=f[this.pos++]),u<128?o:(o|=(127&(u=f[this.pos++]))<<7,u<128?o:(o|=(127&(u=f[this.pos++]))<<14,u<128?o:(o|=(127&(u=f[this.pos++]))<<21,u<128?o:function(_,x,C){var M,A,F=C.buf;if(M=(112&(A=F[C.pos++]))>>4,A<128||(M|=(127&(A=F[C.pos++]))<<3,A<128)||(M|=(127&(A=F[C.pos++]))<<10,A<128)||(M|=(127&(A=F[C.pos++]))<<17,A<128)||(M|=(127&(A=F[C.pos++]))<<24,A<128)||(M|=(1&(A=F[C.pos++]))<<31,A<128))return function mh(l,o,u){return u?4294967296*o+(l>>>0):4294967296*(o>>>0)+(l>>>0)}(_,M,x);throw new Error("Expected varint not more than 10 bytes")}(o|=(15&(u=f[this.pos]))<<28,l,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var l=this.readVarint();return l%2==1?(l+1)/-2:l/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var l=this.readVarint()+this.pos,o=this.pos;return this.pos=l,l-o>=12&&Yc?Yc.decode(this.buf.subarray(o,l)):function(u,f,_){for(var x="",C=f;C<_;){var M,A,F,O=u[C],B=null,H=O>239?4:O>223?3:O>191?2:1;if(C+H>_)break;1===H?O<128&&(B=O):2===H?128==(192&(M=u[C+1]))&&(B=(31&O)<<6|63&M)<=127&&(B=null):3===H?(A=u[C+2],128==(192&(M=u[C+1]))&&128==(192&A)&&((B=(15&O)<<12|(63&M)<<6|63&A)<=2047||B>=55296&&B<=57343)&&(B=null)):4===H&&(A=u[C+2],F=u[C+3],128==(192&(M=u[C+1]))&&128==(192&A)&&128==(192&F)&&((B=(15&O)<<18|(63&M)<<12|(63&A)<<6|63&F)<=65535||B>=1114112)&&(B=null)),null===B?(B=65533,H=1):B>65535&&(B-=65536,x+=String.fromCharCode(B>>>10&1023|55296),B=56320|1023&B),x+=String.fromCharCode(B),C+=H}return x}(this.buf,o,l)},readBytes:function(){var l=this.readVarint()+this.pos,o=this.buf.subarray(this.pos,l);return this.pos=l,o},readPackedVarint:function(l,o){if(this.type!==Ln.Bytes)return l.push(this.readVarint(o));var u=ts(this);for(l=l||[];this.pos127;);else if(o===Ln.Bytes)this.pos=this.readVarint()+this.pos;else if(o===Ln.Fixed32)this.pos+=4;else{if(o!==Ln.Fixed64)throw new Error("Unimplemented type: "+o);this.pos+=8}},writeTag:function(l,o){this.writeVarint(l<<3|o)},realloc:function(l){for(var o=this.length||16;o268435455||l<0?function(o,u){var f,_,x,M;if(o>=0?(f=o%4294967296|0,_=o/4294967296|0):(_=~(-o/4294967296),4294967295^(f=~(-o%4294967296))?f=f+1|0:(f=0,_=_+1|0)),o>=0x10000000000000000||o<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");u.realloc(10),x=f,(M=u).buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,x>>>=7,M.buf[M.pos++]=127&x|128,M.buf[M.pos]=127&(x>>>=7),function(x,C){var M=(7&x)<<4;C.buf[C.pos++]|=M|((x>>>=3)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x|((x>>>=7)?128:0),x&&(C.buf[C.pos++]=127&x)))))}(_,u)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=127&(l>>>=7)|(l>127?128:0),l<=127||(this.buf[this.pos++]=l>>>7&127))))},writeSVarint:function(l){this.writeVarint(l<0?2*-l-1:2*l)},writeBoolean:function(l){this.writeVarint(Boolean(l))},writeString:function(l){l=String(l),this.realloc(4*l.length),this.pos++;var o=this.pos;this.pos=function(f,_,x){for(var C,M,A=0;A<_.length;A++){if((C=_.charCodeAt(A))>55295&&C<57344){if(!M){C>56319||A+1===_.length?(f[x++]=239,f[x++]=191,f[x++]=189):M=C;continue}if(C<56320){f[x++]=239,f[x++]=191,f[x++]=189,M=C;continue}C=M-55296<<10|C-56320|65536,M=null}else M&&(f[x++]=239,f[x++]=191,f[x++]=189,M=null);C<128?f[x++]=C:(C<2048?f[x++]=C>>6|192:(C<65536?f[x++]=C>>12|224:(f[x++]=C>>18|240,f[x++]=C>>12&63|128),f[x++]=C>>6&63|128),f[x++]=63&C|128)}return x}(this.buf,l,this.pos);var u=this.pos-o;u>=128&&a1(o,u,this),this.pos=o-1,this.writeVarint(u),this.pos+=u},writeFloat:function(l){this.realloc(4),ph(this.buf,l,this.pos,!0,23,4),this.pos+=4},writeDouble:function(l){this.realloc(8),ph(this.buf,l,this.pos,!0,52,8),this.pos+=8},writeBytes:function(l){var o=l.length;this.writeVarint(o),this.realloc(o);for(var u=0;u=128&&a1(u,f,this),this.pos=u-1,this.writeVarint(f),this.pos+=f},writeMessage:function(l,o,u){this.writeTag(l,Ln.Bytes),this.writeRawMessage(o,u)},writePackedVarint:function(l,o){o.length&&this.writeMessage(l,H_,o)},writePackedSVarint:function(l,o){o.length&&this.writeMessage(l,l1,o)},writePackedBoolean:function(l,o){o.length&&this.writeMessage(l,u1,o)},writePackedFloat:function(l,o){o.length&&this.writeMessage(l,M2,o)},writePackedDouble:function(l,o){o.length&&this.writeMessage(l,c1,o)},writePackedFixed32:function(l,o){o.length&&this.writeMessage(l,h1,o)},writePackedSFixed32:function(l,o){o.length&&this.writeMessage(l,op,o)},writePackedFixed64:function(l,o){o.length&&this.writeMessage(l,G_,o)},writePackedSFixed64:function(l,o){o.length&&this.writeMessage(l,d1,o)},writeBytesField:function(l,o){this.writeTag(l,Ln.Bytes),this.writeBytes(o)},writeFixed32Field:function(l,o){this.writeTag(l,Ln.Fixed32),this.writeFixed32(o)},writeSFixed32Field:function(l,o){this.writeTag(l,Ln.Fixed32),this.writeSFixed32(o)},writeFixed64Field:function(l,o){this.writeTag(l,Ln.Fixed64),this.writeFixed64(o)},writeSFixed64Field:function(l,o){this.writeTag(l,Ln.Fixed64),this.writeSFixed64(o)},writeVarintField:function(l,o){this.writeTag(l,Ln.Varint),this.writeVarint(o)},writeSVarintField:function(l,o){this.writeTag(l,Ln.Varint),this.writeSVarint(o)},writeStringField:function(l,o){this.writeTag(l,Ln.Bytes),this.writeString(o)},writeFloatField:function(l,o){this.writeTag(l,Ln.Fixed32),this.writeFloat(o)},writeDoubleField:function(l,o){this.writeTag(l,Ln.Fixed64),this.writeDouble(o)},writeBooleanField:function(l,o){this.writeVarintField(l,Boolean(o))}};class q_{constructor(o,{pixelRatio:u,version:f,stretchX:_,stretchY:x,content:C}){this.paddedRect=o,this.pixelRatio=u,this.stretchX=_,this.stretchY=x,this.content=C,this.version=f}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 m1{constructor(o,u){const f={},_={};this.haveRenderCallbacks=[];const x=[];this.addImages(o,f,x),this.addImages(u,_,x);const{w:C,h:M}=sp(x),A=new Lo({width:C||1,height:M||1});for(const F in o){const O=o[F],B=f[F].paddedRect;Lo.copy(O.data,A,{x:0,y:0},{x:B.x+1,y:B.y+1},O.data)}for(const F in u){const O=u[F],B=_[F].paddedRect,H=B.x+1,q=B.y+1,W=O.data.width,se=O.data.height;Lo.copy(O.data,A,{x:0,y:0},{x:H,y:q},O.data),Lo.copy(O.data,A,{x:0,y:se-1},{x:H,y:q-1},{width:W,height:1}),Lo.copy(O.data,A,{x:0,y:0},{x:H,y:q+se},{width:W,height:1}),Lo.copy(O.data,A,{x:W-1,y:0},{x:H-1,y:q},{width:1,height:se}),Lo.copy(O.data,A,{x:0,y:0},{x:H+W,y:q},{width:1,height:se})}this.image=A,this.iconPositions=f,this.patternPositions=_}addImages(o,u,f){for(const _ in o){const x=o[_],C={x:0,y:0,w:x.data.width+2,h:x.data.height+2};f.push(C),u[_]=new q_(C,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(_)}}patchUpdatedImages(o,u){o.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const f in o.updatedImages)this.patchUpdatedImage(this.iconPositions[f],o.getImage(f),u),this.patchUpdatedImage(this.patternPositions[f],o.getImage(f),u)}patchUpdatedImage(o,u,f){if(!o||!u||o.version===u.version)return;o.version=u.version;const[_,x]=o.tl;f.update(u.data,void 0,{x:_,y:x})}}ct("ImagePosition",q_),ct("ImageAtlas",m1),b.WritingMode=void 0,(ol=b.WritingMode||(b.WritingMode={}))[ol.none=0]="none",ol[ol.horizontal=1]="horizontal",ol[ol.vertical=2]="vertical",ol[ol.horizontalOnly=3]="horizontalOnly";class ap{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(o,u){const f=new ap;return f.scale=o||1,f.fontStack=u,f}static forImage(o){const u=new ap;return u.imageName=o,u}}class Nd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(o,u){const f=new Nd;for(let _=0;_=0&&f>=o&&dg[this.text.charCodeAt(f)];f--)u--;this.text=this.text.substring(o,u),this.sectionIndex=this.sectionIndex.slice(o,u)}substring(o,u){const f=new Nd;return f.text=this.text.substring(o,u),f.sectionIndex=this.sectionIndex.slice(o,u),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((o,u)=>Math.max(o,this.sections[u].scale),0)}addTextSection(o,u){this.text+=o.text,this.sections.push(ap.forText(o.scale,o.fontStack||u));const f=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function hg(l,o,u,f,_,x,C,M,A,F,O,B,H,q,W,se){const oe=Nd.fromFeature(l,_);let be;B===b.WritingMode.vertical&&oe.verticalizePunctuation();const{processBidirectionalText:Ce,processStyledBidirectionalText:me}=go;if(Ce&&1===oe.sections.length){be=[];const Ve=Ce(oe.toString(),lp(oe,F,x,o,f,q,W));for(const gt of Ve){const Ct=new Nd;Ct.text=gt,Ct.sections=oe.sections;for(let at=0;at0&&ll>Qi&&(Qi=ll)}else{const rs=Ct[Qt.fontStack],xo=rs&&rs[_n];if(xo&&xo.rect)ns=xo.rect,Cs=xo.metrics;else{const ll=gt[Qt.fontStack],xp=ll&&ll[_n];if(!xp)continue;Cs=xp.metrics}Pi=24*(yi-Qt.scale)}Ds?(Ve.verticalizable=!0,bo.push({glyph:_n,imageName:Es,x:Qn,y:or+Pi,vertical:Ds,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:Bo,metrics:Cs,rect:ns}),Qn+=al*Qt.scale+Et):(bo.push({glyph:_n,imageName:Es,x:Qn,y:or+Pi,vertical:Ds,scale:Qt.scale,fontStack:Qt.fontStack,sectionIndex:Bo,metrics:Cs,rect:ns}),Qn+=Cs.advance*Qt.scale+Et)}0!==bo.length&&(Lr=Math.max(Qn-Et,Lr),g1(bo,0,bo.length-1,Ai,Qi)),Qn=0;const fr=Qe*yi+Qi;Ji.lineOffset=Math.max(Qi,ki),or+=fr,ws=Math.max(fr,ws),++Gr}var Nr;const Qr=or- -17,{horizontalAlign:Ki,verticalAlign:zo}=Yi(ot);(function(Ar,yi,ki,Ji,bo,Qi,fr,_i,Qt){const Bo=(yi-ki)*bo;let _n=0;_n=Qi!==fr?-_i*Ji- -17:(-Ji*Qt+.5)*fr;for(const Pi of Ar)for(const Cs of Pi.positionedGlyphs)Cs.x+=Bo,Cs.y+=_n})(Ve.positionedLines,Ai,Ki,zo,Lr,ws,Qe,Qr,tt.length),Ve.top+=-zo*Qr,Ve.bottom=Ve.top+Qr,Ve.left+=-Ki*Lr,Ve.right=Ve.left+Lr}($e,o,u,f,be,C,M,A,B,F,H,se),!function(Ve){for(const gt of Ve)if(0!==gt.positionedGlyphs.length)return!1;return!0}(Ee)&&$e}const dg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},I2={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Z_(l,o,u,f,_,x){if(o.imageName){const C=f[o.imageName];return C?C.displaySize[0]*o.scale*24/x+_:0}{const C=u[o.fontStack],M=C&&C[l];return M?M.metrics.advance*o.scale+_:0}}function fg(l,o,u,f){const _=Math.pow(l-o,2);return f?l=0;let O=0;for(let H=0;H-u/2;){if(C--,C<0)return!1;M-=l[C].dist(x),x=l[C]}M+=l[C].dist(l[C+1]),C++;const A=[];let F=0;for(;Mf;)F-=A.shift().angleDelta;if(F>_)return!1;C++,M+=O.dist(B)}return!0}function Y_(l){let o=0;for(let u=0;uF){const W=(F-A)/q,se=Kn(B.x,H.x,W),oe=Kn(B.y,H.y,W),be=new Jl(se,oe,H.angleTo(B),O);return be._round(),!C||X_(l,be,M,C,o)?be:void 0}A+=q}}function vo(l,o,u,f,_,x,C,M,A){const F=yg(f,x,C),O=K_(f,_),B=O*C,H=0===l[0].x||l[0].x===A||0===l[0].y||l[0].y===A;return o-B=0&&Ee=0&&$e=0&&H+F<=O){const Ve=new Jl(Ee,$e,Ce,W);Ve._round(),f&&!X_(l,Ve,x,f,_)||q.push(Ve)}}B+=be}return M||q.length||C||(q=up(l,B/2,u,f,_,x,C,!0,A)),q}function _g(l,o,u,f,_){const x=[];for(let C=0;C=f&&B.x>=f||(O.x>=f?O=new It(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round():B.x>=f&&(B=new It(f,O.y+(f-O.x)/(B.x-O.x)*(B.y-O.y))._round()),O.y>=_&&B.y>=_||(O.y>=_?O=new It(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round():B.y>=_&&(B=new It(O.x+(_-O.y)/(B.y-O.y)*(B.x-O.x),_)._round()),A&&O.equals(A[A.length-1])||(A=[O],x.push(A)),A.push(B)))))}}return x}function hp(l,o,u,f){const _=[],x=l.image,C=x.pixelRatio,M=x.paddedRect.w-2,A=x.paddedRect.h-2,F=l.right-l.left,O=l.bottom-l.top,B=x.stretchX||[[0,M]],H=x.stretchY||[[0,A]],q=(Qe,ot)=>Qe+ot[1]-ot[0],W=B.reduce(q,0),se=H.reduce(q,0),oe=M-W,be=A-se;let Ce=0,me=W,Ee=0,$e=se,Ve=0,gt=oe,Ct=0,at=be;if(x.content&&f){const Qe=x.content;Ce=hi(B,0,Qe[0]),Ee=hi(H,0,Qe[1]),me=hi(B,Qe[0],Qe[2]),$e=hi(H,Qe[1],Qe[3]),Ve=Qe[0]-Ce,Ct=Qe[1]-Ee,gt=Qe[2]-Qe[0]-me,at=Qe[3]-Qe[1]-$e}const tt=(Qe,ot,it,Ge)=>{const Et=zd(Qe.stretch-Ce,me,F,l.left),pt=dp(Qe.fixed-Ve,gt,Qe.stretch,W),Yt=zd(ot.stretch-Ee,$e,O,l.top),Qn=dp(ot.fixed-Ct,at,ot.stretch,se),or=zd(it.stretch-Ce,me,F,l.left),Lr=dp(it.fixed-Ve,gt,it.stretch,W),ws=zd(Ge.stretch-Ee,$e,O,l.top),Ai=dp(Ge.fixed-Ct,at,Ge.stretch,se),Gr=new It(Et,Yt),Nr=new It(or,Yt),Qr=new It(or,ws),Ki=new It(Et,ws),zo=new It(pt/C,Qn/C),Ar=new It(Lr/C,Ai/C),yi=o*Math.PI/180;if(yi){const bo=Math.sin(yi),Qi=Math.cos(yi),fr=[Qi,-bo,bo,Qi];Gr._matMult(fr),Nr._matMult(fr),Ki._matMult(fr),Qr._matMult(fr)}const ki=Qe.stretch+Qe.fixed,Ji=ot.stretch+ot.fixed;return{tl:Gr,tr:Nr,bl:Ki,br:Qr,tex:{x:x.paddedRect.x+1+ki,y:x.paddedRect.y+1+Ji,w:it.stretch+it.fixed-ki,h:Ge.stretch+Ge.fixed-Ji},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:zo,pixelOffsetBR:Ar,minFontScaleX:gt/C/F,minFontScaleY:at/C/O,isSDF:u}};if(f&&(x.stretchX||x.stretchY)){const Qe=yh(B,oe,W),ot=yh(H,be,se);for(let it=0;it0&&(W=Math.max(10,W),this.circleDiameter=W)}else{let B=C.top*M-A[0],H=C.bottom*M+A[2],q=C.left*M-A[3],W=C.right*M+A[1];const se=C.collisionPadding;if(se&&(q-=se[0]*M,B-=se[1]*M,W+=se[2]*M,H+=se[3]*M),O){const oe=new It(q,B),be=new It(W,B),Ce=new It(q,H),me=new It(W,H),Ee=O*Math.PI/180;oe._rotate(Ee),be._rotate(Ee),Ce._rotate(Ee),me._rotate(Ee),q=Math.min(oe.x,be.x,Ce.x,me.x),W=Math.max(oe.x,be.x,Ce.x,me.x),B=Math.min(oe.y,be.y,Ce.y,me.y),H=Math.max(oe.y,be.y,Ce.y,me.y)}o.emplaceBack(u.x,u.y,q,B,W,H,f,_,x)}this.boxEndIndex=o.length}}class J_{constructor(o=[],u=v1){if(this.data=o,this.length=this.data.length,this.compare=u,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(o){this.data.push(o),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const o=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),o}peek(){return this.data[0]}_up(o){const{data:u,compare:f}=this,_=u[o];for(;o>0;){const x=o-1>>1,C=u[x];if(f(_,C)>=0)break;u[o]=C,o=x}u[o]=_}_down(o){const{data:u,compare:f}=this,_=this.length>>1,x=u[o];for(;o<_;){let C=1+(o<<1),M=u[C];const A=C+1;if(A=0)break;u[o]=M,o=C}u[o]=x}}function v1(l,o){return lo?1:0}function Q_(l,o=1,u=!1){let f=1/0,_=1/0,x=-1/0,C=-1/0;const M=l[0];for(let q=0;qx)&&(x=W.x),(!q||W.y>C)&&(C=W.y)}const A=Math.min(x-f,C-_);let F=A/2;const O=new J_([],b1);if(0===A)return new It(f,_);for(let q=f;qB.d||!B.d)&&(B=q,u&&console.log("found best %d after %d probes",Math.round(1e4*q.d)/1e4,H)),q.max-B.d<=o||(F=q.h/2,O.push(new Kc(q.p.x-F,q.p.y-F,F,l)),O.push(new Kc(q.p.x+F,q.p.y-F,F,l)),O.push(new Kc(q.p.x-F,q.p.y+F,F,l)),O.push(new Kc(q.p.x+F,q.p.y+F,F,l)),H+=4)}return u&&(console.log(`num probes: ${H}`),console.log(`best distance: ${B.d}`)),B.p}function b1(l,o){return o.max-l.max}function Kc(l,o,u,f){this.p=new It(l,o),this.h=u,this.d=function(_,x){let C=!1,M=1/0;for(let A=0;A_.y!=W.y>_.y&&_.x<(W.x-q.x)*(_.y-q.y)/(W.y-q.y)+q.x&&(C=!C),M=Math.min(M,rr(_,q,W))}}return(C?1:-1)*Math.sqrt(M)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}const vg=Number.POSITIVE_INFINITY;function ev(l,o){return o[1]!==vg?function(u,f,_){let x=0,C=0;switch(f=Math.abs(f),_=Math.abs(_),u){case"top-right":case"top-left":case"top":C=_-7;break;case"bottom-right":case"bottom-left":case"bottom":C=7-_}switch(u){case"top-right":case"bottom-right":case"right":x=-f;break;case"top-left":case"bottom-left":case"left":x=f}return[x,C]}(l,o[0],o[1]):function(u,f){let _=0,x=0;f<0&&(f=0);const C=f/Math.sqrt(2);switch(u){case"top-right":case"top-left":x=C-7;break;case"bottom-right":case"bottom-left":x=7-C;break;case"bottom":x=7-f;break;case"top":x=f-7}switch(u){case"top-right":case"bottom-right":_=-C;break;case"top-left":case"bottom-left":_=C;break;case"left":_=f;break;case"right":_=-f}return[_,x]}(l,o[0])}function Bd(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function bg(l,o,u,f,_,x,C,M,A,F,O){let B=x.textMaxSize.evaluate(o,{});void 0===B&&(B=C);const H=l.layers[0].layout,q=H.get("icon-offset").evaluate(o,{},O),W=tv(u.horizontal),se=C/24,oe=l.tilePixelRatio*se,be=l.tilePixelRatio*B/24,Ce=l.tilePixelRatio*M,me=l.tilePixelRatio*H.get("symbol-spacing"),Ee=H.get("text-padding")*l.tilePixelRatio,$e=function(Ge,Et,pt,Yt=1){const Qn=Ge.get("icon-padding").evaluate(Et,{},pt),or=Qn&&Qn.values;return[or[0]*Yt,or[1]*Yt,or[2]*Yt,or[3]*Yt]}(H,o,O,l.tilePixelRatio),Ve=H.get("text-max-angle")/180*Math.PI,gt="viewport"!==H.get("text-rotation-alignment")&&"point"!==H.get("symbol-placement"),Ct="map"===H.get("icon-rotation-alignment")&&"point"!==H.get("symbol-placement"),at=H.get("symbol-placement"),tt=me/2,Qe=H.get("icon-text-fit");let ot;f&&"none"!==Qe&&(l.allowVerticalPlacement&&u.vertical&&(ot=W_(f,u.vertical,Qe,H.get("icon-text-fit-padding"),q,se)),W&&(f=W_(f,W,Qe,H.get("icon-text-fit-padding"),q,se)));const it=(Ge,Et)=>{Et.x<0||Et.x>=yn||Et.y<0||Et.y>=yn||function(pt,Yt,Qn,or,Lr,ws,Ai,Gr,Nr,Qr,Ki,zo,Ar,yi,ki,Ji,bo,Qi,fr,_i,Qt,Bo,_n,Pi,Cs){const ns=pt.addToLineVertexArray(Yt,Qn);let Es,al,Ds,rs,xo=0,ll=0,xp=0,A1=0,Qc=-1,Zd=-1;const va={};let Rg=j(""),wp=0,Fg=0;if(void 0===Gr._unevaluatedLayout.getValue("text-radial-offset")?[wp,Fg]=Gr.layout.get("text-offset").evaluate(Qt,{},Pi).map(wo=>24*wo):(wp=24*Gr.layout.get("text-radial-offset").evaluate(Qt,{},Pi),Fg=vg),pt.allowVerticalPlacement&&or.vertical){const wo=Gr.layout.get("text-rotate").evaluate(Qt,{},Pi)+90;Ds=new fp(Nr,Yt,Qr,Ki,zo,or.vertical,Ar,yi,ki,wo),Ai&&(rs=new fp(Nr,Yt,Qr,Ki,zo,Ai,bo,Qi,ki,wo))}if(Lr){const wo=Gr.layout.get("icon-rotate").evaluate(Qt,{}),Ss="none"!==Gr.layout.get("icon-text-fit"),oc=hp(Lr,wo,_n,Ss),Ms=Ai?hp(Ai,wo,_n,Ss):void 0;al=new fp(Nr,Yt,Qr,Ki,zo,Lr,bo,Qi,!1,wo),xo=4*oc.length;const zg=pt.iconSizeData;let cl=null;"source"===zg.kind?(cl=[_a*Gr.layout.get("icon-size").evaluate(Qt,{})],cl[0]>Ql&&fn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===zg.kind&&(cl=[_a*Bo.compositeIconSizes[0].evaluate(Qt,{},Pi),_a*Bo.compositeIconSizes[1].evaluate(Qt,{},Pi)],(cl[0]>Ql||cl[1]>Ql)&&fn(`${pt.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),pt.addSymbols(pt.icon,oc,cl,_i,fr,Qt,b.WritingMode.none,Yt,ns.lineStartIndex,ns.lineLength,-1,Pi),Qc=pt.icon.placedSymbolArray.length-1,Ms&&(ll=4*Ms.length,pt.addSymbols(pt.icon,Ms,cl,_i,fr,Qt,b.WritingMode.vertical,Yt,ns.lineStartIndex,ns.lineLength,-1,Pi),Zd=pt.icon.placedSymbolArray.length-1)}const Og=Object.keys(or.horizontal);for(const wo of Og){const Ss=or.horizontal[wo];if(!Es){Rg=j(Ss.text);const Ms=Gr.layout.get("text-rotate").evaluate(Qt,{},Pi);Es=new fp(Nr,Yt,Qr,Ki,zo,Ss,Ar,yi,ki,Ms)}const oc=1===Ss.positionedLines.length;if(xp+=xg(pt,Yt,Ss,ws,Gr,ki,Qt,Ji,ns,or.vertical?b.WritingMode.horizontal:b.WritingMode.horizontalOnly,oc?Og:[wo],va,Qc,Bo,Pi),oc)break}or.vertical&&(A1+=xg(pt,Yt,or.vertical,ws,Gr,ki,Qt,Ji,ns,b.WritingMode.vertical,["vertical"],va,Zd,Bo,Pi));const cv=Es?Es.boxStartIndex:pt.collisionBoxArray.length,Lg=Es?Es.boxEndIndex:pt.collisionBoxArray.length,A2=Ds?Ds.boxStartIndex:pt.collisionBoxArray.length,k1=Ds?Ds.boxEndIndex:pt.collisionBoxArray.length,Ng=al?al.boxStartIndex:pt.collisionBoxArray.length,uv=al?al.boxEndIndex:pt.collisionBoxArray.length,hv=rs?rs.boxStartIndex:pt.collisionBoxArray.length,eu=rs?rs.boxEndIndex:pt.collisionBoxArray.length;let Gs=-1;const wh=(wo,Ss)=>wo&&wo.circleDiameter?Math.max(wo.circleDiameter,Ss):Ss;Gs=wh(Es,Gs),Gs=wh(Ds,Gs),Gs=wh(al,Gs),Gs=wh(rs,Gs);const Wd=Gs>-1?1:0;Wd&&(Gs*=Cs/24),pt.glyphOffsetArray.length>=tc.MAX_GLYPHS&&fn("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Qt.sortKey&&pt.addToSortKeyRanges(pt.symbolInstances.length,Qt.sortKey),pt.symbolInstances.emplaceBack(Yt.x,Yt.y,va.right>=0?va.right:-1,va.center>=0?va.center:-1,va.left>=0?va.left:-1,va.vertical||-1,Qc,Zd,Rg,cv,Lg,A2,k1,Ng,uv,hv,eu,Qr,xp,A1,xo,ll,Wd,0,Ar,wp,Fg,Gs)}(l,Et,Ge,u,f,_,ot,l.layers[0],l.collisionBoxArray,o.index,o.sourceLayerIndex,l.index,oe,[Ee,Ee,Ee,Ee],gt,A,Ce,$e,Ct,q,o,x,F,O,C)};if("line"===at)for(const Ge of _g(o.geometry,0,0,yn,yn)){const Et=vo(Ge,me,Ve,u.vertical||W,f,24,be,l.overscaling,yn);for(const pt of Et)W&&Vd(l,W.text,tt,pt)||it(Ge,pt)}else if("line-center"===at){for(const Ge of o.geometry)if(Ge.length>1){const Et=_1(Ge,Ve,u.vertical||W,f,24,be);Et&&it(Ge,Et)}}else if("Polygon"===o.type)for(const Ge of Md(o.geometry,0)){const Et=Q_(Ge,16);it(Ge[0],new Jl(Et.x,Et.y,0))}else if("LineString"===o.type)for(const Ge of o.geometry)it(Ge,new Jl(Ge[0].x,Ge[0].y,0));else if("Point"===o.type)for(const Ge of o.geometry)for(const Et of Ge)it([Et],new Jl(Et.x,Et.y,0))}const Ql=32640;function xg(l,o,u,f,_,x,C,M,A,F,O,B,H,q,W){const se=function(Ce,me,Ee,$e,Ve,gt,Ct,at){const tt=$e.layout.get("text-rotate").evaluate(gt,{})*Math.PI/180,Qe=[];for(const ot of me.positionedLines)for(const it of ot.positionedGlyphs){if(!it.rect)continue;const Ge=it.rect||{};let Et=4,pt=!0,Yt=1,Qn=0;const or=(Ve||at)&&it.vertical,Lr=it.metrics.advance*it.scale/2;if(at&&me.verticalizable&&(Qn=ot.lineOffset/2-(it.imageName?-(24-it.metrics.width*it.scale)/2:24*(it.scale-1))),it.imageName){const fr=Ct[it.imageName];pt=fr.sdf,Yt=fr.pixelRatio,Et=1/Yt}const ws=Ve?[it.x+Lr,it.y]:[0,0];let Ai=Ve?[0,0]:[it.x+Lr+Ee[0],it.y+Ee[1]-Qn],Gr=[0,0];or&&(Gr=Ai,Ai=[0,0]);const Nr=(it.metrics.left-Et)*it.scale-Lr+Ai[0],Qr=(-it.metrics.top-Et)*it.scale+Ai[1],Ki=Nr+Ge.w*it.scale/Yt,zo=Qr+Ge.h*it.scale/Yt,Ar=new It(Nr,Qr),yi=new It(Ki,Qr),ki=new It(Nr,zo),Ji=new It(Ki,zo);if(or){const fr=new It(-Lr,Lr- -17),_i=-Math.PI/2,Qt=12-Lr,Bo=new It(22-Qt,-(it.imageName?Qt:0)),_n=new It(...Gr);Ar._rotateAround(_i,fr)._add(Bo)._add(_n),yi._rotateAround(_i,fr)._add(Bo)._add(_n),ki._rotateAround(_i,fr)._add(Bo)._add(_n),Ji._rotateAround(_i,fr)._add(Bo)._add(_n)}if(tt){const fr=Math.sin(tt),_i=Math.cos(tt),Qt=[_i,-fr,fr,_i];Ar._matMult(Qt),yi._matMult(Qt),ki._matMult(Qt),Ji._matMult(Qt)}const bo=new It(0,0),Qi=new It(0,0);Qe.push({tl:Ar,tr:yi,bl:ki,br:Ji,tex:Ge,writingMode:me.writingMode,glyphOffset:ws,sectionIndex:it.sectionIndex,isSDF:pt,pixelOffsetTL:bo,pixelOffsetBR:Qi,minFontScaleX:0,minFontScaleY:0})}return Qe}(0,u,M,_,x,C,f,l.allowVerticalPlacement),oe=l.textSizeData;let be=null;"source"===oe.kind?(be=[_a*_.layout.get("text-size").evaluate(C,{})],be[0]>Ql&&fn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===oe.kind&&(be=[_a*q.compositeTextSizes[0].evaluate(C,{},W),_a*q.compositeTextSizes[1].evaluate(C,{},W)],(be[0]>Ql||be[1]>Ql)&&fn(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),l.addSymbols(l.text,se,be,M,x,C,F,o,A.lineStartIndex,A.lineLength,H,W);for(const Ce of O)B[Ce]=l.text.placedSymbolArray.length-1;return 4*se.length}function tv(l){for(const o in l)return l[o];return null}function Vd(l,o,u,f){const _=l.compareText;if(o in _){const x=_[o];for(let C=x.length-1;C>=0;C--)if(f.dist(x[C])C.id),this.index=o.index,this.pixelRatio=o.pixelRatio,this.sourceLayerIndex=o.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=qf([]),this.placementViewportMatrix=qf([]);const u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=cp(this.zoom,u["text-size"]),this.iconSizeData=cp(this.zoom,u["icon-size"]);const f=this.layers[0].layout,_=f.get("symbol-sort-key"),x=f.get("symbol-z-order");this.canOverlap="never"!==Cg(f,"text-overlap","text-allow-overlap")||"never"!==Cg(f,"icon-overlap","icon-allow-overlap")||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==x&&!_.isConstant(),this.sortFeaturesByY=("viewport-y"===x||"auto"===x&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===f.get("symbol-placement")&&(this.writingModes=f.get("text-writing-mode").map(C=>b.WritingMode[C])),this.stateDependentLayerIds=this.layers.filter(C=>C.isStateDependent()).map(C=>C.id),this.sourceID=o.sourceID}createArrays(){this.text=new rv(new Ht(this.layers,this.zoom,o=>/^text/.test(o))),this.icon=new rv(new Ht(this.layers,this.zoom,o=>/^icon/.test(o))),this.glyphOffsetArray=new en,this.lineVertexArray=new Zl,this.symbolInstances=new He}calculateGlyphDependencies(o,u,f,_,x){for(let C=0;C0)&&("constant"!==C.value.kind||C.value.value.length>0),O="constant"!==A.value.kind||!!A.value.value||Object.keys(A.parameters).length>0,B=x.get("symbol-sort-key");if(this.features=[],!F&&!O)return;const H=u.iconDependencies,q=u.glyphDependencies,W=u.availableImages,se=new hr(this.zoom);for(const{feature:oe,id:be,index:Ce,sourceLayerIndex:me}of o){const Ee=_._featureFilter.needGeometry,$e=ci(oe,Ee);if(!_._featureFilter.filter(se,$e,f))continue;let Ve,gt;if(Ee||($e.geometry=vr(oe)),F){const at=_.getValueAndResolveTokens("text-field",$e,f,W),tt=Xr.factory(at);nv(tt)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===$l()||this.hasRTLText&&go.isParsed())&&(Ve=Fd(tt,_,$e))}if(O){const at=_.getValueAndResolveTokens("icon-image",$e,f,W);gt=at instanceof mi?at:mi.fromString(at)}if(!Ve&&!gt)continue;const Ct=this.sortFeaturesByKey?B.evaluate($e,{},f):void 0;if(this.features.push({id:be,text:Ve,icon:gt,index:Ce,sourceLayerIndex:me,geometry:$e.geometry,properties:oe.properties,type:x1[oe.type],sortKey:Ct}),gt&&(H[gt.name]=!0),Ve){const at=C.evaluate($e,{},f).join(","),tt="viewport"!==x.get("text-rotation-alignment")&&"point"!==x.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(b.WritingMode.vertical)>=0;for(const Qe of Ve.sections)if(Qe.image)H[Qe.image.name]=!0;else{const ot=po(Ve.toString()),it=Qe.fontStack||at,Ge=q[it]=q[it]||{};this.calculateGlyphDependencies(Qe.text,Ge,tt,this.allowVerticalPlacement,ot)}}}"line"===x.get("symbol-placement")&&(this.features=function(oe){const be={},Ce={},me=[];let Ee=0;function $e(at){me.push(oe[at]),Ee++}function Ve(at,tt,Qe){const ot=Ce[at];return delete Ce[at],Ce[tt]=ot,me[ot].geometry[0].pop(),me[ot].geometry[0]=me[ot].geometry[0].concat(Qe[0]),ot}function gt(at,tt,Qe){const ot=be[tt];return delete be[tt],be[at]=ot,me[ot].geometry[0].shift(),me[ot].geometry[0]=Qe[0].concat(me[ot].geometry[0]),ot}function Ct(at,tt,Qe){const ot=Qe?tt[0][tt[0].length-1]:tt[0][0];return`${at}:${ot.x}:${ot.y}`}for(let at=0;atat.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((oe,be)=>oe.sortKey-be.sortKey)}update(o,u,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(o,u,this.layers,f),this.icon.programConfigurations.updatePaintArrays(o,u,this.layers,f))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(o),this.iconCollisionBox.upload(o)),this.text.upload(o,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(o,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(o,u){const f=this.lineVertexArray.length;if(void 0!==o.segment){let _=o.dist(u[o.segment+1]),x=o.dist(u[o.segment]);const C={};for(let M=o.segment+1;M=0;M--)C[M]={x:u[M].x,y:u[M].y,tileUnitDistanceFromAnchor:x},M>0&&(x+=u[M-1].dist(u[M]));for(let M=0;M0}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(o,u){const f=o.placedSymbolArray.get(u),_=f.vertexStartIndex+4*f.numGlyphs;for(let x=f.vertexStartIndex;x<_;x+=4)o.indexArray.emplaceBack(x,x+1,x+2),o.indexArray.emplaceBack(x+1,x+2,x+3)}getSortedSymbolIndexes(o){if(this.sortedAngle===o&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const u=Math.sin(o),f=Math.cos(o),_=[],x=[],C=[];for(let M=0;M_[M]-_[A]||x[A]-x[M]),C}addToSortKeyRanges(o,u){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===u?f.symbolInstanceEnd=o+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:o,symbolInstanceEnd:o+1})}sortFeatures(o){if(this.sortFeaturesByY&&this.sortedAngle!==o&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(o),this.sortedAngle=o,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const u of this.symbolInstanceIndexes){const f=this.symbolInstances.get(u);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((_,x,C)=>{_>=0&&C.indexOf(_)===x&&this.addIndicesForPlacedSymbol(this.text,_)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ct("SymbolBucket",tc,{omit:["layers","collisionBoxArray","features","compareText"]}),tc.MAX_GLYPHS=65535,tc.addDynamicAttributes=Ud;const iv=new Si({"symbol-placement":new wt(Ae.layout_symbol["symbol-placement"]),"symbol-spacing":new wt(Ae.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wt(Ae.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yt(Ae.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wt(Ae.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wt(Ae.layout_symbol["icon-allow-overlap"]),"icon-overlap":new wt(Ae.layout_symbol["icon-overlap"]),"icon-ignore-placement":new wt(Ae.layout_symbol["icon-ignore-placement"]),"icon-optional":new wt(Ae.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wt(Ae.layout_symbol["icon-rotation-alignment"]),"icon-size":new yt(Ae.layout_symbol["icon-size"]),"icon-text-fit":new wt(Ae.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wt(Ae.layout_symbol["icon-text-fit-padding"]),"icon-image":new yt(Ae.layout_symbol["icon-image"]),"icon-rotate":new yt(Ae.layout_symbol["icon-rotate"]),"icon-padding":new yt(Ae.layout_symbol["icon-padding"]),"icon-keep-upright":new wt(Ae.layout_symbol["icon-keep-upright"]),"icon-offset":new yt(Ae.layout_symbol["icon-offset"]),"icon-anchor":new yt(Ae.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wt(Ae.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wt(Ae.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wt(Ae.layout_symbol["text-rotation-alignment"]),"text-field":new yt(Ae.layout_symbol["text-field"]),"text-font":new yt(Ae.layout_symbol["text-font"]),"text-size":new yt(Ae.layout_symbol["text-size"]),"text-max-width":new yt(Ae.layout_symbol["text-max-width"]),"text-line-height":new wt(Ae.layout_symbol["text-line-height"]),"text-letter-spacing":new yt(Ae.layout_symbol["text-letter-spacing"]),"text-justify":new yt(Ae.layout_symbol["text-justify"]),"text-radial-offset":new yt(Ae.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wt(Ae.layout_symbol["text-variable-anchor"]),"text-anchor":new yt(Ae.layout_symbol["text-anchor"]),"text-max-angle":new wt(Ae.layout_symbol["text-max-angle"]),"text-writing-mode":new wt(Ae.layout_symbol["text-writing-mode"]),"text-rotate":new yt(Ae.layout_symbol["text-rotate"]),"text-padding":new wt(Ae.layout_symbol["text-padding"]),"text-keep-upright":new wt(Ae.layout_symbol["text-keep-upright"]),"text-transform":new yt(Ae.layout_symbol["text-transform"]),"text-offset":new yt(Ae.layout_symbol["text-offset"]),"text-allow-overlap":new wt(Ae.layout_symbol["text-allow-overlap"]),"text-overlap":new wt(Ae.layout_symbol["text-overlap"]),"text-ignore-placement":new wt(Ae.layout_symbol["text-ignore-placement"]),"text-optional":new wt(Ae.layout_symbol["text-optional"])});var wg={paint:new Si({"icon-opacity":new yt(Ae.paint_symbol["icon-opacity"]),"icon-color":new yt(Ae.paint_symbol["icon-color"]),"icon-halo-color":new yt(Ae.paint_symbol["icon-halo-color"]),"icon-halo-width":new yt(Ae.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yt(Ae.paint_symbol["icon-halo-blur"]),"icon-translate":new wt(Ae.paint_symbol["icon-translate"]),"icon-translate-anchor":new wt(Ae.paint_symbol["icon-translate-anchor"]),"text-opacity":new yt(Ae.paint_symbol["text-opacity"]),"text-color":new yt(Ae.paint_symbol["text-color"],{runtimeType:so,getOverride:l=>l.textColor,hasOverride:l=>!!l.textColor}),"text-halo-color":new yt(Ae.paint_symbol["text-halo-color"]),"text-halo-width":new yt(Ae.paint_symbol["text-halo-width"]),"text-halo-blur":new yt(Ae.paint_symbol["text-halo-blur"]),"text-translate":new wt(Ae.paint_symbol["text-translate"]),"text-translate-anchor":new wt(Ae.paint_symbol["text-translate-anchor"])}),layout:iv};class pp{constructor(o){if(void 0===o.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=o.property.overrides?o.property.overrides.runtimeType:fs,this.defaultValue=o}evaluate(o){if(o.formattedSection){const u=this.defaultValue.property.overrides;if(u&&u.hasOverride(o.formattedSection))return u.getOverride(o.formattedSection)}return o.feature&&o.featureState?this.defaultValue.evaluate(o.feature,o.featureState):this.defaultValue.property.specification.default}eachChild(o){this.defaultValue.isConstant()||o(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ct("FormatSectionOverride",pp,{omit:["defaultValue"]});class mp extends Ko{constructor(o){super(o,wg)}recalculate(o,u){if(super.recalculate(o,u),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const f=this.layout.get("text-writing-mode");if(f){const _=[];for(const x of f)_.indexOf(x)<0&&_.push(x);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(o,u,f,_){const x=this.layout.get(o).evaluate(u,{},f,_),C=this._unevaluatedLayout._values[o];return C.isDataDriven()||Cn(C.value)||!x?x:(M=u.properties,x.replace(/{([^{}]+)}/g,(F,O)=>O in M?String(M[O]):""));var M}createBucket(o){return new tc(o)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const o of wg.paint.overridableProperties){if(!mp.hasPaintOverride(this.layout,o))continue;const u=this.paint.get(o),f=new pp(u),_=new la(f,u.property.specification);let x=null;x="constant"===u.value.kind||"source"===u.value.kind?new zc("source",_):new Bc("composite",_,u.value.zoomStops),this.paint._values[o]=new ys(u.property,x,u.parameters)}}_handleOverridablePaintPropertyUpdate(o,u,f){return!(!this.layout||u.isDataDriven()||f.isDataDriven())&&mp.hasPaintOverride(this.layout,o)}static hasPaintOverride(o,u){const f=o.get("text-field"),_=wg.paint.properties[u];let x=!1;const C=M=>{for(const A of M)if(_.overrides&&_.overrides.hasOverride(A))return void(x=!0)};if("constant"===f.value.kind&&f.value.value instanceof Xr)C(f.value.value.sections);else if("source"===f.value.kind){const M=F=>{x||(F instanceof $&&J(F.value)===Ei?C(F.value.sections):F instanceof Nc?C(F.sections):F.eachChild(M))},A=f.value;A._styleExpression&&M(A._styleExpression.expression)}return x}}function Cg(l,o,u){let f="never";const _=l.get(o);return _?f=_:l.get(u)&&(f="always"),f}var C1={paint:new Si({"background-color":new wt(Ae.paint_background["background-color"]),"background-pattern":new fd(Ae.paint_background["background-pattern"]),"background-opacity":new wt(Ae.paint_background["background-opacity"])})},E1={paint:new Si({"raster-opacity":new wt(Ae.paint_raster["raster-opacity"]),"raster-hue-rotate":new wt(Ae.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new wt(Ae.paint_raster["raster-brightness-min"]),"raster-brightness-max":new wt(Ae.paint_raster["raster-brightness-max"]),"raster-saturation":new wt(Ae.paint_raster["raster-saturation"]),"raster-contrast":new wt(Ae.paint_raster["raster-contrast"]),"raster-resampling":new wt(Ae.paint_raster["raster-resampling"]),"raster-fade-duration":new wt(Ae.paint_raster["raster-fade-duration"])})};class D1 extends Ko{constructor(o){super(o,{}),this.onAdd=u=>{this.implementation.onAdd&&this.implementation.onAdd(u,u.painter.context.gl)},this.onRemove=u=>{this.implementation.onRemove&&this.implementation.onRemove(u,u.painter.context.gl)},this.implementation=o}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const S1={circle:class extends Ko{constructor(l){super(l,wd)}createBucket(l){return new Jo(l)}queryRadius(l){const o=l;return ma("circle-radius",this,o)+ma("circle-stroke-width",this,o)+Hs(this.paint.get("circle-translate"))}queryIntersectsFeature(l,o,u,f,_,x,C,M){const A=ah(l,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),x.angle,C),F=this.paint.get("circle-radius").evaluate(o,u)+this.paint.get("circle-stroke-width").evaluate(o,u),O="map"===this.paint.get("circle-pitch-alignment"),B=O?A:(W=M,A.map(se=>lh(se,W))),H=O?F*C:F;var W;for(const q of f)for(const W of q){const se=O?W:lh(W,M);let oe=H;const be=Zf([],[W.x,W.y,0,1],M);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?oe*=be[3]/x.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(oe*=x.cameraToCenterDistance/be[3]),Wl(B,se,oe))return!0}return!1}},heatmap:class extends Ko{createBucket(l){return new Wf(l)}constructor(l){super(l,Gm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){"heatmap-color"===l&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Zm({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},hillshade:class extends Ko{constructor(l){super(l,k_)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},fill:class extends Ko{constructor(l){super(l,N_)}recalculate(l,o){super.recalculate(l,o);const u=this.paint._values["fill-outline-color"];"constant"===u.value.kind&&void 0===u.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(l){return new _o(l)}queryRadius(){return Hs(this.paint.get("fill-translate"))}queryIntersectsFeature(l,o,u,f,_,x,C){return Fr(ah(l,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),x.angle,C),f)}isTileClipped(){return!0}},"fill-extrusion":class extends Ko{constructor(l){super(l,S2)}createBucket(l){return new ng(l)}queryRadius(){return Hs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(l,o,u,f,_,x,C,M){const A=ah(l,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,C),F=this.paint.get("fill-extrusion-height").evaluate(o,u),O=this.paint.get("fill-extrusion-base").evaluate(o,u),B=function(q,W,se,oe){const be=[];for(const Ce of q){const me=[Ce.x,Ce.y,0,1];Zf(me,me,W),be.push(new It(me[0]/me[3],me[1]/me[3]))}return be}(A,M),H=function(q,W,se,oe){const be=[],Ce=[],me=oe[8]*W,Ee=oe[9]*W,$e=oe[10]*W,Ve=oe[11]*W,gt=oe[8]*se,Ct=oe[9]*se,at=oe[10]*se,tt=oe[11]*se;for(const Qe of q){const ot=[],it=[];for(const Ge of Qe){const Et=Ge.x,pt=Ge.y,Yt=oe[0]*Et+oe[4]*pt+oe[12],Qn=oe[1]*Et+oe[5]*pt+oe[13],or=oe[2]*Et+oe[6]*pt+oe[14],Lr=oe[3]*Et+oe[7]*pt+oe[15],ws=or+$e,Ai=Lr+Ve,Gr=Yt+gt,Nr=Qn+Ct,Qr=or+at,Ki=Lr+tt,zo=new It((Yt+me)/Ai,(Qn+Ee)/Ai);zo.z=ws/Ai,ot.push(zo);const Ar=new It(Gr/Ki,Nr/Ki);Ar.z=Qr/Ki,it.push(Ar)}be.push(ot),Ce.push(it)}return[be,Ce]}(f,O,F,M);return function(q,W,se){let oe=1/0;Fr(se,W)&&(oe=np(se,W[0]));for(let be=0;be=3)for(let se=0;se{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const $d=6371008.8;class br{constructor(o,u){if(isNaN(o)||isNaN(u))throw new Error(`Invalid LngLat object: (${o}, ${u})`);if(this.lng=+o,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new br(Ie(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(o){const u=Math.PI/180,f=this.lat*u,_=o.lat*u,x=Math.sin(f)*Math.sin(_)+Math.cos(f)*Math.cos(_)*Math.cos((o.lng-this.lng)*u);return $d*Math.acos(Math.min(x,1))}toBounds(o=0){const u=360*o/40075017,f=u/Math.cos(Math.PI/180*this.lat);return new sv(new br(this.lng-f,this.lat-u),new br(this.lng+f,this.lat+u))}static convert(o){if(o instanceof br)return o;if(Array.isArray(o)&&(2===o.length||3===o.length))return new br(Number(o[0]),Number(o[1]));if(!Array.isArray(o)&&"object"==typeof o&&null!==o)return new br(Number("lng"in o?o.lng:o.lon),Number(o.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class nc{constructor(o,u){o&&(u?this.setSouthWest(o).setNorthEast(u):4===o.length?this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]]):this.setSouthWest(o[0]).setNorthEast(o[1]))}setNorthEast(o){return this._ne=o instanceof br?new br(o.lng,o.lat):br.convert(o),this}setSouthWest(o){return this._sw=o instanceof br?new br(o.lng,o.lat):br.convert(o),this}extend(o){const u=this._sw,f=this._ne;let _,x;if(o instanceof br)_=o,x=o;else{if(!(o instanceof nc))return Array.isArray(o)?4===o.length||o.every(Array.isArray)?this.extend(nc.convert(o)):this.extend(br.convert(o)):this;if(_=o._sw,x=o._ne,!_||!x)return this}return u||f?(u.lng=Math.min(_.lng,u.lng),u.lat=Math.min(_.lat,u.lat),f.lng=Math.max(x.lng,f.lng),f.lat=Math.max(x.lat,f.lat)):(this._sw=new br(_.lng,_.lat),this._ne=new br(x.lng,x.lat)),this}getCenter(){return new br((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 br(this.getWest(),this.getNorth())}getSouthEast(){return new br(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(o){const{lng:u,lat:f}=br.convert(o);let _=this._sw.lng<=u&&u<=this._ne.lng;return this._sw.lng>this._ne.lng&&(_=this._sw.lng>=u&&u>=this._ne.lng),this._sw.lat<=f&&f<=this._ne.lat&&_}static convert(o){return o instanceof nc?o:o&&new nc(o)}}var sv=nc;const av=2*Math.PI*$d;function Eg(l){return av*Math.cos(l*Math.PI/180)}function Dg(l){return(180+l)/360}function rc(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function Sg(l,o){return l/Eg(o)}function gp(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}class yp{constructor(o,u,f=0){this.x=+o,this.y=+u,this.z=+f}static fromLngLat(o,u=0){const f=br.convert(o);return new yp(Dg(f.lng),rc(f.lat),Sg(u,f.lat))}toLngLat(){return new br(360*this.x-180,gp(this.y))}toAltitude(){return this.z*Eg(gp(this.y))}meterInMercatorCoordinateUnits(){return 1/av*(o=gp(this.y),1/Math.cos(o*Math.PI/180));var o}}function M1(l,o,u){var f=2*Math.PI*6378137/256/Math.pow(2,u);return[l*f-2*Math.PI*6378137/2,o*f-2*Math.PI*6378137/2]}class vh{constructor(o,u,f){if(o<0||o>25||f<0||f>=Math.pow(2,o)||u<0||u>=Math.pow(2,o))throw new Error(`x=${u}, y=${f}, z=${o} outside of bounds. 0<=x<${Math.pow(2,o)}, 0<=y<${Math.pow(2,o)} 0<=z<=25 `);this.z=o,this.x=u,this.y=f,this.key=bh(0,o,o,u,f)}equals(o){return this.z===o.z&&this.x===o.x&&this.y===o.y}url(o,u,f){const _=(C=this.y,M=this.z,A=M1(256*(x=this.x),256*(C=Math.pow(2,M)-C-1),M),F=M1(256*(x+1),256*(C+1),M),A[0]+","+A[1]+","+F[0]+","+F[1]);var x,C,M,A,F;const O=function(B,H,q){let W,se="";for(let oe=B;oe>0;oe--)W=1<1?"@2x":"").replace(/{quadkey}/g,O).replace(/{bbox-epsg-3857}/g,_)}isChildOf(o){const u=this.z-o.z;return u>0&&o.x===this.x>>u&&o.y===this.y>>u}getTilePoint(o){const u=Math.pow(2,this.z);return new It((o.x*u-this.x)*yn,(o.y*u-this.y)*yn)}toString(){return`${this.z}/${this.x}/${this.y}`}}class lv{constructor(o,u){this.wrap=o,this.canonical=u,this.key=bh(o,u.z,u.z,u.x,u.y)}}class No{constructor(o,u,f,_,x){if(o= z; overscaledZ = ${o}; z = ${f}`);this.overscaledZ=o,this.wrap=u,this.canonical=new vh(f,+_,+x),this.key=bh(u,o,f,_,x)}clone(){return new No(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(o){return this.overscaledZ===o.overscaledZ&&this.wrap===o.wrap&&this.canonical.equals(o.canonical)}scaledTo(o){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const u=this.canonical.z-o;return o>this.canonical.z?new No(o,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new No(o,this.wrap,o,this.canonical.x>>u,this.canonical.y>>u)}calculateScaledKey(o,u){if(o>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${o}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-o;return o>this.canonical.z?bh(this.wrap*+u,o,this.canonical.z,this.canonical.x,this.canonical.y):bh(this.wrap*+u,o,o,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(o){if(o.wrap!==this.wrap)return!1;const u=this.canonical.z-o.canonical.z;return 0===o.overscaledZ||o.overscaledZ>u&&o.canonical.y===this.canonical.y>>u}children(o){if(this.overscaledZ>=o)return[new No(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const u=this.canonical.z+1,f=2*this.canonical.x,_=2*this.canonical.y;return[new No(u,this.wrap,u,f,_),new No(u,this.wrap,u,f+1,_),new No(u,this.wrap,u,f,_+1),new No(u,this.wrap,u,f+1,_+1)]}isLessThan(o){return this.wrapo.wrap)&&(this.overscaledZo.overscaledZ)&&(this.canonical.xo.canonical.x)&&this.canonical.ythis.max&&(this.max=M),M=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(o+1)}_unpackMapbox(o,u,f){return(256*o*256+256*u+f)/10-1e4}_unpackTerrarium(o,u,f){return 256*o+u+f/256-32768}getPixels(){return new Lo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(o,u,f){if(this.dim!==o.dim)throw new Error("dem dimension mismatch");let _=u*this.dim,x=u*this.dim+this.dim,C=f*this.dim,M=f*this.dim+this.dim;switch(u){case-1:_=x-1;break;case 1:x=_+1}switch(f){case-1:C=M-1;break;case 1:M=C+1}const A=-u*this.dim,F=-f*this.dim;for(let O=C;O=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${o} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[o]}}class Tg{constructor(o,u,f,_,x){this.type="Feature",this._vectorTileFeature=o,o._z=u,o._x=f,o._y=_,this.properties=o.properties,this.id=x}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(o){this._geometry=o}toJSON(){const o={geometry:this.geometry};for(const u in this)"_geometry"!==u&&"_vectorTileFeature"!==u&&(o[u]=this[u]);return o}}class jd{constructor(o,u){this.tileID=o,this.x=o.canonical.x,this.y=o.canonical.y,this.z=o.canonical.z,this.grid=new Vs(yn,16,0),this.grid3D=new Vs(yn,16,0),this.featureIndexArray=new Rr,this.promoteId=u}insert(o,u,f,_,x,C){const M=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,_,x);const A=C?this.grid3D:this.grid;for(let F=0;F=0&&B[3]>=0&&A.insert(M,B[0],B[1],B[2],B[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Kl.VectorTile(new ag(this.rawTileData)).layers,this.sourceLayerCoder=new _p(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(o,u,f,_){this.loadVTLayers();const x=o.params||{},C=yn/o.tileSize/o.scale,M=Ot(x.filter),A=o.queryGeometry,F=o.queryPadding*C,O=Ig(A),B=this.grid.query(O.minX-F,O.minY-F,O.maxX+F,O.maxY+F),H=Ig(o.cameraQueryGeometry),q=this.grid3D.query(H.minX-F,H.minY-F,H.maxX+F,H.maxY+F,(oe,be,Ce,me)=>function(Ee,$e,Ve,gt,Ct){for(const tt of Ee)if($e<=tt.x&&Ve<=tt.y&>>=tt.x&&Ct>=tt.y)return!0;const at=[new It($e,Ve),new It($e,Ct),new It(gt,Ct),new It(gt,Ve)];if(Ee.length>2)for(const tt of at)if(Wi(Ee,tt))return!0;for(let tt=0;tt(me||(me=vr(Ee)),$e.queryIntersectsFeature(A,Ee,Ve,me,this.z,o.transform,C,o.pixelPosMatrix)))}return W}loadMatchingFeature(o,u,f,_,x,C,M,A,F,O,B){const H=this.bucketLayerIDs[u];if(C&&!function(oe,be){for(let Ce=0;Ce=0)return!0;return!1}(C,H))return;const q=this.sourceLayerCoder.decode(f),W=this.vtLayers[q].feature(_);if(x.needGeometry){const oe=ci(W,!0);if(!x.filter(new hr(this.tileID.overscaledZ),oe,this.tileID.canonical))return}else if(!x.filter(new hr(this.tileID.overscaledZ),W))return;const se=this.getId(W,q);for(let oe=0;oe{const M=o instanceof _s?o.get(C):null;return M&&M.evaluate?M.evaluate(u,f,_):M})}function Ig(l){let o=1/0,u=1/0,f=-1/0,_=-1/0;for(const x of l)o=Math.min(o,x.x),u=Math.min(u,x.y),f=Math.max(f,x.x),_=Math.max(_,x.y);return{minX:o,minY:u,maxX:f,maxY:_}}function Ag(l,o){return o-l}function Gd(l,o,u,f,_,x){if(_-f<=u)return;const C=f+_>>1;vp(l,o,C,f,_,x%2),Gd(l,o,u,f,C-1,x+1),Gd(l,o,u,C+1,_,x+1)}function vp(l,o,u,f,_,x){for(;_>f;){if(_-f>600){const F=_-f+1,O=u-f+1,B=Math.log(F),H=.5*Math.exp(2*B/3),q=.5*Math.sqrt(B*H*(F-H)/F)*(O-F/2<0?-1:1);vp(l,o,u,Math.max(f,Math.floor(u-O*H/F+q)),Math.min(_,Math.floor(u+(F-O)*H/F+q)),x)}const C=o[2*u+x];let M=f,A=_;for(sl(l,o,f,u),o[2*_+x]>C&&sl(l,o,f,_);MC;)A--}o[2*f+x]===C?sl(l,o,f,A):(A++,sl(l,o,A,_)),A<=u&&(f=A+1),u<=A&&(_=A-1)}}function sl(l,o,u,f){kg(l,u,f),kg(o,2*u,2*f),kg(o,2*u+1,2*f+1)}function kg(l,o,u){const f=l[o];l[o]=l[u],l[u]=f}function Pg(l,o,u,f){const _=l-u,x=o-f;return _*_+x*x}ct("FeatureIndex",jd,{omit:["rawTileData","sourceLayerCoder"]});const T1=l=>l[0],I1=l=>l[1];var bp;b.PerformanceMarkers=void 0,(bp=b.PerformanceMarkers||(b.PerformanceMarkers={})).create="create",bp.load="load",bp.fullLoad="fullLoad";let xh=null,ic=[];const qd=1e3/30,Jc={mark(l){performance.mark(l)},frame(l){const o=l;null!=xh&&ic.push(o-xh),xh=o},clearMetrics(){xh=null,ic=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const l in b.PerformanceMarkers)performance.clearMarks(b.PerformanceMarkers[l])},getPerformanceMetrics(){performance.measure("loadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.load),performance.measure("fullLoadTime",b.PerformanceMarkers.create,b.PerformanceMarkers.fullLoad);const l=performance.getEntriesByName("loadTime")[0].duration,o=performance.getEntriesByName("fullLoadTime")[0].duration,u=ic.length,f=1/(ic.reduce((x,C)=>x+C,0)/u/1e3),_=ic.filter(x=>x>qd).reduce((x,C)=>x+(C-qd)/qd,0);return{loadTime:l,fullLoadTime:o,fps:f,percentDroppedFrames:_/(u+_)*100}}};b.AJAXError=Os,b.ARRAY_TYPE=tl,b.Actor=class{constructor(l,o,u){this.target=l,this.parent=o,this.mapId=u,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Rs(["receive","process"],this),this.invoker=new ov(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=To()?l:window}send(l,o,u,f,_=!1){const x=Math.round(1e18*Math.random()).toString(36).substring(0,10);u&&(this.callbacks[x]=u);const C=Fs(this.globalScope)?void 0:[];return this.target.postMessage({id:x,type:l,hasCallback:!!u,targetMapId:f,mustQueue:_,sourceMapId:this.mapId,data:fo(o,C)},C),{cancel:()=>{u&&delete this.callbacks[x],this.target.postMessage({id:x,type:"",targetMapId:f,sourceMapId:this.mapId})}}}receive(l){const o=l.data,u=o.id;if(u&&(!o.targetMapId||this.mapId===o.targetMapId))if(""===o.type){delete this.tasks[u];const f=this.cancelCallbacks[u];delete this.cancelCallbacks[u],f&&f()}else To()||o.mustQueue?(this.tasks[u]=o,this.taskQueue.push(u),this.invoker.trigger()):this.processTask(u,o)}process(){if(!this.taskQueue.length)return;const l=this.taskQueue.shift(),o=this.tasks[l];delete this.tasks[l],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(l,o)}processTask(l,o){if(""===o.type){const u=this.callbacks[l];delete this.callbacks[l],u&&(o.error?u(Er(o.error)):u(null,Er(o.data)))}else{let u=!1;const f=Fs(this.globalScope)?void 0:[],_=o.hasCallback?(M,A)=>{u=!0,delete this.cancelCallbacks[l],this.target.postMessage({id:l,type:"",sourceMapId:this.mapId,error:M?fo(M):null,data:fo(A,f)},f)}:M=>{u=!0};let x=null;const C=Er(o.data);if(this.parent[o.type])x=this.parent[o.type](o.sourceMapId,C,_);else if(this.parent.getWorkerSource){const M=o.type.split(".");x=this.parent.getWorkerSource(o.sourceMapId,M[0],C.source)[M[1]](C,_)}else _(new Error(`Could not find function ${o.type}`));!u&&x&&x.cancel&&(this.cancelCallbacks[l]=x.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},b.AlphaImage=uh,b.CanonicalTileID=vh,b.CollisionBoxArray=vd,b.CollisionCircleLayoutArray=class extends gd{},b.Color=Sn,b.DEMData=Mg,b.DataConstantProperty=wt,b.DictionaryCoder=_p,b.EXTENT=yn,b.ErrorEvent=yr,b.EvaluationParameters=hr,b.Event=na,b.Evented=tr,b.FeatureIndex=jd,b.FillBucket=_o,b.FillExtrusionBucket=ng,b.GeoJSONFeature=Tg,b.ImageAtlas=m1,b.ImagePosition=q_,b.KDBush=class{constructor(l,o=T1,u=I1,f=64,_=Float64Array){this.nodeSize=f,this.points=l;const x=l.length<65536?Uint16Array:Uint32Array,C=this.ids=new x(l.length),M=this.coords=new _(2*l.length);for(let A=0;A=C&&q<=A&&W>=M&&W<=F&&H.push(_[Ee]);continue}const Ce=Math.floor((be+oe)/2);q=x[2*Ce],W=x[2*Ce+1],q>=C&&q<=A&&W>=M&&W<=F&&H.push(_[Ce]);const me=(se+1)%2;(0===se?C<=q:M<=W)&&(B.push(be),B.push(Ce-1),B.push(me)),(0===se?A>=q:F>=W)&&(B.push(Ce+1),B.push(oe),B.push(me))}return H}(this.ids,this.coords,l,o,u,f,this.nodeSize)}within(l,o,u){return function(f,_,x,C,M,A){const F=[0,f.length-1,0],O=[],B=M*M;for(;F.length;){const H=F.pop(),q=F.pop(),W=F.pop();if(q-W<=A){for(let me=W;me<=q;me++)Pg(_[2*me],_[2*me+1],x,C)<=B&&O.push(f[me]);continue}const se=Math.floor((W+q)/2),oe=_[2*se],be=_[2*se+1];Pg(oe,be,x,C)<=B&&O.push(f[se]);const Ce=(H+1)%2;(0===H?x-M<=oe:C-M<=be)&&(F.push(W),F.push(se-1),F.push(Ce)),(0===H?x+M>=oe:C+M>=be)&&(F.push(se+1),F.push(q),F.push(Ce))}return O}(this.ids,this.coords,l,o,u,this.nodeSize)}},b.LineBucket=ig,b.LineStripIndexArray=class extends yd{},b.LngLat=br,b.LngLatBounds=sv,b.MercatorCoordinate=yp,b.ONE_EM=24,b.OverscaledTileID=No,b.PerformanceUtils=Jc,b.Pos3dArray=class extends Ju{},b.PosArray=ih,b.Properties=Si,b.QuadTriangleArray=class extends th{},b.RGBAImage=Lo,b.RasterBoundsArray=class extends Hc{},b.RequestPerformance=class{constructor(l){this._marks={start:[l.url,"start"].join("#"),end:[l.url,"end"].join("#"),measure:l.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let l=performance.getEntriesByName(this._marks.measure);return 0===l.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),l=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),l}},b.SegmentVector=R,b.SymbolBucket=tc,b.Transitionable=Xu,b.TriangleIndexArray=w,b.Uniform1f=ke,b.Uniform1i=class extends Se{constructor(l,o){super(l,o),this.current=0}set(l){this.current!==l&&(this.current=l,this.gl.uniform1i(this.location,l))}},b.Uniform2f=class extends Se{constructor(l,o){super(l,o),this.current=[0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]||(this.current=l,this.gl.uniform2f(this.location,l[0],l[1]))}},b.Uniform3f=class extends Se{constructor(l,o){super(l,o),this.current=[0,0,0]}set(l){l[0]===this.current[0]&&l[1]===this.current[1]&&l[2]===this.current[2]||(this.current=l,this.gl.uniform3f(this.location,l[0],l[1],l[2]))}},b.Uniform4f=Be,b.UniformColor=Le,b.UniformMatrix4f=class extends Se{constructor(l,o){super(l,o),this.current=Ne}set(l){if(l[12]!==this.current[12]||l[0]!==this.current[0])return this.current=l,void this.gl.uniformMatrix4fv(this.location,!1,l);for(let o=1;o<16;o++)if(l[o]!==this.current[o]){this.current=l,this.gl.uniformMatrix4fv(this.location,!1,l);break}}},b.UnwrappedTileID=lv,b.ValidationError=Pe,b.ZoomHistory=Bf,b.addDynamicAttributes=Ud,b.arrayBufferToImage=function(l,o){const u=new Image;u.onload=()=>{o(null,u),URL.revokeObjectURL(u.src),u.onload=null,window.requestAnimationFrame(()=>{u.src=Ra})},u.onerror=()=>o(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 f=new Blob([new Uint8Array(l)],{type:"image/png"});u.src=l.byteLength?URL.createObjectURL(f):Ra},b.arrayBufferToImageBitmap=function(l,o){const u=new Blob([new Uint8Array(l)],{type:"image/png"});createImageBitmap(u).then(f=>{o(null,f)}).catch(f=>{o(new Error(`Could not load image because of ${f.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},b.asyncAll=function(l,o,u){if(!l.length)return u(null,[]);let f=l.length;const _=new Array(l.length);let x=null;l.forEach((C,M)=>{o(C,(A,F)=>{A&&(x=A),_[M]=F,0==--f&&u(x,_)})})},b.bezier=us,b.bindAll=Rs,b.clamp=Zt,b.clipLine=_g,b.clone=function(l){var o=new tl(16);return o[0]=l[0],o[1]=l[1],o[2]=l[2],o[3]=l[3],o[4]=l[4],o[5]=l[5],o[6]=l[6],o[7]=l[7],o[8]=l[8],o[9]=l[9],o[10]=l[10],o[11]=l[11],o[12]=l[12],o[13]=l[13],o[14]=l[14],o[15]=l[15],o},b.clone$1=Ci,b.collisionCircleLayout=sg,b.config=Fa,b.copy=function(l,o){return l[0]=o[0],l[1]=o[1],l[2]=o[2],l[3]=o[3],l[4]=o[4],l[5]=o[5],l[6]=o[6],l[7]=o[7],l[8]=o[8],l[9]=o[9],l[10]=o[10],l[11]=o[11],l[12]=o[12],l[13]=o[13],l[14]=o[14],l[15]=o[15],l},b.create=function(){var l=new tl(16);return tl!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},b.createExpression=Ga,b.createFilter=Ot,b.createLayout=Dr,b.createStyleLayer=function(l){return"custom"===l.type?new D1(l):new S1[l.type](l)},b.dot=function(l,o){return l[0]*o[0]+l[1]*o[1]+l[2]*o[2]+l[3]*o[3]},b.earthRadius=$d,b.ease=Il,b.emitValidationErrors=ad,b.equals=function(l,o){var u=l[0],f=l[1],_=l[2],x=l[3],C=l[4],M=l[5],A=l[6],F=l[7],O=l[8],B=l[9],H=l[10],q=l[11],W=l[12],se=l[13],oe=l[14],be=l[15],Ce=o[0],me=o[1],Ee=o[2],$e=o[3],Ve=o[4],gt=o[5],Ct=o[6],at=o[7],tt=o[8],Qe=o[9],ot=o[10],it=o[11],Ge=o[12],Et=o[13],pt=o[14],Yt=o[15];return Math.abs(u-Ce)<=Mr*Math.max(1,Math.abs(u),Math.abs(Ce))&&Math.abs(f-me)<=Mr*Math.max(1,Math.abs(f),Math.abs(me))&&Math.abs(_-Ee)<=Mr*Math.max(1,Math.abs(_),Math.abs(Ee))&&Math.abs(x-$e)<=Mr*Math.max(1,Math.abs(x),Math.abs($e))&&Math.abs(C-Ve)<=Mr*Math.max(1,Math.abs(C),Math.abs(Ve))&&Math.abs(M-gt)<=Mr*Math.max(1,Math.abs(M),Math.abs(gt))&&Math.abs(A-Ct)<=Mr*Math.max(1,Math.abs(A),Math.abs(Ct))&&Math.abs(F-at)<=Mr*Math.max(1,Math.abs(F),Math.abs(at))&&Math.abs(O-tt)<=Mr*Math.max(1,Math.abs(O),Math.abs(tt))&&Math.abs(B-Qe)<=Mr*Math.max(1,Math.abs(B),Math.abs(Qe))&&Math.abs(H-ot)<=Mr*Math.max(1,Math.abs(H),Math.abs(ot))&&Math.abs(q-it)<=Mr*Math.max(1,Math.abs(q),Math.abs(it))&&Math.abs(W-Ge)<=Mr*Math.max(1,Math.abs(W),Math.abs(Ge))&&Math.abs(se-Et)<=Mr*Math.max(1,Math.abs(se),Math.abs(Et))&&Math.abs(oe-pt)<=Mr*Math.max(1,Math.abs(oe),Math.abs(pt))&&Math.abs(be-Yt)<=Mr*Math.max(1,Math.abs(be),Math.abs(Yt))},b.evaluateSizeForFeature=function(l,{uSize:o,uSizeT:u},{lowerSize:f,upperSize:_}){return"source"===l.kind?f/_a:"composite"===l.kind?Kn(f/_a,_/_a,u):o},b.evaluateSizeForZoom=function(l,o){let u=0,f=0;if("constant"===l.kind)f=l.layoutSize;else if("source"!==l.kind){const{interpolationType:_,minZoom:x,maxZoom:C}=l,M=_?Zt(Io.interpolationFactor(_,o,x,C),0,1):0;"camera"===l.kind?f=Kn(l.minSize,l.maxSize,M):u=M}return{uSizeT:u,uSize:f}},b.evaluateVariableOffset=ev,b.evented=jf,b.exported=Pu,b.extend=Bi,b.filterObject=Al,b.fromScaling=function(l,o){return l[0]=o[0],l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=o[1],l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=o[2],l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l},b.getAnchorAlignment=Yi,b.getAnchorJustification=Bd,b.getArrayBuffer=Oa,b.getJSON=function(l,o){return kl(Bi(l,{type:"json"}),o)},b.getOverlapMode=Cg,b.getRTLTextPluginStatus=$l,b.getReferrer=Bn,b.getVideo=function(l,o){const u=window.document.createElement("video");u.muted=!0,u.onloadstart=function(){o(null,u)};for(let f=0;f{}}},b.identity=qf,b.invert=function(l,o){var u=o[0],f=o[1],_=o[2],x=o[3],C=o[4],M=o[5],A=o[6],F=o[7],O=o[8],B=o[9],H=o[10],q=o[11],W=o[12],se=o[13],oe=o[14],be=o[15],Ce=u*M-f*C,me=u*A-_*C,Ee=u*F-x*C,$e=f*A-_*M,Ve=f*F-x*M,gt=_*F-x*A,Ct=O*se-B*W,at=O*oe-H*W,tt=O*be-q*W,Qe=B*oe-H*se,ot=B*be-q*se,it=H*be-q*oe,Ge=Ce*it-me*ot+Ee*Qe+$e*tt-Ve*at+gt*Ct;return Ge?(l[0]=(M*it-A*ot+F*Qe)*(Ge=1/Ge),l[1]=(_*ot-f*it-x*Qe)*Ge,l[2]=(se*gt-oe*Ve+be*$e)*Ge,l[3]=(H*Ve-B*gt-q*$e)*Ge,l[4]=(A*tt-C*it-F*at)*Ge,l[5]=(u*it-_*tt+x*at)*Ge,l[6]=(oe*Ee-W*gt-be*me)*Ge,l[7]=(O*gt-H*Ee+q*me)*Ge,l[8]=(C*ot-M*tt+F*Ct)*Ge,l[9]=(f*tt-u*ot-x*Ct)*Ge,l[10]=(W*Ve-se*Ee+be*Ce)*Ge,l[11]=(B*Ee-O*Ve-q*Ce)*Ge,l[12]=(M*at-C*Qe-A*Ct)*Ge,l[13]=(u*Qe-f*at+_*Ct)*Ge,l[14]=(se*me-W*$e-oe*Ce)*Ge,l[15]=(O*$e-B*me+H*Ce)*Ge,l):null},b.isImageBitmap=oo,b.isSafari=Fs,b.isWorker=To,b.keysDifference=function(l,o){const u=[];for(const f in l)f in o||u.push(f);return u},b.lazyLoadRTLTextPlugin=function(){go.isLoading()||go.isLoaded()||"deferred"!==$l()||jm()},b.makeRequest=kl,b.mapObject=Pa,b.mercatorXfromLng=Dg,b.mercatorYfromLat=rc,b.mercatorZfromAltitude=Sg,b.mul=ga,b.mul$1=function(l,o,u){return l[0]=o[0]*u[0],l[1]=o[1]*u[1],l[2]=o[2]*u[2],l[3]=o[3]*u[3],l},b.multiply=Hm,b.nextPowerOfTwo=function(l){return l<=1?1:Math.pow(2,Math.ceil(Math.log(l)/Math.LN2))},b.number=Kn,b.ortho=function(l,o,u,f,_,x,C){var M=1/(o-u),A=1/(f-_),F=1/(x-C);return l[0]=-2*M,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=-2*A,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=2*F,l[11]=0,l[12]=(o+u)*M,l[13]=(_+f)*A,l[14]=(C+x)*F,l[15]=1,l},b.parseCacheControl=function(l){const o={};if(l.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(u,f,_,x)=>{const C=_||x;return o[f]=!C||C.toLowerCase(),""}),o["max-age"]){const u=parseInt(o["max-age"],10);isNaN(u)?delete o["max-age"]:o["max-age"]=u}return o},b.parseGlyphPbf=function(l){return new ag(l).readFields(T2,[])},b.pbf=ag,b.performSymbolLayout=function(l){l.bucket.createArrays(),l.bucket.tilePixelRatio=yn/(512*l.bucket.overscaling),l.bucket.compareText={},l.bucket.iconsNeedLinear=!1;const o=l.bucket.layers[0].layout,u=l.bucket.layers[0]._unevaluatedLayout._values,f={layoutIconSize:u["icon-size"].possiblyEvaluate(new hr(l.bucket.zoom+1),l.canonical),layoutTextSize:u["text-size"].possiblyEvaluate(new hr(l.bucket.zoom+1),l.canonical),textMaxSize:u["text-size"].possiblyEvaluate(new hr(18))};if("composite"===l.bucket.textSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.textSizeData;f.compositeTextSizes=[u["text-size"].possiblyEvaluate(new hr(A),l.canonical),u["text-size"].possiblyEvaluate(new hr(F),l.canonical)]}if("composite"===l.bucket.iconSizeData.kind){const{minZoom:A,maxZoom:F}=l.bucket.iconSizeData;f.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new hr(A),l.canonical),u["icon-size"].possiblyEvaluate(new hr(F),l.canonical)]}const _=24*o.get("text-line-height"),x="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement"),C=o.get("text-keep-upright"),M=o.get("text-size");for(const A of l.bucket.features){const F=o.get("text-font").evaluate(A,{},l.canonical).join(","),O=M.evaluate(A,{},l.canonical),B=f.layoutTextSize.evaluate(A,{},l.canonical),H=f.layoutIconSize.evaluate(A,{},l.canonical),q={horizontal:{},vertical:void 0},W=A.text;let se,oe=[0,0];if(W){const me=W.toString(),Ee=24*o.get("text-letter-spacing").evaluate(A,{},l.canonical),$e=ld(me)?Ee:0,Ve=o.get("text-anchor").evaluate(A,{},l.canonical),gt=o.get("text-variable-anchor");if(!gt){const ot=o.get("text-radial-offset").evaluate(A,{},l.canonical);oe=ot?ev(Ve,[24*ot,vg]):o.get("text-offset").evaluate(A,{},l.canonical).map(it=>24*it)}let Ct=x?"center":o.get("text-justify").evaluate(A,{},l.canonical);const at=o.get("symbol-placement"),tt="point"===at?24*o.get("text-max-width").evaluate(A,{},l.canonical):0,Qe=()=>{l.bucket.allowVerticalPlacement&&po(me)&&(q.vertical=hg(W,l.glyphMap,l.glyphPositions,l.imagePositions,F,tt,_,Ve,"left",$e,oe,b.WritingMode.vertical,!0,at,B,O))};if(!x&>){const ot="auto"===Ct?gt.map(Ge=>Bd(Ge)):[Ct];let it=!1;for(let Ge=0;Gethis._layers[je.id]),ge=ce[0];if("none"===ge.visibility)continue;const he=ge.source||"";let ue=this.familiesBySource[he];ue||(ue=this.familiesBySource[he]={});const xe=ge.sourceLayer||"_geojsonTileLayer";let Me=ue[xe];Me||(Me=ue[xe]=[]),Me.push(ce)}}}class Il{constructor(V){const $={},K=[];for(const he in V){const ue=V[he],xe=$[he]={};for(const Me in ue){const je=ue[+Me];if(!je||0===je.bitmap.width||0===je.bitmap.height)continue;const Te={x:0,y:0,w:je.bitmap.width+2,h:je.bitmap.height+2};K.push(Te),xe[Me]={rect:Te,metrics:je.metrics}}}const{w:te,h:ce}=b.potpack(K),ge=new b.AlphaImage({width:te||1,height:ce||1});for(const he in V){const ue=V[he];for(const xe in ue){const Me=ue[+xe];if(!Me||0===Me.bitmap.width||0===Me.bitmap.height)continue;const je=$[he][xe].rect;b.AlphaImage.copy(Me.bitmap,ge,{x:0,y:0},{x:je.x+1,y:je.y+1},Me.bitmap)}}this.image=ge,this.positions=$}}b.register("GlyphAtlas",Il);class Zt{constructor(V){this.tileID=new b.OverscaledTileID(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId}parse(V,$,K,te,ce){this.status="parsing",this.data=V,this.collisionBoxArray=new b.CollisionBoxArray;const ge=new b.DictionaryCoder(Object.keys(V.layers).sort()),he=new b.FeatureIndex(this.tileID,this.promoteId);he.bucketLayerIDs=[];const ue={},xe={featureIndex:he,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:K},Me=$.familiesBySource[this.source];for(const sn in Me){const an=V.layers[sn];if(!an)continue;1===an.version&&b.warnOnce(`Vector tile source "${this.source}" layer "${sn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Zn=ge.encode(sn),lr=[];for(let ai=0;ai=Pr.maxzoom||"none"!==Pr.visibility&&(Ie(ai,this.zoom,K),(ue[Pr.id]=Pr.createBucket({index:he.bucketLayerIDs.length,layers:ai,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Zn,sourceID:this.source})).populate(lr,xe,this.tileID.canonical),he.bucketLayerIDs.push(ai.map(Va=>Va.id)))}}let je,Te,Dt,ht;const dt=b.mapObject(xe.glyphDependencies,sn=>Object.keys(sn).map(Number));Object.keys(dt).length?te.send("getGlyphs",{uid:this.uid,stacks:dt,source:this.source,tileID:this.tileID,type:"glyphs"},(sn,an)=>{je||(je=sn,Te=an,qn.call(this))}):Te={};const xt=Object.keys(xe.iconDependencies);xt.length?te.send("getImages",{icons:xt,source:this.source,tileID:this.tileID,type:"icons"},(sn,an)=>{je||(je=sn,Dt=an,qn.call(this))}):Dt={};const ln=Object.keys(xe.patternDependencies);function qn(){if(je)return ce(je);if(Te&&Dt&&ht){const sn=new Il(Te),an=new b.ImageAtlas(Dt,ht);for(const Zn in ue){const lr=ue[Zn];lr instanceof b.SymbolBucket?(Ie(lr.layers,this.zoom,K),b.performSymbolLayout({bucket:lr,glyphMap:Te,glyphPositions:sn.positions,imageMap:Dt,imagePositions:an.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):lr.hasPattern&&(lr instanceof b.LineBucket||lr instanceof b.FillBucket||lr instanceof b.FillExtrusionBucket)&&(Ie(lr.layers,this.zoom,K),lr.addFeatures(xe,this.tileID.canonical,an.patternPositions))}this.status="done",ce(null,{buckets:Object.values(ue).filter(Zn=>!Zn.isEmpty()),featureIndex:he,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:sn.image,imageAtlas:an,glyphMap:this.returnDependencies?Te:null,iconMap:this.returnDependencies?Dt:null,glyphPositions:this.returnDependencies?sn.positions:null})}}ln.length?te.send("getImages",{icons:ln,source:this.source,tileID:this.tileID,type:"patterns"},(sn,an)=>{je||(je=sn,ht=an,qn.call(this))}):ht={},qn.call(this)}}function Ie(J,V,$){const K=new b.EvaluationParameters(V);for(const te of J)te.recalculate(K,$)}function Bi(J,V){const $=b.getArrayBuffer(J.request,(K,te,ce,ge)=>{K?V(K):te&&V(null,{vectorTile:new b.vectorTile.VectorTile(new b.pbf(te)),rawData:te,cacheControl:ce,expires:ge})});return()=>{$.cancel(),V()}}class Ps{constructor(V,$,K,te){this.actor=V,this.layerIndex=$,this.availableImages=K,this.loadVectorData=te||Bi,this.loading={},this.loaded={}}loadTile(V,$){const K=V.uid;this.loading||(this.loading={});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request),ce=this.loading[K]=new Zt(V);ce.abort=this.loadVectorData(V,(ge,he)=>{if(delete this.loading[K],ge||!he)return ce.status="done",this.loaded[K]=ce,$(ge);const ue=he.rawData,xe={};he.expires&&(xe.expires=he.expires),he.cacheControl&&(xe.cacheControl=he.cacheControl);const Me={};if(te){const je=te.finish();je&&(Me.resourceTiming=JSON.parse(JSON.stringify(je)))}ce.vectorTile=he.vectorTile,ce.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor,(je,Te)=>{if(je||!Te)return $(je);$(null,b.extend({rawTileData:ue.slice(0)},Te,xe,Me))}),this.loaded=this.loaded||{},this.loaded[K]=ce})}reloadTile(V,$){const K=this.loaded,te=V.uid,ce=this;if(K&&K[te]){const ge=K[te];ge.showCollisionBoxes=V.showCollisionBoxes;const he=(ue,xe)=>{const Me=ge.reloadCallback;Me&&(delete ge.reloadCallback,ge.parse(ge.vectorTile,ce.layerIndex,this.availableImages,ce.actor,Me)),$(ue,xe)};"parsing"===ge.status?ge.reloadCallback=he:"done"===ge.status&&(ge.vectorTile?ge.parse(ge.vectorTile,this.layerIndex,this.availableImages,this.actor,he):he())}}abortTile(V,$){const K=this.loading,te=V.uid;K&&K[te]&&K[te].abort&&(K[te].abort(),delete K[te]),$()}removeTile(V,$){const K=this.loaded,te=V.uid;K&&K[te]&&delete K[te],$()}}class Rs{constructor(){this.loaded={}}loadTile(V,$){const{uid:K,encoding:te,rawImageData:ce}=V,ge=b.isImageBitmap(ce)?this.getImageData(ce):ce,he=new b.DEMData(K,ge,te);this.loaded=this.loaded||{},this.loaded[K]=he,$(null,he)}getImageData(V){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(V.width,V.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=V.width,this.offscreenCanvas.height=V.height,this.offscreenCanvasContext.drawImage(V,0,0,V.width,V.height);const $=this.offscreenCanvasContext.getImageData(-1,-1,V.width+2,V.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new b.RGBAImage({width:$.width,height:$.height},$.data)}removeTile(V){const $=this.loaded,K=V.uid;$&&$[K]&&delete $[K]}}var Pa=function J(V,$){var K,te=V&&V.type;if("FeatureCollection"===te)for(K=0;K=Math.abs(he)?$-ue+he:he-ue+$,$=ue}$+K>=0!=!!V&&J.reverse()}const io=b.vectorTile.VectorTileFeature.prototype.toGeoJSON;var fn={},si={get exports(){return fn},set exports(J){fn=J}},kc=b.pointGeometry,To=b.vectorTile.VectorTileFeature,ta=Fs;function Fs(J,V){this.options=V||{},this.features=J,this.length=J.length}function oo(J,V){this.id="number"==typeof J.id?J.id:void 0,this.type=J.type,this.rawGeometry=1===J.type?[J.geometry]:J.geometry,this.properties=J.tags,this.extent=V||4096}Fs.prototype.feature=function(J){return new oo(this.features[J],this.options.extent)},oo.prototype.loadGeometry=function(){var J=this.rawGeometry;this.geometry=[];for(var V=0;V>31}function Bn(J,V){for(var $=J.loadGeometry(),K=J.type,te=0,ce=0,ge=$.length,he=0;heJ},Oa=Math.fround||(Rc=new Float32Array(1),J=>(Rc[0]=+J,Rc[0]));var Rc;class pi{constructor(V){this.options=Vi(Object.create(kl),V),this.trees=new Array(this.options.maxZoom+1)}load(V){const{log:$,minZoom:K,maxZoom:te,nodeSize:ce}=this.options;$&&console.time("total time");const ge=`prepare ${V.length} points`;$&&console.time(ge),this.points=V;let he=[];for(let ue=0;ue=K;ue--){const xe=+Date.now();he=this._cluster(he,ue),this.trees[ue]=new b.KDBush(he,Vn,ds,ce,Float32Array),$&&console.log("z%d: %d clusters in %dms",ue,he.length,+Date.now()-xe)}return $&&console.timeEnd("total time"),this}getClusters(V,$){let K=((V[0]+180)%360+360)%360-180;const te=Math.max(-90,Math.min(90,V[1]));let ce=180===V[2]?180:((V[2]+180)%360+360)%360-180;const ge=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)K=-180,ce=180;else if(K>ce){const Me=this.getClusters([K,te,180,ge],$),je=this.getClusters([-180,te,ce,ge],$);return Me.concat(je)}const he=this.trees[this._limitZoom($)],ue=he.range(Ae(K),Pe(ge),Ae(ce),Pe(te)),xe=[];for(const Me of ue){const je=he.points[Me];xe.push(je.numPoints?yr(je):this.points[je.index])}return xe}getChildren(V){const $=this._getOriginId(V),K=this._getOriginZoom(V),te="No cluster with the specified id.",ce=this.trees[K];if(!ce)throw new Error(te);const ge=ce.points[$];if(!ge)throw new Error(te);const he=this.options.radius/(this.options.extent*Math.pow(2,K-1)),ue=ce.within(ge.x,ge.y,he),xe=[];for(const Me of ue){const je=ce.points[Me];je.parentId===V&&xe.push(je.numPoints?yr(je):this.points[je.index])}if(0===xe.length)throw new Error(te);return xe}getLeaves(V,$,K){const te=[];return this._appendLeaves(te,V,$=$||10,K=K||0,0),te}getTile(V,$,K){const te=this.trees[this._limitZoom(V)],ce=Math.pow(2,V),{extent:ge,radius:he}=this.options,ue=he/ge,xe=(K-ue)/ce,Me=(K+1+ue)/ce,je={features:[]};return this._addTileFeatures(te.range(($-ue)/ce,xe,($+1+ue)/ce,Me),te.points,$,K,ce,je),0===$&&this._addTileFeatures(te.range(1-ue/ce,xe,1,Me),te.points,ce,K,ce,je),$===ce-1&&this._addTileFeatures(te.range(0,xe,ue/ce,Me),te.points,-1,K,ce,je),je.features.length?je:null}getClusterExpansionZoom(V){let $=this._getOriginZoom(V)-1;for(;$<=this.options.maxZoom;){const K=this.getChildren(V);if($++,1!==K.length)break;V=K[0].properties.cluster_id}return $}_appendLeaves(V,$,K,te,ce){const ge=this.getChildren($);for(const he of ge){const ue=he.properties;if(ue&&ue.cluster?ce+ue.point_count<=te?ce+=ue.point_count:ce=this._appendLeaves(V,ue.cluster_id,K,te,ce):ce$&&(ht+=xt.numPoints||1)}if(ht>Dt&&ht>=he){let dt=Me.x*Dt,xt=Me.y*Dt,ln=ge&&Dt>1?this._map(Me,!0):null;const qn=(xe<<5)+($+1)+this.points.length;for(const sn of Te){const an=je.points[sn];if(an.zoom<=$)continue;an.zoom=$;const Zn=an.numPoints||1;dt+=an.x*Zn,xt+=an.y*Zn,an.parentId=qn,ge&&(ln||(ln=this._map(Me,!0)),ge(ln,this._map(an)))}Me.parentId=qn,K.push(La(dt/ht,xt/ht,qn,ht,ln))}else if(K.push(Me),ht>1)for(const dt of Te){const xt=je.points[dt];xt.zoom<=$||(xt.zoom=$,K.push(xt))}}return K}_getOriginId(V){return V-this.points.length>>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,$){if(V.numPoints)return $?Vi({},V.properties):V.properties;const K=this.points[V.index].properties,te=this.options.map(K);return $&&te===K?Vi({},te):te}}function La(J,V,$,K,te){return{x:Oa(J),y:Oa(V),zoom:1/0,id:$,parentId:-1,numPoints:K,properties:te}}function na(J,V){const[$,K]=J.geometry.coordinates;return{x:Oa(Ae($)),y:Oa(Pe(K)),zoom:1/0,index:V,parentId:-1}}function yr(J){return{type:"Feature",id:J.id,properties:tr(J),geometry:{type:"Point",coordinates:[(V=J.x,360*(V-.5)),Na(J.y)]}};var V}function tr(J){const V=J.numPoints,$=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V;return Vi(Vi({},J.properties),{cluster:!0,cluster_id:J.id,point_count:V,point_count_abbreviated:$})}function Ae(J){return J/360+.5}function Pe(J){const V=Math.sin(J*Math.PI/180),$=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return $<0?0:$>1?1:$}function Na(J){const V=(180-360*J)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function Vi(J,V){for(const $ in V)J[$]=V[$];return J}function Vn(J){return J.x}function ds(J){return J.y}function Ui(J,V,$,K){for(var te,ce=K,ge=$-V>>1,he=$-V,ue=J[V],xe=J[V+1],Me=J[$],je=J[$+1],Te=V+3;Te<$;Te+=3){var Dt=Pl(J[Te],J[Te+1],ue,xe,Me,je);if(Dt>ce)te=Te,ce=Dt;else if(Dt===ce){var ht=Math.abs(Te-ge);htK&&(te-V>3&&Ui(J,V,te,K),J[te+2]=ce,$-te>3&&Ui(J,te,$,K))}function Pl(J,V,$,K,te,ce){var ge=te-$,he=ce-K;if(0!==ge||0!==he){var ue=((J-$)*ge+(V-K)*he)/(ge*ge+he*he);ue>1?($=te,K=ce):ue>0&&($+=ge*ue,K+=he*ue)}return(ge=J-$)*ge+(he=V-K)*he}function fs(J,V,$,K){var te={id:void 0===J?null:J,type:V,geometry:$,tags:K,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ce){var ge=ce.geometry,he=ce.type;if("Point"===he||"MultiPoint"===he||"LineString"===he)rt(ce,ge);else if("Polygon"===he||"MultiLineString"===he)for(var ue=0;ue0&&(ge+=K?(te*xe-ue*ce)/2:Math.sqrt(Math.pow(ue-te,2)+Math.pow(xe-ce,2))),te=ue,ce=xe}var Me=V.length-3;V[2]=1,Ui(V,0,Me,$),V[Me+2]=1,V.size=Math.abs(ge),V.start=0,V.end=V.size}function ps(J,V,$,K){for(var te=0;te1?1:$}function Ei(J,V,$,K,te,ce,ge,he){if(K/=V,ce>=($/=V)&&ge=K)return null;for(var ue=[],xe=0;xe=$&&ht=K)){var dt=[];if("Point"===Te||"MultiPoint"===Te)ra(je,dt,$,K,te);else if("LineString"===Te)ao(je,dt,$,K,te,!1,he.lineMetrics);else if("MultiLineString"===Te)Nn(je,dt,$,K,te,!1);else if("Polygon"===Te)Nn(je,dt,$,K,te,!0);else if("MultiPolygon"===Te)for(var xt=0;xt=$&&ge<=K&&(V.push(J[ce]),V.push(J[ce+1]),V.push(J[ce+2]))}}function ao(J,V,$,K,te,ce,ge){for(var he,ue,xe=$i(J),Me=0===te?lo:Rl,je=J.start,Te=0;Te$&&(ue=Me(xe,Dt,ht,xt,ln,$),ge&&(xe.start=je+he*ue)):qn>K?sn=$&&(ue=Me(xe,Dt,ht,xt,ln,$),an=!0),sn>K&&qn<=K&&(ue=Me(xe,Dt,ht,xt,ln,K),an=!0),!ce&&an&&(ge&&(xe.end=je+he*ue),V.push(xe),xe=$i(J)),ge&&(je+=he)}var Zn=J.length-3;Dt=J[Zn],ht=J[Zn+1],dt=J[Zn+2],(qn=0===te?Dt:ht)>=$&&qn<=K&&Fc(xe,Dt,ht,dt),Zn=xe.length-3,ce&&Zn>=3&&(xe[Zn]!==xe[0]||xe[Zn+1]!==xe[1])&&Fc(xe,xe[0],xe[1],xe[2]),xe.length&&V.push(xe)}function $i(J){var V=[];return V.size=J.size,V.start=J.start,V.end=J.end,V}function Nn(J,V,$,K,te,ce){for(var ge=0;gege.maxX&&(ge.maxX=Me),je>ge.maxY&&(ge.maxY=je)}return ge}function oa(J,V,$,K){var te=V.geometry,ce=V.type,ge=[];if("Point"===ce||"MultiPoint"===ce)for(var he=0;he0&&V.size<(te?ge:K))$.numPoints+=V.length/3;else{for(var he=[],ue=0;uege)&&($.numSimplified++,he.push(V[ue]),he.push(V[ue+1])),$.numPoints++;te&&function(xe,Me){for(var je=0,Te=0,Dt=xe.length,ht=Dt-2;Te0===Me)for(Te=0,Dt=xe.length;Te
24)throw new Error("maxZoom should be in the 0-24 range");if(V.promoteId&&V.generateId)throw new Error("promoteId and generateId cannot be used together.");var te,ce,ge,he,ue,xe,K=function(te,ce){var ge=[];if("FeatureCollection"===te.type)for(var he=0;he1&&console.time("creation"),Te=this.tiles[je]=Ru(J,V,$,K,ue),this.tileCoords.push({z:V,x:$,y:K}),xe)){xe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",V,$,K,Te.numFeatures,Te.numPoints,Te.numSimplified),console.timeEnd("creation"));var Dt="z"+V;this.stats[Dt]=(this.stats[Dt]||0)+1,this.total++}if(Te.source=J,te){if(V===ue.maxZoom||V===te)continue;var ht=1<1&&console.time("clipping");var dt,xt,ln,qn,sn,an,Zn=.5*ue.buffer/ue.extent,lr=.5-Zn,ai=.5+Zn,Pr=1+Zn;dt=xt=ln=qn=null,sn=Ei(J,Me,$-Zn,$+ai,0,Te.minX,Te.maxX,ue),an=Ei(J,Me,$+lr,$+Pr,0,Te.minX,Te.maxX,ue),J=null,sn&&(dt=Ei(sn,Me,K-Zn,K+ai,1,Te.minY,Te.maxY,ue),xt=Ei(sn,Me,K+lr,K+Pr,1,Te.minY,Te.maxY,ue),sn=null),an&&(ln=Ei(an,Me,K-Zn,K+ai,1,Te.minY,Te.maxY,ue),qn=Ei(an,Me,K+lr,K+Pr,1,Te.minY,Te.maxY,ue),an=null),xe>1&&console.timeEnd("clipping"),he.push(dt||[],V+1,2*$,2*K),he.push(xt||[],V+1,2*$,2*K+1),he.push(ln||[],V+1,2*$+1,2*K),he.push(qn||[],V+1,2*$+1,2*K+1)}}},Sn.prototype.getTile=function(J,V,$){var K=this.options,te=K.extent,ce=K.debug;if(J<0||J>24)return null;var ge=1<1&&console.log("drilling down to z%d-%d-%d",J,V,$);for(var ue,xe=J,Me=V,je=$;!ue&&xe>0;)xe--,Me=Math.floor(Me/2),je=Math.floor(je/2),ue=this.tiles[Fl(xe,Me,je)];return ue&&ue.source?(ce>1&&console.log("found parent tile z%d-%d-%d",xe,Me,je),ce>1&&console.time("drilling down"),this.splitTile(ue.source,xe,Me,je,J,V,$),ce>1&&console.timeEnd("drilling down"),this.tiles[he]?Oc(this.tiles[he],te):null):null};class gi extends Ps{constructor(V,$,K,te){super(V,$,K,mi),this._dataUpdateable=new Map,this.loadGeoJSON=(ce,ge)=>{const{promoteId:he}=ce;if(ce.request)return b.getJSON(ce.request,(ue,xe,Me,je)=>{this._dataUpdateable=Xr(xe,he)?$r(xe,he):void 0,ge(ue,xe,Me,je)});if("string"==typeof ce.data)try{const ue=JSON.parse(ce.data);this._dataUpdateable=Xr(ue,he)?$r(ue,he):void 0,ge(null,ue)}catch{ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`))}else ce.dataDiff?this._dataUpdateable?(function(ue,xe,Me){var je,Te,Dt,ht;if(xe.removeAll&&ue.clear(),xe.remove)for(const dt of xe.remove)ue.delete(dt);if(xe.add)for(const dt of xe.add){const xt=co(dt,Me);null!=xt&&ue.set(xt,dt)}if(xe.update)for(const dt of xe.update){let xt=ue.get(dt.id);if(null==xt)continue;const ln=!dt.removeAllProperties&&((null===(je=dt.removeProperties)||void 0===je?void 0:je.length)>0||(null===(Te=dt.addOrUpdateProperties)||void 0===Te?void 0:Te.length)>0);if((dt.newGeometry||dt.removeAllProperties||ln)&&(xt={...xt},ue.set(dt.id,xt),ln&&(xt.properties={...xt.properties})),dt.newGeometry&&(xt.geometry=dt.newGeometry),dt.removeAllProperties)xt.properties={};else if((null===(Dt=dt.removeProperties)||void 0===Dt?void 0:Dt.length)>0)for(const qn of dt.removeProperties)Object.prototype.hasOwnProperty.call(xt.properties,qn)&&delete xt.properties[qn];if((null===(ht=dt.addOrUpdateProperties)||void 0===ht?void 0:ht.length)>0)for(const{key:qn,value:sn}of dt.addOrUpdateProperties)xt.properties[qn]=sn}}(this._dataUpdateable,ce.dataDiff,he),ge(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ge(new Error(`Cannot update existing geojson data in ${ce.source}`)):ge(new Error(`Input data given to '${ce.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},te&&(this.loadGeoJSON=te)}loadData(V,$){var K;null===(K=this._pendingRequest)||void 0===K||K.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const te=!!(V&&V.request&&V.request.collectResourceTiming)&&new b.RequestPerformance(V.request);this._pendingCallback=$,this._pendingRequest=this.loadGeoJSON(V,(ce,ge)=>{if(delete this._pendingCallback,delete this._pendingRequest,ce||!ge)return $(ce);if("object"!=typeof ge)return $(new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`));{Pa(ge,!0);try{if(V.filter){const ue=b.createExpression(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===ue.result)throw new Error(ue.value.map(Me=>`${Me.key}: ${Me.message}`).join(", "));const xe=ge.features.filter(Me=>ue.value.evaluate({zoom:0},Me));ge={type:"FeatureCollection",features:xe}}this._geoJSONIndex=V.cluster?new pi(function({superclusterOptions:ue,clusterProperties:xe}){if(!xe||!ue)return ue;const Me={},je={},Te={accumulated:null,zoom:0},Dt={properties:null},ht=Object.keys(xe);for(const dt of ht){const[xt,ln]=xe[dt],qn=b.createExpression(ln),sn=b.createExpression("string"==typeof xt?[xt,["accumulated"],["get",dt]]:xt);Me[dt]=qn.value,je[dt]=sn.value}return ue.map=dt=>{Dt.properties=dt;const xt={};for(const ln of ht)xt[ln]=Me[ln].evaluate(Te,Dt);return xt},ue.reduce=(dt,xt)=>{Dt.properties=xt;for(const ln of ht)Te.accumulated=dt[ln],dt[ln]=je[ln].evaluate(Te,Dt)},ue}(V)).load(ge.features):new Sn(ue=ge,V.geojsonVtOptions)}catch(ue){return $(ue)}this.loaded={};const he={};if(te){const ue=te.finish();ue&&(he.resourceTiming={},he.resourceTiming[V.source]=JSON.parse(JSON.stringify(ue)))}$(null,he)}var ue})}reloadTile(V,$){const K=this.loaded;return K&&K[V.uid]?super.reloadTile(V,$):this.loadTile(V,$)}removeSource(V,$){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),$()}getClusterExpansionZoom(V,$){try{$(null,this._geoJSONIndex.getClusterExpansionZoom(V.clusterId))}catch(K){$(K)}}getClusterChildren(V,$){try{$(null,this._geoJSONIndex.getChildren(V.clusterId))}catch(K){$(K)}}getClusterLeaves(V,$){try{$(null,this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset))}catch(K){$(K)}}}class Ns{constructor(V){this.self=V,this.actor=new b.Actor(V,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Ps,geojson:gi},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=($,K)=>{if(this.workerSourceTypes[$])throw new Error(`Worker source with name "${$}" already registered.`);this.workerSourceTypes[$]=K},this.self.registerRTLTextPlugin=$=>{if(b.plugin.isParsed())throw new Error("RTL text plugin already registered.");b.plugin.applyArabicShaping=$.applyArabicShaping,b.plugin.processBidirectionalText=$.processBidirectionalText,b.plugin.processStyledBidirectionalText=$.processStyledBidirectionalText}}setReferrer(V,$){this.referrer=$}setImages(V,$,K){this.availableImages[V]=$;for(const te in this.workerSources[V]){const ce=this.workerSources[V][te];for(const ge in ce)ce[ge].availableImages=$}K()}setLayers(V,$,K){this.getLayerIndex(V).replace($),K()}updateLayers(V,$,K){this.getLayerIndex(V).update($.layers,$.removedIds),K()}loadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).loadTile($,K)}loadDEMTile(V,$,K){this.getDEMWorkerSource(V,$.source).loadTile($,K)}reloadTile(V,$,K){this.getWorkerSource(V,$.type,$.source).reloadTile($,K)}abortTile(V,$,K){this.getWorkerSource(V,$.type,$.source).abortTile($,K)}removeTile(V,$,K){this.getWorkerSource(V,$.type,$.source).removeTile($,K)}removeDEMTile(V,$){this.getDEMWorkerSource(V,$.source).removeTile($)}removeSource(V,$,K){if(!this.workerSources[V]||!this.workerSources[V][$.type]||!this.workerSources[V][$.type][$.source])return;const te=this.workerSources[V][$.type][$.source];delete this.workerSources[V][$.type][$.source],void 0!==te.removeSource?te.removeSource($,K):K()}loadWorkerSource(V,$,K){try{this.self.importScripts($.url),K()}catch(te){K(te.toString())}}syncRTLPluginState(V,$,K){try{b.plugin.setState($);const te=b.plugin.getPluginURL();if(b.plugin.isLoaded()&&!b.plugin.isParsed()&&null!=te){this.self.importScripts(te);const ce=b.plugin.isParsed();K(ce?void 0:new Error(`RTL Text Plugin failed to import scripts from ${te}`),ce)}}catch(te){K(te.toString())}}getAvailableImages(V){let $=this.availableImages[V];return $||($=[]),$}getLayerIndex(V){let $=this.layerIndexes[V];return $||($=this.layerIndexes[V]=new us),$}getWorkerSource(V,$,K){return this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][$]||(this.workerSources[V][$]={}),this.workerSources[V][$][K]||(this.workerSources[V][$][K]=new this.workerSourceTypes[$]({send:(ce,ge,he)=>{this.actor.send(ce,ge,he,V)}},this.getLayerIndex(V),this.getAvailableImages(V))),this.workerSources[V][$][K]}getDEMWorkerSource(V,$){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][$]||(this.demWorkerSources[V][$]=new Rs),this.demWorkerSources[V][$]}}return b.isWorker()&&(self.worker=new Ns(self)),Ns}),qh(0,function(b){var wr=ks;function ks(g){return s=g,!(typeof window>"u"||typeof document>"u"||!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)||!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions)||!("JSON"in window&&"parse"in JSON&&"stringify"in JSON)||!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var m,y,w=new Blob([""],{type:"text/javascript"}),S=URL.createObjectURL(w);try{y=new Worker(S),m=!0}catch{m=!1}return y&&y.terminate(),URL.revokeObjectURL(S),m}()||!("Uint8ClampedArray"in window)||!ArrayBuffer.isView||!function(){var m=document.createElement("canvas");m.width=m.height=1;var y=m.getContext("2d");if(!y)return!1;var w=y.getImageData(0,0,1,1);return w&&w.width===m.width}()||(void 0===us[h=s&&s.failIfMajorPerformanceCaveat]&&(us[h]=function(m){var y,S,I,k,w=(S=m,I=document.createElement("canvas"),(k=Object.create(ks.webGLContextAttributes)).failIfMajorPerformanceCaveat=S,I.getContext("webgl",k)||I.getContext("experimental-webgl",k));if(!w)return!1;try{y=w.createShader(w.VERTEX_SHADER)}catch{return!1}return!(!y||w.isContextLost())&&(w.shaderSource(y,"void main() {}"),w.compileShader(y),!0===w.getShaderParameter(y,w.COMPILE_STATUS))}(h)),!us[h]||document.documentMode));var s,h}var us={};ks.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Zt(g,s){if(Array.isArray(g)){if(!Array.isArray(s)||g.length!==s.length)return!1;for(let h=0;h{window.removeEventListener("click",Ie.suppressClickInternal,!0)},0)}static mousePos(s,h){const m=s.getBoundingClientRect();return new b.pointGeometry(h.clientX-m.left-s.clientLeft,h.clientY-m.top-s.clientTop)}static touchPos(s,h){const m=s.getBoundingClientRect(),y=[];for(let w=0;w{s=[],h=0,m=0,y={}},g.addThrottleControl=I=>{const k=m++;return y[k]=I,k},g.removeThrottleControl=I=>{delete y[I]};const w=()=>{const I=Object.keys(y);let k=!1;if(I.length>0)for(const R of I)if(k=y[R](),k)break;return k};g.getImage=(I,k)=>{Bi.supported&&(I.headers||(I.headers={}),I.headers.accept="image/webp,*/*");const R={requestParameters:I,callback:k,cancelled:!1,completed:!1,cancel:()=>{}};return s.push(R),w()||g.processQueue(),R};const S=I=>{const{requestParameters:k,callback:R}=I;return b.getArrayBuffer(k,(z,L,j,Q)=>{var ee,Y;z?R(z):L&&(ee=L,Y=(ee,Y)=>{null!=ee?R(ee):null!=Y&&R(null,Y,{cacheControl:j,expires:Q})},"function"==typeof createImageBitmap?b.arrayBufferToImageBitmap(ee,Y):b.arrayBufferToImage(ee,Y)),I.cancelled||(I.completed=!0,h--,w()||g.processQueue())})};g.processQueue=(I=0)=>{I<=0&&(I=w()?b.config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:b.config.MAX_PARALLEL_IMAGE_REQUESTS);for(let k=h;k0;k++){const R=s.shift();if(R.cancelled)continue;const z=S(R);h++,R.innerRequest=z,R.cancel=()=>{var L;(L=R).completed||L.cancelled||(h--,L.cancelled=!0,L.innerRequest.cancel(),g.processQueue())}}return s.length}}(io||(io={})),io.resetRequestQueue();var fn,g,si=io;(g=fn||(fn={})).Glyphs="Glyphs",g.Image="Image",g.Source="Source",g.SpriteImage="SpriteImage",g.SpriteJSON="SpriteJSON",g.Style="Style",g.Tile="Tile",g.Unknown="Unknown";class kc{constructor(s){this._transformRequestFn=s}transformRequest(s,h){return this._transformRequestFn&&this._transformRequestFn(s,h)||{url:s}}normalizeSpriteURL(s,h,m){const y=function(w){const S=w.match(To);if(!S)throw new Error(`Unable to parse URL "${w}"`);return{protocol:S[1],authority:S[2],path:S[3]||"/",params:S[4]?S[4].split("&"):[]}}(s);return y.path+=`${h}${m}`,function(w){const S=w.params.length?`?${w.params.join("&")}`:"";return`${w.protocol}://${w.authority}${w.path}${S}`}(y)}setTransformRequest(s){this._transformRequestFn=s}}const To=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ta(g){var s=new b.ARRAY_TYPE(3);return s[0]=g[0],s[1]=g[1],s[2]=g[2],s}var Fs,oo=function(g,s,h){return g[0]=s[0]-h[0],g[1]=s[1]-h[1],g[2]=s[2]-h[2],g};Fs=new b.ARRAY_TYPE(3),b.ARRAY_TYPE!=Float32Array&&(Fs[0]=0,Fs[1]=0,Fs[2]=0);var Ra=function(g){var s=g[0],h=g[1];return s*s+h*h};function hs(g){return"string"==typeof g?[{id:"default",url:g}]:g??[]}!function(){var g=new b.ARRAY_TYPE(2);b.ARRAY_TYPE!=Float32Array&&(g[0]=0,g[1]=0)}();class Gn{constructor(s,h,m,y){this.context=s,this.format=m,this.texture=s.gl.createTexture(),this.update(h,y)}update(s,h,m){const{width:y,height:w}=s,S=!(this.size&&this.size[0]===y&&this.size[1]===w||m),{context:I}=this,{gl:k}=I;if(this.useMipmap=Boolean(h&&h.useMipmap),k.bindTexture(k.TEXTURE_2D,this.texture),I.pixelStoreUnpackFlipY.set(!1),I.pixelStoreUnpack.set(1),I.pixelStoreUnpackPremultiplyAlpha.set(this.format===k.RGBA&&(!h||!1!==h.premultiply)),S)this.size=[y,w],s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||b.isImageBitmap(s)?k.texImage2D(k.TEXTURE_2D,0,this.format,this.format,k.UNSIGNED_BYTE,s):k.texImage2D(k.TEXTURE_2D,0,this.format,y,w,0,this.format,k.UNSIGNED_BYTE,s.data);else{const{x:R,y:z}=m||{x:0,y:0};s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement||s instanceof ImageData||b.isImageBitmap(s)?k.texSubImage2D(k.TEXTURE_2D,0,R,z,k.RGBA,k.UNSIGNED_BYTE,s):k.texSubImage2D(k.TEXTURE_2D,0,R,z,y,w,k.RGBA,k.UNSIGNED_BYTE,s.data)}this.useMipmap&&this.isSizePowerOfTwo()&&k.generateMipmap(k.TEXTURE_2D)}bind(s,h,m){const{context:y}=this,{gl:w}=y;w.bindTexture(w.TEXTURE_2D,this.texture),m!==w.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(m=w.LINEAR),s!==this.filter&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,s),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,m||s),this.filter=s),h!==this.wrap&&(w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,h),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:s}=this.context;s.deleteTexture(this.texture),this.texture=null}}function Pu(g){const{userImage:s}=g;return!!(s&&s.render&&s.render())&&(g.data.replace(new Uint8Array(s.data.buffer)),!0)}class It extends b.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new b.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(s){if(this.loaded!==s&&(this.loaded=s,s)){for(const{ids:h,callback:m}of this.requestors)this._notify(h,m);this.requestors=[]}}getImage(s){const h=this.images[s];if(h&&!h.data&&h.spriteData){const m=h.spriteData;h.data=new b.RGBAImage({width:m.width,height:m.height},m.context.getImageData(m.x,m.y,m.width,m.height).data),h.spriteData=null}return h}addImage(s,h){if(this.images[s])throw new Error(`Image id ${s} already exist, use updateImage instead`);this._validate(s,h)&&(this.images[s]=h)}_validate(s,h){let m=!0;const y=h.data||h.spriteData;return this._validateStretch(h.stretchX,y&&y.width)||(this.fire(new b.ErrorEvent(new Error(`Image "${s}" has invalid "stretchX" value`))),m=!1),this._validateStretch(h.stretchY,y&&y.height)||(this.fire(new b.ErrorEvent(new Error(`Image "${s}" has invalid "stretchY" value`))),m=!1),this._validateContent(h.content,h)||(this.fire(new b.ErrorEvent(new Error(`Image "${s}" has invalid "content" value`))),m=!1),m}_validateStretch(s,h){if(!s)return!0;let m=0;for(const y of s){if(y[0]-1);k++,w[k]=I,S[k]=R,S[k+1]=Wr}for(let I=0,k=0;I{let I=this.entries[y];I||(I=this.entries[y]={glyphs:{},requests:{},ranges:{}});let k=I.glyphs[w];if(void 0!==k)return void S(null,{stack:y,id:w,glyph:k});if(k=this._tinySDF(I,y,w),k)return I.glyphs[w]=k,void S(null,{stack:y,id:w,glyph:k});const R=Math.floor(w/256);if(256*R>65535)return void S(new Error("glyphs > 65535 not supported"));if(I.ranges[R])return void S(null,{stack:y,id:w,glyph:k});if(!this.url)return void S(new Error("glyphsUrl is not set"));let z=I.requests[R];z||(z=I.requests[R]=[],Bn.loadGlyphRange(y,R,this.url,this.requestManager,(L,j)=>{if(j){for(const Q in j)this._doesCharSupportLocalGlyph(+Q)||(I.glyphs[+Q]=j[+Q]);I.ranges[R]=!0}for(const Q of z)Q(L,j);delete I.requests[R]})),z.push((L,j)=>{L?S(L):j&&S(null,{stack:y,id:w,glyph:j[w]||null})})},(y,w)=>{if(y)h(y);else if(w){const S={};for(const{stack:I,id:k,glyph:R}of w)(S[I]||(S[I]={}))[k]=R&&{id:R.id,bitmap:R.bitmap.clone(),metrics:R.metrics};h(null,S)}})}_doesCharSupportLocalGlyph(s){return!!this.localIdeographFontFamily&&(b.unicodeBlockLookup["CJK Unified Ideographs"](s)||b.unicodeBlockLookup["Hangul Syllables"](s)||b.unicodeBlockLookup.Hiragana(s)||b.unicodeBlockLookup.Katakana(s))}_tinySDF(s,h,m){const y=this.localIdeographFontFamily;if(!y||!this._doesCharSupportLocalGlyph(m))return;let w=s.tinySDF;if(!w){let I="400";/bold/i.test(h)?I="900":/medium/i.test(h)?I="500":/light/i.test(h)&&(I="200"),w=s.tinySDF=new Bn.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:y,fontWeight:I})}const S=w.draw(String.fromCharCode(m));return{id:m,bitmap:new b.AlphaImage({width:S.width||30,height:S.height||30},S.data),metrics:{width:S.glyphWidth||24,height:S.glyphHeight||24,left:S.glyphLeft||0,top:S.glyphTop-27||-8,advance:S.glyphAdvance||24}}}}Bn.loadGlyphRange=function(g,s,h,m,y){const w=256*s,S=w+255,I=m.transformRequest(h.replace("{fontstack}",g).replace("{range}",`${w}-${S}`),fn.Glyphs);b.getArrayBuffer(I,(k,R)=>{if(k)y(k);else if(R){const z={};for(const L of b.parseGlyphPbf(R))z[L.id]=L;y(null,z)}})},Bn.TinySDF=class{constructor({fontSize:g=24,buffer:s=3,radius:h=8,cutoff:m=.25,fontFamily:y="sans-serif",fontWeight:w="normal",fontStyle:S="normal"}={}){this.buffer=s,this.cutoff=m,this.radius=h;const I=this.size=g+4*s,k=this._createCanvas(I),R=this.ctx=k.getContext("2d",{willReadFrequently:!0});R.font=`${S} ${w} ${g}px ${y}`,R.textBaseline="alphabetic",R.textAlign="left",R.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Uint16Array(I)}_createCanvas(g){const s=document.createElement("canvas");return s.width=s.height=g,s}draw(g){const{width:s,actualBoundingBoxAscent:h,actualBoundingBoxDescent:m,actualBoundingBoxLeft:y,actualBoundingBoxRight:w}=this.ctx.measureText(g),S=Math.ceil(h),I=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(w-y))),k=Math.min(this.size-this.buffer,S+Math.ceil(m)),R=I+2*this.buffer,z=k+2*this.buffer,L=Math.max(R*z,0),j=new Uint8ClampedArray(L),Q={data:j,width:R,height:z,glyphWidth:I,glyphHeight:k,glyphTop:S,glyphLeft:0,glyphAdvance:s};if(0===I||0===k)return Q;const{ctx:ee,buffer:Y,gridInner:ae,gridOuter:_e}=this;ee.clearRect(Y,Y,I,k),ee.fillText(g,Y,Y+S);const ye=ee.getImageData(Y,Y,I,k);_e.fill(Wr,0,L),ae.fill(0,0,L);for(let ie=0;ie0?ke*ke:0,ae[Se]=ke<0?ke*ke:0}}Fa(_e,0,0,R,z,R,this.f,this.v,this.z),Fa(ae,Y,Y,I,k,R,this.f,this.v,this.z);for(let ie=0;ie1&&(k=s[++I]);const z=Math.abs(R-k.left),L=Math.abs(R-k.right),j=Math.min(z,L);let Q;const ee=w/m*(y+1);if(k.isDash){const Y=y-Math.abs(ee);Q=Math.sqrt(j*j+Y*Y)}else Q=y-Math.sqrt(j*j+ee*ee);this.data[S+R]=Math.max(0,Math.min(255,Q+128))}}}addRegularDash(s){for(let I=s.length-1;I>=0;--I){const k=s[I],R=s[I+1];k.zeroLength?s.splice(I,1):R&&R.isDash===k.isDash&&(R.left=k.left,s.splice(I,1))}const h=s[0],m=s[s.length-1];h.isDash===m.isDash&&(h.left=m.left-this.width,m.right=h.right+this.width);const y=this.width*this.nextRow;let w=0,S=s[w];for(let I=0;I1&&(S=s[++w]);const k=Math.abs(I-S.left),R=Math.abs(I-S.right),z=Math.min(k,R);this.data[y+I]=Math.max(0,Math.min(255,(S.isDash?z:-z)+128))}}addDash(s,h){const m=h?7:0,y=2*m+1;if(this.nextRow+y>this.height)return b.warnOnce("LineAtlas out of space"),null;let w=0;for(let I=0;I{y.send(s,h,w)},m=m||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(s=!0){this.actors.forEach(h=>{h.remove()}),this.actors=[],s&&this.workerPool.release(this.id)}}function La(g,s,h){const m=function(y,w){if(y)return h(y);if(w){const S=b.pick(b.extend(w,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);w.vector_layers&&(S.vectorLayers=w.vector_layers,S.vectorLayerIds=S.vectorLayers.map(I=>I.id)),h(null,S)}};return g.url?b.getJSON(s.transformRequest(g.url,fn.Source),m):b.exported.frame(()=>m(null,g))}pi.Actor=b.Actor;class na{constructor(s,h,m){this.bounds=b.LngLatBounds.convert(this.validateBounds(s)),this.minzoom=h||0,this.maxzoom=m||24}validateBounds(s){return Array.isArray(s)&&4===s.length?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){const h=Math.pow(2,s.z),m=Math.floor(b.mercatorXfromLng(this.bounds.getWest())*h),y=Math.floor(b.mercatorYfromLat(this.bounds.getNorth())*h),w=Math.ceil(b.mercatorXfromLng(this.bounds.getEast())*h),S=Math.ceil(b.mercatorYfromLat(this.bounds.getSouth())*h);return s.x>=m&&s.x=y&&s.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),s?this.fire(new b.ErrorEvent(s)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new na(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}onAdd(s){this.map=s,this.load()}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}setUrl(s){return this.setSourceProperty(()=>{this.url=s,this._options.url=s}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}loadTile(s,h){const m=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),y={request:this.map._requestManager.transformRequest(m,fn.Tile),uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,tileSize:this.tileSize*s.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function w(S,I){return delete s.request,s.aborted?h(null):S&&404!==S.status?h(S):(I&&I.resourceTiming&&(s.resourceTiming=I.resourceTiming),this.map._refreshExpiredTiles&&I&&s.setExpiryData(I),s.loadVectorData(I,this.map.painter),h(null),void(s.reloadCallback&&(this.loadTile(s,s.reloadCallback),s.reloadCallback=null)))}y.request.collectResourceTiming=this._collectResourceTiming,s.actor&&"expired"!==s.state?"loading"===s.state?s.reloadCallback=h:s.request=s.actor.send("reloadTile",y,w.bind(this)):(s.actor=this.dispatcher.getActor(),s.request=s.actor.send("loadTile",y,w.bind(this)))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.actor&&s.actor.send("abortTile",{uid:s.uid,type:this.type,source:this.id},void 0)}unloadTile(s){s.unloadVectorData(),s.actor&&s.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class tr extends b.Evented{constructor(s,h,m,y){super(),this.id=s,this.dispatcher=m,this.setEventedParent(y),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=b.extend({type:"raster"},h),b.extend(this,b.pick(h,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=La(this._options,this.map._requestManager,(s,h)=>{this._tileJSONRequest=null,this._loaded=!0,s?this.fire(new b.ErrorEvent(s)):h&&(b.extend(this,h),h.bounds&&(this.tileBounds=new na(h.bounds,this.minzoom,this.maxzoom)),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(s){this.map=s,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return b.extend({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s,h){const m=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);s.request=si.getImage(this.map._requestManager.transformRequest(m,fn.Tile),(y,w,S)=>{if(delete s.request,s.aborted)s.state="unloaded",h(null);else if(y)s.state="errored",h(y);else if(w){this.map._refreshExpiredTiles&&s.setExpiryData(S);const I=this.map.painter.context,k=I.gl;s.texture=this.map.painter.getTileTexture(w.width),s.texture?s.texture.update(w,{useMipmap:!0}):(s.texture=new Gn(I,w,k.RGBA,{useMipmap:!0}),s.texture.bind(k.LINEAR,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),I.extTextureFilterAnisotropic&&k.texParameterf(k.TEXTURE_2D,I.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,I.extTextureFilterAnisotropicMax)),s.state="loaded",h(null)}})}abortTile(s,h){s.request&&(s.request.cancel(),delete s.request),h()}unloadTile(s,h){s.texture&&this.map.painter.saveTileTexture(s.texture),h()}hasTransition(){return!1}}let Ae;class Pe extends tr{constructor(s,h,m,y){super(s,h,m,y),this.type="raster-dem",this.maxzoom=22,this._options=b.extend({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(s,h){const m=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function y(w,S){w&&(s.state="errored",h(w)),S&&(s.dem=S,s.needsHillshadePrepare=!0,s.needsTerrainPrepare=!0,s.state="loaded",h(null))}s.request=si.getImage(this.map._requestManager.transformRequest(m,fn.Tile),function(w,S){if(delete s.request,s.aborted)s.state="unloaded",h(null);else if(w)s.state="errored",h(w);else if(S){this.map._refreshExpiredTiles&&s.setExpiryData(S),delete S.cacheControl,delete S.expires;const I=b.isImageBitmap(S)&&(null==Ae&&(Ae=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Ae)?S:b.exported.getImageData(S,1),k={uid:s.uid,coord:s.tileID,source:this.id,rawImageData:I,encoding:this.encoding};s.actor&&"expired"!==s.state||(s.actor=this.dispatcher.getActor(),s.actor.send("loadDEMTile",k,y.bind(this)))}}.bind(this)),s.neighboringTiles=this._getNeighboringTiles(s.tileID)}_getNeighboringTiles(s){const h=s.canonical,m=Math.pow(2,h.z),y=(h.x-1+m)%m,w=0===h.x?s.wrap-1:s.wrap,S=(h.x+1+m)%m,I=h.x+1===m?s.wrap+1:s.wrap,k={};return k[new b.OverscaledTileID(s.overscaledZ,w,h.z,y,h.y).key]={backfilled:!1},k[new b.OverscaledTileID(s.overscaledZ,I,h.z,S,h.y).key]={backfilled:!1},h.y>0&&(k[new b.OverscaledTileID(s.overscaledZ,w,h.z,y,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(s.overscaledZ,s.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},k[new b.OverscaledTileID(s.overscaledZ,I,h.z,S,h.y-1).key]={backfilled:!1}),h.y+1{if(this._pendingLoads--,this._removed||y&&y.abandoned)return void this.fire(new b.Event("dataabort",{dataType:"source"}));let w=null;if(y&&y.resourceTiming&&y.resourceTiming[this.id]&&(w=y.resourceTiming[this.id].slice(0)),m)return void this.fire(new b.ErrorEvent(m));const S={dataType:"source"};this._collectResourceTiming&&w&&w.length>0&&b.extend(S,{resourceTiming:w}),this.fire(new b.Event("data",{...S,sourceDataType:"metadata"})),this.fire(new b.Event("data",{...S,sourceDataType:"content"}))})}loaded(){return 0===this._pendingLoads}loadTile(s,h){const m=s.actor?"reloadTile":"loadTile";s.actor=this.actor;const y={type:this.type,uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request=this.actor.send(m,y,(w,S)=>(delete s.request,s.unloadVectorData(),s.aborted?h(null):w?h(w):(s.loadVectorData(S,this.map.painter,"reloadTile"===m),h(null))))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.aborted=!0}unloadTile(s){s.unloadVectorData(),this.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return b.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Vi=b.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Vn extends b.Evented{constructor(s,h,m,y){super(),this.id=s,this.dispatcher=m,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(y),this.options=h}load(s,h){this._loaded=!1,this.fire(new b.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=si.getImage(this.map._requestManager.transformRequest(this.url,fn.Image),(m,y)=>{this._request=null,this._loaded=!0,m?this.fire(new b.ErrorEvent(m)):y&&(this.image=y,s&&(this.coordinates=s),h&&h(),this._finishLoading())})}loaded(){return this._loaded}updateImage(s){return s.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=s.url,this.load(s.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(s){this.map=s,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(s){this.coordinates=s;const h=s.map(b.MercatorCoordinate.fromLngLat);this.tileID=function(y){let w=1/0,S=1/0,I=-1/0,k=-1/0;for(const j of y)w=Math.min(w,j.x),S=Math.min(S,j.y),I=Math.max(I,j.x),k=Math.max(k,j.y);const R=Math.max(I-w,k-S),z=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),L=Math.pow(2,z);return new b.CanonicalTileID(z,Math.floor((w+I)/2*L),Math.floor((S+k)/2*L))}(h),this.minzoom=this.maxzoom=this.tileID.z;const m=h.map(y=>this.tileID.getTilePoint(y)._round());return this._boundsArray=new b.RasterBoundsArray,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,b.EXTENT,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,b.EXTENT),this._boundsArray.emplaceBack(m[2].x,m[2].y,b.EXTENT,b.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new b.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const s=this.map.painter.context,h=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Vi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Gn(s,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}loadTile(s,h){this.tileID&&this.tileID.equals(s.tileID.canonical)?(this.tiles[String(s.tileID.wrap)]=s,s.buckets={},h(null)):(s.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ds extends Vn{constructor(s,h,m,y){super(s,h,m,y),this.roundZoom=!0,this.type="video",this.options=h}load(){this._loaded=!1;const s=this.options;this.urls=[];for(const h of s.urls)this.urls.push(this.map._requestManager.transformRequest(h,fn.Source).url);b.getVideo(this.urls,(h,m)=>{this._loaded=!0,h?this.fire(new b.ErrorEvent(h)):m&&(this.video=m,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(s){if(this.video){const h=this.video.seekable;sh.end(0)?this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=s}}getVideo(){return this.video}onAdd(s){this.map||(this.map=s,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const s=this.map.painter.context,h=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Vi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new Gn(s,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));for(const m in this.tiles){const y=this.tiles[m];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ui extends Vn{constructor(s,h,m,y){super(s,h,m,y),h.coordinates?Array.isArray(h.coordinates)&&4===h.coordinates.length&&!h.coordinates.some(w=>!Array.isArray(w)||2!==w.length||w.some(S=>"number"!=typeof S))||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${s}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${s}`,null,'missing required property "coordinates"'))),h.animate&&"boolean"!=typeof h.animate&&this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${s}`,null,'optional "animate" property must be a boolean value'))),h.canvas?"string"==typeof h.canvas||h.canvas instanceof HTMLCanvasElement||this.fire(new b.ErrorEvent(new b.ValidationError(`sources.${s}`,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 b.ErrorEvent(new b.ValidationError(`sources.${s}`,null,'missing required property "canvas"'))),this.options=h,this.animate=void 0===h.animate||h.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new b.ErrorEvent(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(s){this.map=s,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let s=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,s=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,s=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const h=this.map.painter.context,m=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,Vi.members)),this.boundsSegments||(this.boundsSegments=b.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(s||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Gn(h,this.canvas,m.RGBA,{premultiply:!0});for(const y in this.tiles){const w=this.tiles[y];"loaded"!==w.state&&(w.state="loaded",w.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const s of[this.canvas.width,this.canvas.height])if(isNaN(s)||s<=0)return!0;return!1}}const Pl={vector:yr,raster:tr,"raster-dem":Pe,geojson:Na,video:ds,image:Vn,canvas:Ui};function fs(g,s){const h=b.create();return b.translate(h,h,[1,1,0]),b.scale(h,h,[.5*g.width,.5*g.height,1]),b.multiply(h,h,g.calculatePosMatrix(s.toUnwrapped()))}function rt(g,s,h,m,y,w){const S=function(L,j,Q){if(L)for(const ee of L){const Y=j[ee];if(Y&&Y.source===Q&&"fill-extrusion"===Y.type)return!0}else for(const ee in j){const Y=j[ee];if(Y.source===Q&&"fill-extrusion"===Y.type)return!0}return!1}(y&&y.layers,s,g.id),I=w.maxPitchScaleFactor(),k=g.tilesIn(m,I,S);k.sort(Jt);const R=[];for(const L of k)R.push({wrappedTileID:L.tileID.wrapped().key,queryResults:L.tile.queryRenderedFeatures(s,h,g._state,L.queryGeometry,L.cameraQueryGeometry,L.scale,y,w,I,fs(g.transform,L.tileID))});const z=function(L){const j={},Q={};for(const ee of L){const Y=ee.queryResults,ae=ee.wrappedTileID,_e=Q[ae]=Q[ae]||{};for(const ye in Y){const ie=Y[ye],we=_e[ye]=_e[ye]||{},De=j[ye]=j[ye]||[];for(const Se of ie)we[Se.featureIndex]||(we[Se.featureIndex]=!0,De.push(Se))}}return j}(R);for(const L in z)z[L].forEach(j=>{const Q=j.feature,ee=g.getFeatureState(Q.layer["source-layer"],Q.id);Q.source=Q.layer.source,Q.layer["source-layer"]&&(Q.sourceLayer=Q.layer["source-layer"]),Q.state=ee});return z}function Jt(g,s){const h=g.tileID,m=s.tileID;return h.overscaledZ-m.overscaledZ||h.canonical.y-m.canonical.y||h.wrap-m.wrap||h.canonical.x-m.canonical.x}class jt{constructor(s,h){this.tileID=s,this.uid=b.uniqueId(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(s){const h=s+this.timeAdded;hw.getLayer(R)).filter(Boolean);if(0!==k.length){I.layers=k,I.stateDependentLayerIds&&(I.stateDependentLayers=I.stateDependentLayerIds.map(R=>k.filter(z=>z.id===R)[0]));for(const R of k)S[R.id]=I}}return S}(s.buckets,h.style),this.hasSymbolBuckets=!1;for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket){if(this.hasSymbolBuckets=!0,!m)break;w.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const y in this.buckets){const w=this.buckets[y];if(w instanceof b.SymbolBucket&&w.hasRTLText){this.hasRTLText=!0,b.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const y in this.buckets){const w=this.buckets[y];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(y).queryRadius(w))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new b.CollisionBoxArray}unloadVectorData(){for(const s in this.buckets)this.buckets[s].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(s){return this.buckets[s.id]}upload(s){for(const m in this.buckets){const y=this.buckets[m];y.uploadPending()&&y.upload(s)}const h=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Gn(s,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Gn(s,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,h,m,y,w,S,I,k,R,z){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:y,cameraQueryGeometry:w,scale:S,tileSize:this.tileSize,pixelPosMatrix:z,transform:k,params:I,queryPadding:this.queryPadding*R},s,h,m):{}}querySourceFeatures(s,h){const m=this.latestFeatureIndex;if(!m||!m.rawTileData)return;const y=m.loadVTLayers(),w=h&&h.sourceLayer?h.sourceLayer:"",S=y._geojsonTileLayer||y[w];if(!S)return;const I=b.createFilter(h&&h.filter),{z:k,x:R,y:z}=this.tileID.canonical,L={z:k,x:R,y:z};for(let j=0;jm)y=!1;else if(h)if(this.expirationTime{this.remove(s,w)},m)),this.data[y].push(w),this.order.push(y),this.order.length>this.max){const S=this._getAndRemoveByKey(this.order[0]);S&&this.onRemove(S)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){const h=this.data[s].shift();return h.timeout&&clearTimeout(h.timeout),0===this.data[s].length&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),h.value}getByKey(s){const h=this.data[s];return h?h[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,h){if(!this.has(s))return this;const m=s.wrapped().key,y=void 0===h?0:this.data[m].indexOf(h),w=this.data[m][y];return this.data[m].splice(y,1),w.timeout&&clearTimeout(w.timeout),0===this.data[m].length&&delete this.data[m],this.onRemove(w.value),this.order.splice(this.order.indexOf(m),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(s){const h=[];for(const m in this.data)for(const y of this.data[m])s(y.value)||h.push(y);for(const m of h)this.remove(m.value.tileID,m)}}class ps{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,h,m){const y=String(h);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][y]=this.stateChanges[s][y]||{},b.extend(this.stateChanges[s][y],m),null===this.deletedStates[s]){this.deletedStates[s]={};for(const w in this.state[s])w!==y&&(this.deletedStates[s][w]=null)}else if(this.deletedStates[s]&&null===this.deletedStates[s][y]){this.deletedStates[s][y]={};for(const w in this.state[s][y])m[w]||(this.deletedStates[s][y][w]=null)}else for(const w in m)this.deletedStates[s]&&this.deletedStates[s][y]&&null===this.deletedStates[s][y][w]&&delete this.deletedStates[s][y][w]}removeFeatureState(s,h,m){if(null===this.deletedStates[s])return;const y=String(h);if(this.deletedStates[s]=this.deletedStates[s]||{},m&&void 0!==h)null!==this.deletedStates[s][y]&&(this.deletedStates[s][y]=this.deletedStates[s][y]||{},this.deletedStates[s][y][m]=null);else if(void 0!==h)if(this.stateChanges[s]&&this.stateChanges[s][y])for(m in this.deletedStates[s][y]={},this.stateChanges[s][y])this.deletedStates[s][y][m]=null;else this.deletedStates[s][y]=null;else this.deletedStates[s]=null}getState(s,h){const m=String(h),y=b.extend({},(this.state[s]||{})[m],(this.stateChanges[s]||{})[m]);if(null===this.deletedStates[s])return{};if(this.deletedStates[s]){const w=this.deletedStates[s][h];if(null===w)return{};for(const S in w)delete y[S]}return y}initializeTileState(s,h){s.setFeatureState(this.state,h)}coalesceChanges(s,h){const m={};for(const y in this.stateChanges){this.state[y]=this.state[y]||{};const w={};for(const S in this.stateChanges[y])this.state[y][S]||(this.state[y][S]={}),b.extend(this.state[y][S],this.stateChanges[y][S]),w[S]=this.state[y][S];m[y]=w}for(const y in this.deletedStates){this.state[y]=this.state[y]||{};const w={};if(null===this.deletedStates[y])for(const S in this.state[y])w[S]={},this.state[y][S]={};else for(const S in this.deletedStates[y]){if(null===this.deletedStates[y][S])this.state[y][S]={};else for(const I of Object.keys(this.deletedStates[y][S]))delete this.state[y][S][I];w[S]=this.state[y][S]}m[y]=m[y]||{},b.extend(m[y],w)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(m).length)for(const y in s)s[y].setFeatureState(m,h)}}class At extends b.Evented{constructor(s,h,m){super(),this.id=s,this.dispatcher=m,this.on("data",y=>{"source"===y.dataType&&"metadata"===y.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===y.dataType&&"content"===y.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(y,w,S,I){const k=new Pl[w.type](y,w,S,I);if(k.id!==y)throw new Error(`Expected Source id to be ${y} instead of ${k.id}`);return b.bindAll(["load","abort","unload","serialize","prepare"],k),k}(s,h,m,this),this._tiles={},this._cache=new so(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ps}onAdd(s){this.map=s,this._maxTileCacheSize=s?s._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(s)}onRemove(s){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(s)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const s in this._tiles){const h=this._tiles[s];if("loaded"!==h.state&&"errored"!==h.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(s,h){return this._source.loadTile(s,h)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s,()=>{})}_abortTile(s){this._source.abortTile&&this._source.abortTile(s,()=>{}),this._source.fire(new b.Event("dataabort",{tile:s,coord:s.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const m=this._tiles[h];m.upload(s),m.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(s=>s.tileID).sort(Ls).map(s=>s.key)}getRenderableIds(s){const h=[];for(const m in this._tiles)this._isIdRenderable(m,s)&&h.push(this._tiles[m]);return s?h.sort((m,y)=>{const w=m.tileID,S=y.tileID,I=new b.pointGeometry(w.canonical.x,w.canonical.y)._rotate(this.transform.angle),k=new b.pointGeometry(S.canonical.x,S.canonical.y)._rotate(this.transform.angle);return w.overscaledZ-S.overscaledZ||k.y-I.y||k.x-I.x}).map(m=>m.tileID.key):h.map(m=>m.tileID).sort(Ls).map(m=>m.key)}hasRenderableParent(s){const h=this.findLoadedParent(s,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(s,h){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(h||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)"errored"!==this._tiles[s].state&&this._reloadTile(s,"reloading")}}_reloadTile(s,h){const m=this._tiles[s];m&&("loading"!==m.state&&(m.state=h),this._loadTile(m,this._tileLoaded.bind(this,m,s,h)))}_tileLoaded(s,h,m,y){if(y)return s.state="errored",void(404!==y.status?this._source.fire(new b.ErrorEvent(y,{tile:s})):this.update(this.transform,this.terrain));s.timeAdded=b.exported.now(),"expired"===m&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(h,s),"raster-dem"===this.getSource().type&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),s.aborted||this._source.fire(new b.Event("data",{dataType:"source",tile:s,coord:s.tileID}))}_backfillDEM(s){const h=this.getRenderableIds();for(let y=0;y1||(Math.abs(S)>1&&(1===Math.abs(S+k)?S+=k:1===Math.abs(S-k)&&(S-=k)),w.dem&&y.dem&&(y.dem.backfillBorder(w.dem,S,I),y.neighboringTiles&&y.neighboringTiles[R]&&(y.neighboringTiles[R].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,h,m,y){for(const w in this._tiles){let S=this._tiles[w];if(y[w]||!S.hasData()||S.tileID.overscaledZ<=h||S.tileID.overscaledZ>m)continue;let I=S.tileID;for(;S&&S.tileID.overscaledZ>h+1;){const R=S.tileID.scaledTo(S.tileID.overscaledZ-1);S=this._tiles[R.key],S&&S.hasData()&&(I=R)}let k=I;for(;k.overscaledZ>h;)if(k=k.scaledTo(k.overscaledZ-1),s[k.key]){y[I.key]=I;break}}}findLoadedParent(s,h){if(s.key in this._loadedParentTiles){const m=this._loadedParentTiles[s.key];return m&&m.tileID.overscaledZ>=h?m:null}for(let m=s.overscaledZ-1;m>=h;m--){const y=s.scaledTo(m),w=this._getLoadedTile(y);if(w)return w}}_getLoadedTile(s){const h=this._tiles[s.key];return h&&h.hasData()?h:this._cache.getByKey(s.wrapped().key)}updateCacheSize(s){const h=Math.ceil(s.width/this._source.tileSize)+1,m=Math.ceil(s.height/this._source.tileSize)+1,y=Math.floor(h*m*5),w="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,y):y;this._cache.setMaxSize(w)}handleWrapJump(s){const h=Math.round((s-(void 0===this._prevLng?s:this._prevLng))/360);if(this._prevLng=s,h){const m={};for(const y in this._tiles){const w=this._tiles[y];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+h),m[w.tileID.key]=w}this._tiles=m;for(const y in this._timers)clearTimeout(this._timers[y]),delete this._timers[y];for(const y in this._tiles)this._setTileReloadTimer(y,this._tiles[y])}}update(s,h){if(this.transform=s,this.terrain=h,!this._sourceLoaded||this._paused)return;let m;this.updateCacheSize(s),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?m=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(R=>new b.OverscaledTileID(R.canonical.z,R.wrap,R.canonical.z,R.canonical.x,R.canonical.y)):(m=s.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(m=m.filter(R=>this._source.hasTile(R)))):m=[];const y=s.coveringZoomLevel(this._source),w=Math.max(y-At.maxOverzooming,this._source.minzoom),S=Math.max(y+At.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const R={};for(const z of m)if(z.canonical.z>this._source.minzoom){const L=z.scaledTo(z.canonical.z-1);R[L.key]=L;const j=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));R[j.key]=j}m=m.concat(Object.values(R))}const I=this._updateRetainedTiles(m,y);if(Ei(this._source.type)){const R={},z={},L=Object.keys(I);for(const j of L){const Q=I[j],ee=this._tiles[j];if(!ee||ee.fadeEndTime&&ee.fadeEndTime<=b.exported.now())continue;const Y=this.findLoadedParent(Q,w);Y&&(this._addTile(Y.tileID),R[Y.tileID.key]=Y.tileID),z[j]=Q}this._retainLoadedChildren(z,y,S,I);for(const j in R)I[j]||(this._coveredTiles[j]=!0,I[j]=R[j]);if(h){const j={},Q={};for(const ee of m)this._tiles[ee.key].hasData()?j[ee.key]=ee:Q[ee.key]=ee;for(const ee in Q){const Y=Q[ee].children(this._source.maxzoom);this._tiles[Y[0].key]&&this._tiles[Y[1].key]&&this._tiles[Y[2].key]&&this._tiles[Y[3].key]&&(j[Y[0].key]=I[Y[0].key]=Y[0],j[Y[1].key]=I[Y[1].key]=Y[1],j[Y[2].key]=I[Y[2].key]=Y[2],j[Y[3].key]=I[Y[3].key]=Y[3],delete Q[ee])}for(const ee in Q){const Y=this.findLoadedParent(Q[ee],this._source.minzoom);if(Y){j[Y.tileID.key]=I[Y.tileID.key]=Y.tileID;for(const ae in j)j[ae].isChildOf(Y.tileID)&&delete j[ae]}}for(const ee in this._tiles)j[ee]||(this._coveredTiles[ee]=!0)}}for(const R in I)this._tiles[R].clearFadeHold();const k=b.keysDifference(this._tiles,I);for(const R of k){const z=this._tiles[R];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(R)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(s)}_updateRetainedTiles(s,h){const m={},y={},w=Math.max(h-At.maxOverzooming,this._source.minzoom),S=Math.max(h+At.maxUnderzooming,this._source.minzoom),I={};for(const k of s){const R=this._addTile(k);m[k.key]=k,R.hasData()||hthis._source.maxzoom){const L=k.children(this._source.maxzoom)[0],j=this.getTile(L);if(j&&j.hasData()){m[L.key]=L;continue}}else{const L=k.children(this._source.maxzoom);if(m[L[0].key]&&m[L[1].key]&&m[L[2].key]&&m[L[3].key])continue}let z=R.wasRequested();for(let L=k.overscaledZ-1;L>=w;--L){const j=k.scaledTo(L);if(y[j.key]||(y[j.key]=!0,R=this.getTile(j),!R&&z&&(R=this._addTile(j)),R&&(m[j.key]=j,z=R.wasRequested(),R.hasData())))break}}return m}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const s in this._tiles){const h=[];let m,y=this._tiles[s].tileID;for(;y.overscaledZ>0;){if(y.key in this._loadedParentTiles){m=this._loadedParentTiles[y.key];break}h.push(y.key);const w=y.scaledTo(y.overscaledZ-1);if(m=this._getLoadedTile(w),m)break;y=w}for(const w of h)this._loadedParentTiles[w]=m}}_addTile(s){let h=this._tiles[s.key];if(h)return h;h=this._cache.getAndRemove(s),h&&(this._setTileReloadTimer(s.key,h),h.tileID=s,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,h)));const m=h;return h||(h=new jt(s,this._source.tileSize*s.overscaleFactor()),this._loadTile(h,this._tileLoaded.bind(this,h,s.key,h.state))),h.uses++,this._tiles[s.key]=h,m||this._source.fire(new b.Event("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(s,h){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);const m=h.getExpiryTimeout();m&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},m))}_removeTile(s){const h=this._tiles[s];h&&(h.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),h.uses>0||(h.hasData()&&"reloading"!==h.state?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const s in this._tiles)this._removeTile(s);this._cache.reset()}tilesIn(s,h,m){const y=[],w=this.transform;if(!w)return y;const S=m?w.getCameraQueryGeometry(s):s,I=s.map(ee=>w.pointCoordinate(ee,this.terrain)),k=S.map(ee=>w.pointCoordinate(ee,this.terrain)),R=this.getIds();let z=1/0,L=1/0,j=-1/0,Q=-1/0;for(const ee of k)z=Math.min(z,ee.x),L=Math.min(L,ee.y),j=Math.max(j,ee.x),Q=Math.max(Q,ee.y);for(let ee=0;ee=0&&ie[1].y+ye>=0){const we=I.map(Se=>ae.getTilePoint(Se)),De=k.map(Se=>ae.getTilePoint(Se));y.push({tile:Y,tileID:ae,queryGeometry:we,cameraQueryGeometry:De,scale:_e})}}return y}getVisibleCoordinates(s){const h=this.getRenderableIds(s).map(m=>this._tiles[m].tileID);for(const m of h)m.posMatrix=this.transform.calculatePosMatrix(m.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(Ei(this._source.type))for(const s in this._tiles){const h=this._tiles[s];if(void 0!==h.fadeEndTime&&h.fadeEndTime>=b.exported.now())return!0}return!1}setFeatureState(s,h,m){this._state.updateState(s=s||"_geojsonTileLayer",h,m)}removeFeatureState(s,h,m){this._state.removeFeatureState(s=s||"_geojsonTileLayer",h,m)}getFeatureState(s,h){return this._state.getState(s=s||"_geojsonTileLayer",h)}setDependencies(s,h,m){const y=this._tiles[s];y&&y.setDependencies(h,m)}reloadTilesForDependencies(s,h){for(const m in this._tiles)this._tiles[m].hasDependency(s,h)&&this._reloadTile(m,"reloading");this._cache.filter(m=>!m.hasDependency(s,h))}}function Ls(g,s){const h=Math.abs(2*g.wrap)-+(g.wrap<0),m=Math.abs(2*s.wrap)-+(s.wrap<0);return g.overscaledZ-s.overscaledZ||m-h||s.canonical.y-g.canonical.y||s.canonical.x-g.canonical.x}function Ei(g){return"raster"===g||"image"===g||"video"===g}At.maxOverzooming=10,At.maxUnderzooming=3;const ra="mapboxgl_preloaded_worker_pool";class ao{constructor(){this.active={}}acquire(s){if(!this.workers)for(this.workers=[];this.workers.length{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ra]}numActive(){return Object.keys(this.active).length}}const $i=Math.floor(b.exported.hardwareConcurrency/2);let Nn;function Fc(){return Nn||(Nn=new ao),Nn}function lo(g,s){const h={};for(const m in g)"ref"!==m&&(h[m]=g[m]);return b.refProperties.forEach(m=>{m in s&&(h[m]=s[m])}),h}function Rl(g){g=g.slice();const s=Object.create(null);for(let h=0;h0?(y-S)/I:0;return this.points[w].mult(1-k).add(this.points[h].mult(k))}}function co(g,s){let h=!0;return"always"===g||"never"!==g&&"never"!==s||(h=!1),h}class Xr{constructor(s,h,m){const y=this.boxCells=[],w=this.circleCells=[];this.xCellCount=Math.ceil(s/m),this.yCellCount=Math.ceil(h/m);for(let S=0;Sthis.width||y<0||h>this.height)return[];const k=[];if(s<=0&&h<=0&&this.width<=m&&this.height<=y){if(w)return[{key:null,x1:s,y1:h,x2:m,y2:y}];for(let R=0;R0}hitTestCircle(s,h,m,y,w){const S=s-m,I=s+m,k=h-m,R=h+m;if(I<0||S>this.width||R<0||k>this.height)return!1;const z=[];return this._forEachCell(S,k,I,R,this._queryCellCircle,z,{hitTest:!0,overlapMode:y,circle:{x:s,y:h,radius:m},seenUids:{box:{},circle:{}}},w),z.length>0}_queryCell(s,h,m,y,w,S,I,k){const{seenUids:R,hitTest:z,overlapMode:L}=I,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!R.box[Y]){R.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(s<=ee[ae+2]&&h<=ee[ae+3]&&m>=ee[ae+0]&&y>=ee[ae+1]&&(!k||k(_e))&&(!z||!co(L,_e.overlapMode))&&(S.push({key:_e,x1:ee[ae],y1:ee[ae+1],x2:ee[ae+2],y2:ee[ae+3]}),z))return!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!R.circle[Y]){R.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circleAndRectCollide(ee[ae],ee[ae+1],ee[ae+2],s,h,m,y)&&(!k||k(_e))&&(!z||!co(L,_e.overlapMode))){const ye=ee[ae],ie=ee[ae+1],we=ee[ae+2];if(S.push({key:_e,x1:ye-we,y1:ie-we,x2:ye+we,y2:ie+we}),z)return!0}}}return!1}_queryCellCircle(s,h,m,y,w,S,I,k){const{circle:R,seenUids:z,overlapMode:L}=I,j=this.boxCells[w];if(null!==j){const ee=this.bboxes;for(const Y of j)if(!z.box[Y]){z.box[Y]=!0;const ae=4*Y,_e=this.boxKeys[Y];if(this._circleAndRectCollide(R.x,R.y,R.radius,ee[ae+0],ee[ae+1],ee[ae+2],ee[ae+3])&&(!k||k(_e))&&!co(L,_e.overlapMode))return S.push(!0),!0}}const Q=this.circleCells[w];if(null!==Q){const ee=this.circles;for(const Y of Q)if(!z.circle[Y]){z.circle[Y]=!0;const ae=3*Y,_e=this.circleKeys[Y];if(this._circlesCollide(ee[ae],ee[ae+1],ee[ae+2],R.x,R.y,R.radius)&&(!k||k(_e))&&!co(L,_e.overlapMode))return S.push(!0),!0}}}_forEachCell(s,h,m,y,w,S,I,k){const R=this._convertToXCellCoord(s),z=this._convertToYCellCoord(h),L=this._convertToXCellCoord(m),j=this._convertToYCellCoord(y);for(let Q=R;Q<=L;Q++)for(let ee=z;ee<=j;ee++)if(w.call(this,s,h,m,y,this.xCellCount*ee+Q,S,I,k))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,h,m,y,w,S){const I=y-s,k=w-h,R=m+S;return R*R>I*I+k*k}_circleAndRectCollide(s,h,m,y,w,S,I){const k=(S-y)/2,R=Math.abs(s-(y+k));if(R>k+m)return!1;const z=(I-w)/2,L=Math.abs(h-(w+z));if(L>z+m)return!1;if(R<=k||L<=z)return!0;const j=R-k,Q=L-z;return j*j+Q*Q<=m*m}}function $r(g,s,h,m,y){const w=b.create();return s?(b.scale(w,w,[1/y,1/y,1]),h||b.rotateZ(w,w,m.angle)):b.multiply(w,m.labelPlaneMatrix,g),w}function mi(g,s,h,m,y){if(s){const w=b.clone(g);return b.scale(w,w,[y,y,1]),h||b.rotateZ(w,w,-m.angle),w}return m.glCoordMatrix}function gi(g,s,h){let m;h?(m=[g.x,g.y,h(g.x,g.y),1],b.transformMat4(m,m,s)):(m=[g.x,g.y,0,1],xe(m,m,s));const y=m[3];return{point:new b.pointGeometry(m[0]/y,m[1]/y),signedDistanceFromCamera:y}}function Ns(g,s){return.5+g/s*.5}function J(g,s){const h=g[0]/g[3],m=g[1]/g[3];return h>=-s[0]&&h<=s[0]&&m>=-s[1]&&m<=s[1]}function V(g,s,h,m,y,w,S,I,k,R){const z=m?g.textSizeData:g.iconSizeData,L=b.evaluateSizeForZoom(z,h.transform.zoom),j=[256/h.width*2+1,256/h.height*2+1],Q=m?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;Q.clear();const ee=g.lineVertexArray,Y=m?g.text.placedSymbolArray:g.icon.placedSymbolArray,ae=h.transform.width/h.transform.height;let _e=!1;for(let ye=0;yeMath.abs(h.x-s.x)*m?{useVertical:!0}:(g===b.WritingMode.vertical?s.yh.x)?{needsFlipping:!0}:null}function te(g,s,h,m,y,w,S,I,k,R,z,L,j,Q,ee,Y){const ae=s/24,_e=g.lineOffsetX*ae,ye=g.lineOffsetY*ae;let ie;if(g.numGlyphs>1){const we=g.glyphStartIndex+g.numGlyphs,De=g.lineStartIndex,Se=g.lineStartIndex+g.lineLength,ke=$(ae,I,_e,ye,h,z,L,g,k,w,j,ee,Y);if(!ke)return{notEnoughRoom:!0};const Be=gi(ke.first.point,S,Y).point,Le=gi(ke.last.point,S,Y).point;if(m&&!h){const Ne=K(g.writingMode,Be,Le,Q);if(Ne)return Ne}ie=[ke.first];for(let Ne=g.glyphStartIndex+1;Ne0?Be.point:ce(L,ke,De,1,y,Y),Ne=K(g.writingMode,De,Le,Q);if(Ne)return Ne}const we=ge(ae*I.getoffsetX(g.glyphStartIndex),_e,ye,h,z,L,g.segment,g.lineStartIndex,g.lineStartIndex+g.lineLength,k,w,j,ee,Y);if(!we)return{notEnoughRoom:!0};ie=[we]}for(const we of ie)b.addDynamicAttributes(R,we.point,we.angle);return{}}function ce(g,s,h,m,y,w){const S=gi(g.add(g.sub(s)._unit()),y,w).point,I=h.sub(S);return h.add(I._mult(m/I.mag()))}function ge(g,s,h,m,y,w,S,I,k,R,z,L,j,Q){const ee=m?g-s:g+s;let Y=ee>0?1:-1,ae=0;m&&(Y*=-1,ae=Math.PI),Y<0&&(ae+=Math.PI);let _e=Y>0?I+S:I+S+1,ye=y,ie=y,we=0,De=0;const Se=Math.abs(ee),ke=[];for(;we+De<=Se;){if(_e+=Y,_e=k)return null;if(ie=ye,ke.push(ye),ye=L[_e],void 0===ye){const ft=new b.pointGeometry(R.getx(_e),R.gety(_e)),Pt=gi(ft,z,Q);if(Pt.signedDistanceFromCamera>0)ye=L[_e]=Pt.point;else{const Nt=_e-Y;ye=ce(0===we?w:new b.pointGeometry(R.getx(Nt),R.gety(Nt)),ft,ie,Se-we+1,z,Q)}}we+=De,De=ie.dist(ye)}const Be=(Se-we)/De,Le=ye.sub(ie),Ne=Le.mult(Be)._add(ie);Ne._add(Le._unit()._perp()._mult(h*Y));const ze=ae+Math.atan2(ye.y-ie.y,ye.x-ie.x);return ke.push(Ne),{point:Ne,angle:j?ze:0,path:ke}}const he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(g,s){for(let h=0;h=1;Ht--)mt.push(Pt.path[Ht]);for(let Ht=1;Htgi(rn,k,ee));mt=Ht.some(rn=>rn.signedDistanceFromCamera<=0)?[]:Ht.map(rn=>rn.point)}let An=[];if(mt.length>0){const Ht=mt[0].clone(),rn=mt[0].clone();for(let Fn=1;Fn=Ne.x&&rn.x<=ze.x&&Ht.y>=Ne.y&&rn.y<=ze.y?[mt]:rn.xze.x||rn.yze.y?[]:b.clipLine([mt],Ne.x,Ne.y,ze.x,ze.y)}for(const Ht of An){ft.reset(Ht,.25*Le);let rn=0;rn=ft.length<=.5*Le?1:Math.ceil(ft.paddedLength/In)+1;for(let Fn=0;Fn=this.screenRightBoundary||ythis.screenBottomBoundary}isInsideGrid(s,h,m,y){return m>=0&&s=0&&hm.collisionGroupID===h}}return this.collisionGroups[s]}}function sn(g,s,h,m,y){const{horizontalAlign:w,verticalAlign:S}=b.getAnchorAlignment(g),I=-(w-.5)*s,k=-(S-.5)*h,R=b.evaluateVariableOffset(g,m);return new b.pointGeometry(I+R[0]*y,k+R[1]*y)}function an(g,s,h,m,y,w){const{x1:S,x2:I,y1:k,y2:R,anchorPointX:z,anchorPointY:L}=g,j=new b.pointGeometry(s,h);return m&&j._rotate(y?w:-w),{x1:S+j.x,y1:k+j.y,x2:I+j.x,y2:R+j.y,anchorPointX:z,anchorPointY:L}}class Zn{constructor(s,h,m,y,w){this.transform=s.clone(),this.terrain=h,this.collisionIndex=new je(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new qn(y),this.collisionCircleArrays={},this.prevPlacement=w,w&&(w.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,h,m,y){const w=m.getBucket(h),S=m.latestFeatureIndex;if(!w||!S||h.id!==w.layerIds[0])return;const I=m.collisionBoxArray,k=w.layers[0].layout,R=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),z=m.tileSize/b.EXTENT,L=this.transform.calculatePosMatrix(m.tileID.toUnwrapped()),j="map"===k.get("text-pitch-alignment"),Q="map"===k.get("text-rotation-alignment"),ee=Te(m,1,this.transform.zoom),Y=$r(L,j,Q,this.transform,ee);let ae=null;if(j){const ye=mi(L,j,Q,this.transform,ee);ae=b.multiply([],this.transform.labelPlaneMatrix,ye)}this.retainedQueryData[w.bucketInstanceId]=new ln(w.bucketInstanceId,S,w.sourceLayerIndex,w.index,m.tileID);const _e={bucket:w,layout:k,posMatrix:L,textLabelPlaneMatrix:Y,labelToScreenMatrix:ae,scale:R,textPixelRatio:z,holdingForFade:m.holdingForFade(),collisionBoxArray:I,partiallyEvaluatedTextSize:b.evaluateSizeForZoom(w.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(w.sourceID)};if(y)for(const ye of w.sortKeyRanges){const{sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De}=ye;s.push({sortKey:ie,symbolInstanceStart:we,symbolInstanceEnd:De,parameters:_e})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:w.symbolInstances.length,parameters:_e})}attemptAnchorPlacement(s,h,m,y,w,S,I,k,R,z,L,j,Q,ee,Y,ae){const _e=[j.textOffset0,j.textOffset1],ye=sn(s,m,y,_e,w),ie=this.collisionIndex.placeCollisionBox(an(h,ye.x,ye.y,S,I,this.transform.angle),L,k,R,z.predicate,ae);if((!Y||0!==this.collisionIndex.placeCollisionBox(an(Y,ye.x,ye.y,S,I,this.transform.angle),L,k,R,z.predicate,ae).box.length)&&ie.box.length>0){let we;if(this.prevPlacement&&this.prevPlacement.variableOffsets[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID]&&this.prevPlacement.placements[j.crossTileID].text&&(we=this.prevPlacement.variableOffsets[j.crossTileID].anchor),0===j.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[j.crossTileID]={textOffset:_e,width:m,height:y,anchor:s,textBoxScale:w,prevAnchor:we},this.markUsedJustification(Q,s,j,ee),Q.allowVerticalPlacement&&(this.markUsedOrientation(Q,ee,j),this.placedOrientations[j.crossTileID]=ee),{shift:ye,placedGlyphBoxes:ie}}}placeLayerBucketPart(s,h,m){const{bucket:y,layout:w,posMatrix:S,textLabelPlaneMatrix:I,labelToScreenMatrix:k,textPixelRatio:R,holdingForFade:z,collisionBoxArray:L,partiallyEvaluatedTextSize:j,collisionGroup:Q}=s.parameters,ee=w.get("text-optional"),Y=w.get("icon-optional"),ae=b.getOverlapMode(w,"text-overlap","text-allow-overlap"),_e="always"===ae,ye=b.getOverlapMode(w,"icon-overlap","icon-allow-overlap"),ie="always"===ye,we="map"===w.get("text-rotation-alignment"),De="map"===w.get("text-pitch-alignment"),Se="none"!==w.get("icon-text-fit"),ke="viewport-y"===w.get("symbol-z-order"),Be=_e&&(ie||!y.hasIconData()||Y),Le=ie&&(_e||!y.hasTextData()||ee);!y.collisionArrays&&L&&y.deserializeCollisionBoxes(L);const Ne=(ze,ft)=>{if(h[ze.crossTileID])return;if(z)return void(this.placements[ze.crossTileID]=new dt(!1,!1,!1));let Pt=!1,Nt=!1,mt=!0,In=null,An={box:null,offscreen:null},Ht={box:null,offscreen:null},rn=null,Fn=null,yn=null,yo=0,Fo=0,vr=0;ft.textFeatureIndex?yo=ft.textFeatureIndex:ze.useRuntimeCollisionCircles&&(yo=ze.featureIndex),ft.verticalTextFeatureIndex&&(Fo=ft.verticalTextFeatureIndex);const ci=this.retainedQueryData[y.bucketInstanceId].tileID,Ii=this.terrain?(Fr,dr)=>this.terrain.getElevation(ci,Fr,dr):null;for(const Fr of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const dr=ft[Fr];dr&&(dr.elevation=Ii?Ii(dr.anchorPointX,dr.anchorPointY):0)}const Jo=ft.textBox;if(Jo){const Fr=On=>{let Zi=b.WritingMode.horizontal;if(y.allowVerticalPlacement&&!On&&this.prevPlacement){const Jr=this.prevPlacement.placedOrientations[ze.crossTileID];Jr&&(this.placedOrientations[ze.crossTileID]=Jr,Zi=Jr,this.markUsedOrientation(y,Zi,ze))}return Zi},dr=(On,Zi)=>{if(y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&ft.verticalTextBox){for(const Jr of y.writingModes)if(Jr===b.WritingMode.vertical?(An=Zi(),Ht=An):An=On(),An&&An.box&&An.box.length)break}else An=On()};if(w.get("text-variable-anchor")){let On=w.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[ze.crossTileID]){const rr=this.prevPlacement.variableOffsets[ze.crossTileID];On.indexOf(rr.anchor)>0&&(On=On.filter(Qo=>Qo!==rr.anchor),On.unshift(rr.anchor))}const Zi=(rr,Qo,Wi)=>{const sh=rr.x2-rr.x1,ma=rr.y2-rr.y1,Hs=ze.textBoxScale,ah=Se&&"never"===ye?Qo:null;let xs={box:[],offscreen:!1};const wd="never"!==ae?2*On.length:On.length;for(let Mr=0;Mr=On.length?ae:"never",ze,y,Wi,ah,Ii);if(tl&&(xs=tl.placedGlyphBoxes,xs&&xs.box&&xs.box.length)){Pt=!0,In=tl.shift;break}}return xs};dr(()=>Zi(Jo,ft.iconBox,b.WritingMode.horizontal),()=>{const rr=ft.verticalTextBox;return y.allowVerticalPlacement&&!(An&&An.box&&An.box.length)&&ze.numVerticalGlyphVertices>0&&rr?Zi(rr,ft.verticalIconBox,b.WritingMode.vertical):{box:null,offscreen:null}}),An&&(Pt=An.box,mt=An.offscreen);const Jr=Fr(An&&An.box);if(!Pt&&this.prevPlacement){const rr=this.prevPlacement.variableOffsets[ze.crossTileID];rr&&(this.variableOffsets[ze.crossTileID]=rr,this.markUsedJustification(y,rr.anchor,ze,Jr))}}else{const On=(Zi,Jr)=>{const rr=this.collisionIndex.placeCollisionBox(Zi,ae,R,S,Q.predicate,Ii);return rr&&rr.box&&rr.box.length&&(this.markUsedOrientation(y,Jr,ze),this.placedOrientations[ze.crossTileID]=Jr),rr};dr(()=>On(Jo,b.WritingMode.horizontal),()=>{const Zi=ft.verticalTextBox;return y.allowVerticalPlacement&&ze.numVerticalGlyphVertices>0&&Zi?On(Zi,b.WritingMode.vertical):{box:null,offscreen:null}}),Fr(An&&An.box&&An.box.length)}}if(rn=An,Pt=rn&&rn.box&&rn.box.length>0,mt=rn&&rn.offscreen,ze.useRuntimeCollisionCircles){const Fr=y.text.placedSymbolArray.get(ze.centerJustifiedTextSymbolIndex),dr=b.evaluateSizeForFeature(y.textSizeData,j,Fr),On=w.get("text-padding");Fn=this.collisionIndex.placeCollisionCircles(ae,Fr,y.lineVertexArray,y.glyphOffsetArray,dr,S,I,k,m,De,Q.predicate,ze.collisionCircleDiameter,On,Ii),Fn.circles.length&&Fn.collisionDetected&&!m&&b.warnOnce("Collisions detected, but collision boxes are not shown"),Pt=_e||Fn.circles.length>0&&!Fn.collisionDetected,mt=mt&&Fn.offscreen}if(ft.iconFeatureIndex&&(vr=ft.iconFeatureIndex),ft.iconBox){const Fr=dr=>{const On=Se&&In?an(dr,In.x,In.y,we,De,this.transform.angle):dr;return this.collisionIndex.placeCollisionBox(On,ye,R,S,Q.predicate,Ii)};Ht&&Ht.box&&Ht.box.length&&ft.verticalIconBox?(yn=Fr(ft.verticalIconBox),Nt=yn.box.length>0):(yn=Fr(ft.iconBox),Nt=yn.box.length>0),mt=mt&&yn.offscreen}const Oo=ee||0===ze.numHorizontalGlyphVertices&&0===ze.numVerticalGlyphVertices,Wl=Y||0===ze.numIconVertices;if(Oo||Wl?Wl?Oo||(Nt=Nt&&Pt):Pt=Nt&&Pt:Nt=Pt=Nt&&Pt,Pt&&rn&&rn.box&&this.collisionIndex.insertCollisionBox(rn.box,ae,w.get("text-ignore-placement"),y.bucketInstanceId,Ht&&Ht.box&&Fo?Fo:yo,Q.ID),Nt&&yn&&this.collisionIndex.insertCollisionBox(yn.box,ye,w.get("icon-ignore-placement"),y.bucketInstanceId,vr,Q.ID),Fn&&(Pt&&this.collisionIndex.insertCollisionCircles(Fn.circles,ae,w.get("text-ignore-placement"),y.bucketInstanceId,yo,Q.ID),m)){const Fr=y.bucketInstanceId;let dr=this.collisionCircleArrays[Fr];void 0===dr&&(dr=this.collisionCircleArrays[Fr]=new xt);for(let On=0;On=0;--ft){const Pt=ze[ft];Ne(y.symbolInstances.get(Pt),y.collisionArrays[Pt])}}else for(let ze=s.symbolInstanceStart;ze=0&&(s.text.placedSymbolArray.get(I).crossTileID=w>=0&&I!==w?0:m.crossTileID)}markUsedOrientation(s,h,m){const y=h===b.WritingMode.horizontal||h===b.WritingMode.horizontalOnly?h:0,w=h===b.WritingMode.vertical?h:0,S=[m.leftJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.rightJustifiedTextSymbolIndex];for(const I of S)s.text.placedSymbolArray.get(I).placedOrientation=y;m.verticalPlacedTextSymbolIndex&&(s.text.placedSymbolArray.get(m.verticalPlacedTextSymbolIndex).placedOrientation=w)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let m=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const y=h?h.symbolFadeChange(s):1,w=h?h.opacities:{},S=h?h.variableOffsets:{},I=h?h.placedOrientations:{};for(const k in this.placements){const R=this.placements[k],z=w[k];z?(this.opacities[k]=new ht(z,y,R.text,R.icon),m=m||R.text!==z.text.placed||R.icon!==z.icon.placed):(this.opacities[k]=new ht(null,y,R.text,R.icon,R.skipFade),m=m||R.text||R.icon)}for(const k in w){const R=w[k];if(!this.opacities[k]){const z=new ht(R,y,!1,!1);z.isHidden()||(this.opacities[k]=z,m=m||R.text.placed||R.icon.placed)}}for(const k in S)this.variableOffsets[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.variableOffsets[k]=S[k]);for(const k in I)this.placedOrientations[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.placedOrientations[k]=I[k]);if(h&&void 0===h.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");m?this.lastPlacementChangeTime=s:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:s)}updateLayerOpacities(s,h){const m={};for(const y of h){const w=y.getBucket(s);w&&y.latestFeatureIndex&&s.id===w.layerIds[0]&&this.updateBucketOpacities(w,m,y.collisionBoxArray)}}updateBucketOpacities(s,h,m){s.hasTextData()&&(s.text.opacityVertexArray.clear(),s.text.hasVisibleVertices=!1),s.hasIconData()&&(s.icon.opacityVertexArray.clear(),s.icon.hasVisibleVertices=!1),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();const y=s.layers[0].layout,w=new ht(null,0,!1,!1,!0),S=y.get("text-allow-overlap"),I=y.get("icon-allow-overlap"),k=y.get("text-variable-anchor"),R="map"===y.get("text-rotation-alignment"),z="map"===y.get("text-pitch-alignment"),L="none"!==y.get("icon-text-fit"),j=new ht(null,0,S&&(I||!s.hasIconData()||y.get("icon-optional")),I&&(S||!s.hasTextData()||y.get("text-optional")),!0);!s.collisionArrays&&m&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(m);const Q=(ee,Y,ae)=>{for(let _e=0;_e0,De=this.placedOrientations[Y.crossTileID],Se=De===b.WritingMode.vertical,ke=De===b.WritingMode.horizontal||De===b.WritingMode.horizontalOnly;if(ae>0||_e>0){const Be=$a(ie.text);Q(s.text,ae,Se?sa:Be),Q(s.text,_e,ke?sa:Be);const Le=ie.text.isHidden();[Y.rightJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.leftJustifiedTextSymbolIndex].forEach(ft=>{ft>=0&&(s.text.placedSymbolArray.get(ft).hidden=Le||Se?1:0)}),Y.verticalPlacedTextSymbolIndex>=0&&(s.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).hidden=Le||ke?1:0);const Ne=this.variableOffsets[Y.crossTileID];Ne&&this.markUsedJustification(s,Ne.anchor,Y,De);const ze=this.placedOrientations[Y.crossTileID];ze&&(this.markUsedJustification(s,"left",Y,ze),this.markUsedOrientation(s,ze,Y))}if(we){const Be=$a(ie.icon),Le=!(L&&Y.verticalPlacedIconSymbolIndex&&Se);Y.placedIconSymbolIndex>=0&&(Q(s.icon,Y.numIconVertices,Le?Be:sa),s.icon.placedSymbolArray.get(Y.placedIconSymbolIndex).hidden=ie.icon.isHidden()),Y.verticalPlacedIconSymbolIndex>=0&&(Q(s.icon,Y.numVerticalIconVertices,Le?sa:Be),s.icon.placedSymbolArray.get(Y.verticalPlacedIconSymbolIndex).hidden=ie.icon.isHidden())}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){const Be=s.collisionArrays[ee];if(Be){let Le=new b.pointGeometry(0,0);if(Be.textBox||Be.verticalTextBox){let ze=!0;if(k){const ft=this.variableOffsets[ye];ft?(Le=sn(ft.anchor,ft.width,ft.height,ft.textOffset,ft.textBoxScale),R&&Le._rotate(z?this.transform.angle:-this.transform.angle)):ze=!1}Be.textBox&&lr(s.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||Se,Le.x,Le.y),Be.verticalTextBox&&lr(s.textCollisionBox.collisionVertexArray,ie.text.placed,!ze||ke,Le.x,Le.y)}const Ne=Boolean(!ke&&Be.verticalIconBox);Be.iconBox&&lr(s.iconCollisionBox.collisionVertexArray,ie.icon.placed,Ne,L?Le.x:0,L?Le.y:0),Be.verticalIconBox&&lr(s.iconCollisionBox.collisionVertexArray,ie.icon.placed,!Ne,L?Le.x:0,L?Le.y:0)}}}if(s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.text.opacityVertexArray.length!==s.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${s.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${s.text.layoutVertexArray.length}) / 4`);if(s.icon.opacityVertexArray.length!==s.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${s.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${s.icon.layoutVertexArray.length}) / 4`);if(s.bucketInstanceId in this.collisionCircleArrays){const ee=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=ee.invProjMatrix,s.placementViewportMatrix=ee.viewportMatrix,s.collisionCircleArray=ee.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return 0===this.fadeDuration?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTimes}setStale(){this.stale=!0}}function lr(g,s,h,m,y){g.emplaceBack(s?1:0,h?1:0,m||0,y||0),g.emplaceBack(s?1:0,h?1:0,m||0,y||0),g.emplaceBack(s?1:0,h?1:0,m||0,y||0),g.emplaceBack(s?1:0,h?1:0,m||0,y||0)}const ai=Math.pow(2,25),Pr=Math.pow(2,24),Va=Math.pow(2,17),kf=Math.pow(2,16),Pf=Math.pow(2,9),Ua=Math.pow(2,8),Fu=Math.pow(2,1);function $a(g){if(0===g.opacity&&!g.placed)return 0;if(1===g.opacity&&g.placed)return 4294967295;const s=g.placed?1:0,h=Math.floor(127*g.opacity);return h*ai+s*Pr+h*Va+s*kf+h*Pf+s*Ua+h*Fu+s}const sa=0;class Ou{constructor(s){this._sortAcrossTiles="viewport-y"!==s.layout.get("symbol-z-order")&&!s.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(s,h,m,y,w){const S=this._bucketParts;for(;this._currentTileIndexI.sortKey-k.sortKey));this._currentPartIndex{const S=b.exported.now()-y;return!this._forceFullPlacement&&S>2};for(;this._currentPlacementIndex>=0;){const S=h[s[this._currentPlacementIndex]],I=this.placement.collisionIndex.transform.zoom;if("symbol"===S.type&&(!S.minzoom||S.minzoom<=I)&&(!S.maxzoom||S.maxzoom>I)){if(this._inProgressLayer||(this._inProgressLayer=new Ou(S)),this._inProgressLayer.continuePlacement(m[S.source],this.placement,this._showCollisionBoxes,S,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}const Ol=512/b.EXTENT/2;class Zh{constructor(s,h,m){this.tileID=s,this.bucketInstanceId=m,this._symbolsByKey={};const y=new Map;for(let w=0;w({x:Math.floor(k.anchorX*Ol),y:Math.floor(k.anchorY*Ol)})),crossTileIDs:S.map(k=>k.crossTileID)};if(I.positions.length>128){const k=new b.KDBush(I.positions,R=>R.x,R=>R.y,16,Uint16Array);delete k.points,delete I.positions,I.index=k}this._symbolsByKey[w]=I}}getScaledCoordinates(s,h){const{x:m,y,z:w}=this.tileID.canonical,{x:S,y:I,z:k}=h.canonical,R=Ol/Math.pow(2,k-w),z=(I*b.EXTENT+s.anchorY)*R,L=y*b.EXTENT*Ol;return{x:Math.floor((S*b.EXTENT+s.anchorX)*R-m*b.EXTENT*Ol),y:Math.floor(z-L)}}findMatches(s,h,m){const y=this.tileID.canonical.zs)}}class Ll{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class zn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(s){const h=Math.round((s-this.lng)/360);if(0!==h)for(const m in this.indexes){const y=this.indexes[m],w={};for(const S in y){const I=y[S];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+h),w[I.tileID.key]=I}this.indexes[m]=w}this.lng=s}addBucket(s,h,m){if(this.indexes[s.overscaledZ]&&this.indexes[s.overscaledZ][s.key]){if(this.indexes[s.overscaledZ][s.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(s.overscaledZ,this.indexes[s.overscaledZ][s.key])}for(let w=0;ws.overscaledZ)for(const I in S){const k=S[I];k.tileID.isChildOf(s)&&k.findMatches(h.symbolInstances,s,y)}else{const I=S[s.scaledTo(Number(w)).key];I&&I.findMatches(h.symbolInstances,s,y)}}for(let w=0;w{h[m]=!0});for(const m in this.layerIndexes)h[m]||delete this.layerIndexes[m]}}const Mn=(g,s)=>b.emitValidationErrors(g,s&&s.filter(h=>"source.canvas"!==h.identifier)),Lu=b.pick(pn,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Rf=b.pick(pn,["setCenter","setZoom","setBearing","setPitch"]),Jn=function(){const g={},s=b.spec.$version;for(const h in b.spec.$root){const m=b.spec.$root[h];if(m.required){let y=null;y="version"===h?s:"array"===m.type?[]:{},null!=y&&(g[h]=y)}}return g}();class Mt extends b.Evented{constructor(s,h={}){super(),this.map=s,this.dispatcher=new pi(Fc(),this,s._getMapId()),this.imageManager=new It,this.imageManager.setEventedParent(this),this.glyphManager=new Bn(s._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Rc(256,512),this.crossTileSymbolIndex=new Kn,this._spritesImagesIds={},this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new b.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",b.getReferrer());const m=this;this._rtlTextPluginCallback=Mt.registerForPluginStateChange(y=>{m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},(w,S)=>{if(b.triggerPluginCompletionEvent(w),S&&S.every(I=>I))for(const I in m.sourceCaches)m.sourceCaches[I].reload()})}),this.on("data",y=>{if("source"!==y.dataType||"metadata"!==y.sourceDataType)return;const w=this.sourceCaches[y.sourceId];if(!w)return;const S=w.getSource();if(S&&S.vectorLayerIds)for(const I in this._layers){const k=this._layers[I];k.source===S.id&&this._validateLayer(k)}})}loadURL(s,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),h.validate="boolean"!=typeof h.validate||h.validate;const y=this.map._requestManager.transformRequest(s,fn.Style);this._request=b.getJSON(y,(w,S)=>{this._request=null,w?this.fire(new b.ErrorEvent(w)):S&&this._load(S,h,m)})}loadJSON(s,h={},m){this.fire(new b.Event("dataloading",{dataType:"style"})),this._request=b.exported.frame(()=>{this._request=null,h.validate=!1!==h.validate,this._load(s,h,m)})}loadEmpty(){this.fire(new b.Event("dataloading",{dataType:"style"})),this._load(Jn,{validate:!1})}_load(s,h,m){const y=h.transformStyle?h.transformStyle(m,s):s;if(h.validate&&Mn(this,b.validateStyle(y)))return;this._loaded=!0,this.stylesheet=y;for(const S in y.sources)this.addSource(S,y.sources[S],{validate:!1});y.sprite?this._loadSprite(y.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(y.glyphs);const w=Rl(this.stylesheet.layers);this._order=w.map(S=>S.id),this._layers={},this._serializedLayers={};for(let S of w)S=b.createStyleLayer(S),S.setEventedParent(this,{layer:{id:S.id}}),this._layers[S.id]=S,this._serializedLayers[S.id]=S.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Oa(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new b.Event("data",{dataType:"style"})),this.fire(new b.Event("style.load"))}_loadSprite(s,h=!1,m){this.imageManager.setLoaded(!1),this._spriteRequest=function(y,w,S,I){const k=hs(y),R=S>1?"@2x":"";let z;const L=[],j=[],Q={},ee={};for(const{id:ae,url:_e}of k){const ye=L.push(b.getJSON(w.transformRequest(w.normalizeSpriteURL(_e,R,".json"),fn.SpriteJSON),(we,De)=>{L.splice(ye,1),z||(z=we,Q[ae]=De,Y())})),ie=j.push(si.getImage(w.transformRequest(w.normalizeSpriteURL(_e,R,".png"),fn.SpriteImage),(we,De)=>{j.splice(ie,1),z||(z=we,ee[ae]=De,Y())}))}function Y(){const ae=Object.values(Q).length,_e=Object.values(ee).length;if(z)I(z);else if(k.length===ae&&ae===_e){const ye={};for(const ie in Q){ye[ie]={};const we=b.exported.getImageCanvasContext(ee[ie]),De=Q[ie];for(const Se in De){const{width:ke,height:Be,x:Le,y:Ne,sdf:ze,pixelRatio:ft,stretchX:Pt,stretchY:Nt,content:mt}=De[Se];ye[ie][Se]={data:null,pixelRatio:ft,sdf:ze,stretchX:Pt,stretchY:Nt,content:mt,spriteData:{width:ke,height:Be,x:Le,y:Ne,context:we}}}}I(null,ye)}}return{cancel(){if(L.length)for(const ae of L)ae.cancel(),L.splice(L.indexOf(ae),1);if(j.length)for(const ae of j)ae.cancel(),j.splice(j.indexOf(ae),1)}}}(s,this.map._requestManager,this.map.getPixelRatio(),(y,w)=>{if(this._spriteRequest=null,y)this.fire(new b.ErrorEvent(y));else if(w)for(const S in w){this._spritesImagesIds[S]=[];const I=this._spritesImagesIds[S]?this._spritesImagesIds[S].filter(k=>!(k in w)):[];for(const k of I)this.imageManager.removeImage(k),this._changedImages[k]=!0;for(const k in w[S]){const R="default"===S?k:`${S}:${k}`;this._spritesImagesIds[S].push(R),R in this.imageManager.images?this.imageManager.updateImage(R,w[S][k],!1):this.imageManager.addImage(R,w[S][k]),h&&(this._changedImages[R]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"})),m&&m(y)})}_unloadSprite(){for(const s of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(s),this._changedImages[s]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}_validateLayer(s){const h=this.sourceCaches[s.source];if(!h)return;const m=s.sourceLayer;if(!m)return;const y=h.getSource();("geojson"===y.type||y.vectorLayerIds&&-1===y.vectorLayerIds.indexOf(m))&&this.fire(new b.ErrorEvent(new Error(`Source layer "${m}" does not exist on source "${y.id}" as specified by style layer "${s.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const s in this.sourceCaches)if(!this.sourceCaches[s].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(s){const h=[];for(const m of s){const y=this._layers[m];"custom"!==y.type&&h.push(y.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const s in this.sourceCaches)if(this.sourceCaches[s].hasTransition())return!0;for(const s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(s){if(!this._loaded)return;const h=this._changed;if(this._changed){const y=Object.keys(this._updatedLayers),w=Object.keys(this._removedLayers);(y.length||w.length)&&this._updateWorkerLayers(y,w);for(const S in this._updatedSources){const I=this._updatedSources[S];if("reload"===I)this._reloadSource(S);else{if("clear"!==I)throw new Error(`Invalid action ${I}`);this._clearSource(S)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const S in this._updatedPaintProps)this._layers[S].updateTransitions(s);this.light.updateTransitions(s),this._resetUpdates()}const m={};for(const y in this.sourceCaches){const w=this.sourceCaches[y];m[y]=w.used,w.used=!1}for(const y of this._order){const w=this._layers[y];w.recalculate(s,this._availableImages),!w.isHidden(s.zoom)&&w.source&&(this.sourceCaches[w.source].used=!0)}for(const y in m){const w=this.sourceCaches[y];m[y]!==w.used&&w.fire(new b.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:y}))}this.light.recalculate(s),this.z=s.zoom,h&&this.fire(new b.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const s=Object.keys(this._changedImages);if(s.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],s);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(s,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(s),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(s,h={}){if(this._checkLoaded(),s=h.transformStyle?h.transformStyle(this.serialize(),s):s,Mn(this,b.validateStyle(s)))return!1;(s=b.clone$1(s)).layers=Rl(s.layers);const m=function(w,S){if(!w)return[{command:pn.setStyle,args:[S]}];let I=[];try{if(!Zt(w.version,S.version))return[{command:pn.setStyle,args:[S]}];Zt(w.center,S.center)||I.push({command:pn.setCenter,args:[S.center]}),Zt(w.zoom,S.zoom)||I.push({command:pn.setZoom,args:[S.zoom]}),Zt(w.bearing,S.bearing)||I.push({command:pn.setBearing,args:[S.bearing]}),Zt(w.pitch,S.pitch)||I.push({command:pn.setPitch,args:[S.pitch]}),Zt(w.sprite,S.sprite)||I.push({command:pn.setSprite,args:[S.sprite]}),Zt(w.glyphs,S.glyphs)||I.push({command:pn.setGlyphs,args:[S.glyphs]}),Zt(w.transition,S.transition)||I.push({command:pn.setTransition,args:[S.transition]}),Zt(w.light,S.light)||I.push({command:pn.setLight,args:[S.light]});const k={},R=[];!function(L,j,Q,ee){let Y;for(Y in j=j||{},L=L||{})Object.prototype.hasOwnProperty.call(L,Y)&&(Object.prototype.hasOwnProperty.call(j,Y)||Oc(Y,Q,ee));for(Y in j)Object.prototype.hasOwnProperty.call(j,Y)&&(Object.prototype.hasOwnProperty.call(L,Y)?Zt(L[Y],j[Y])||("geojson"===L[Y].type&&"geojson"===j[Y].type&&Ru(L,j,Y)?Q.push({command:pn.setGeoJSONSourceData,args:[Y,j[Y].data]}):za(Y,j,Q,ee)):ia(Y,j,Q))}(w.sources,S.sources,R,k);const z=[];w.layers&&w.layers.forEach(L=>{k[L.source]?I.push({command:pn.removeLayer,args:[L.id]}):z.push(L)}),I=I.concat(R),function(L,j,Q){j=j||[];const ee=(L=L||[]).map(Ba),Y=j.map(Ba),ae=L.reduce(Sn,{}),_e=j.reduce(Sn,{}),ye=ee.slice(),ie=Object.create(null);let we,De,Se,ke,Be,Le,Ne;for(we=0,De=0;we!(w.command in Rf));if(0===m.length)return!1;const y=m.filter(w=>!(w.command in Lu));if(y.length>0)throw new Error(`Unimplemented: ${y.map(w=>w.command).join(", ")}.`);return m.forEach(w=>{"setTransition"!==w.command&&this[w.command].apply(this,w.args)}),this.stylesheet=s,!0}addImage(s,h){if(this.getImage(s))return this.fire(new b.ErrorEvent(new Error(`An image named "${s}" already exists.`)));this.imageManager.addImage(s,h),this._afterImageUpdated(s)}updateImage(s,h){this.imageManager.updateImage(s,h)}getImage(s){return this.imageManager.getImage(s)}removeImage(s){if(!this.getImage(s))return this.fire(new b.ErrorEvent(new Error(`An image named "${s}" does not exist.`)));this.imageManager.removeImage(s),this._afterImageUpdated(s)}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(),this._changedImages[s]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(s,h,m={}){if(this._checkLoaded(),void 0!==this.sourceCaches[s])throw new Error(`Source "${s}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(b.validateStyle.source,`sources.${s}`,h,null,m))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const y=this.sourceCaches[s]=new At(s,h,this.dispatcher);y.style=this,y.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:y.serialize(),sourceId:s})),y.onAdd(this.map),this._changed=!0}removeSource(s){if(this._checkLoaded(),void 0===this.sourceCaches[s])throw new Error("There is no source with this ID");for(const m in this._layers)if(this._layers[m].source===s)return this.fire(new b.ErrorEvent(new Error(`Source "${s}" cannot be removed while layer "${m}" is using it.`)));const h=this.sourceCaches[s];delete this.sourceCaches[s],delete this._updatedSources[s],h.fire(new b.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:s})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(s,h){if(this._checkLoaded(),void 0===this.sourceCaches[s])throw new Error(`There is no source with this ID=${s}`);const m=this.sourceCaches[s].getSource();if("geojson"!==m.type)throw new Error(`geojsonSource.type is ${m.type}, which is !== 'geojson`);m.setData(h),this._changed=!0}getSource(s){return this.sourceCaches[s]&&this.sourceCaches[s].getSource()}addLayer(s,h,m={}){this._checkLoaded();const y=s.id;if(this.getLayer(y))return void this.fire(new b.ErrorEvent(new Error(`Layer "${y}" already exists on this map.`)));let w;if("custom"===s.type){if(Mn(this,b.validateCustomStyleLayer(s)))return;w=b.createStyleLayer(s)}else{if("object"==typeof s.source&&(this.addSource(y,s.source),s=b.clone$1(s),s=b.extend(s,{source:y})),this._validate(b.validateStyle.layer,`layers.${y}`,s,{arrayIndex:-1},m))return;w=b.createStyleLayer(s),this._validateLayer(w),w.setEventedParent(this,{layer:{id:y}}),this._serializedLayers[w.id]=w.serialize()}const S=h?this._order.indexOf(h):this._order.length;if(h&&-1===S)this.fire(new b.ErrorEvent(new Error(`Cannot add layer "${y}" before non-existing layer "${h}".`)));else{if(this._order.splice(S,0,y),this._layerOrderChanged=!0,this._layers[y]=w,this._removedLayers[y]&&w.source&&"custom"!==w.type){const I=this._removedLayers[y];delete this._removedLayers[y],I.type!==w.type?this._updatedSources[w.source]="clear":(this._updatedSources[w.source]="reload",this.sourceCaches[w.source].pause())}this._updateLayer(w),w.onAdd&&w.onAdd(this.map)}}moveLayer(s,h){if(this._checkLoaded(),this._changed=!0,!this._layers[s])return void this.fire(new b.ErrorEvent(new Error(`The layer '${s}' does not exist in the map's style and cannot be moved.`)));if(s===h)return;const m=this._order.indexOf(s);this._order.splice(m,1);const y=h?this._order.indexOf(h):this._order.length;h&&-1===y?this.fire(new b.ErrorEvent(new Error(`Cannot move layer "${s}" before non-existing layer "${h}".`))):(this._order.splice(y,0,s),this._layerOrderChanged=!0)}removeLayer(s){this._checkLoaded();const h=this._layers[s];if(!h)return void this.fire(new b.ErrorEvent(new Error(`Cannot remove non-existing layer "${s}".`)));h.setEventedParent(null);const m=this._order.indexOf(s);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[s]=h,delete this._layers[s],delete this._serializedLayers[s],delete this._updatedLayers[s],delete this._updatedPaintProps[s],h.onRemove&&h.onRemove(this.map)}getLayer(s){return this._layers[s]}hasLayer(s){return s in this._layers}setLayerZoomRange(s,h,m){this._checkLoaded();const y=this.getLayer(s);y?y.minzoom===h&&y.maxzoom===m||(null!=h&&(y.minzoom=h),null!=m&&(y.maxzoom=m),this._updateLayer(y)):this.fire(new b.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${s}".`)))}setFilter(s,h,m={}){this._checkLoaded();const y=this.getLayer(s);if(y){if(!Zt(y.filter,h))return null==h?(y.filter=void 0,void this._updateLayer(y)):void(this._validate(b.validateStyle.filter,`layers.${y.id}.filter`,h,null,m)||(y.filter=b.clone$1(h),this._updateLayer(y)))}else this.fire(new b.ErrorEvent(new Error(`Cannot filter non-existing layer "${s}".`)))}getFilter(s){return b.clone$1(this.getLayer(s).filter)}setLayoutProperty(s,h,m,y={}){this._checkLoaded();const w=this.getLayer(s);w?Zt(w.getLayoutProperty(h),m)||(w.setLayoutProperty(h,m,y),this._updateLayer(w)):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${s}".`)))}getLayoutProperty(s,h){const m=this.getLayer(s);if(m)return m.getLayoutProperty(h);this.fire(new b.ErrorEvent(new Error(`Cannot get style of non-existing layer "${s}".`)))}setPaintProperty(s,h,m,y={}){this._checkLoaded();const w=this.getLayer(s);w?Zt(w.getPaintProperty(h),m)||(w.setPaintProperty(h,m,y)&&this._updateLayer(w),this._changed=!0,this._updatedPaintProps[s]=!0):this.fire(new b.ErrorEvent(new Error(`Cannot style non-existing layer "${s}".`)))}getPaintProperty(s,h){return this.getLayer(s).getPaintProperty(h)}setFeatureState(s,h){this._checkLoaded();const m=s.source,y=s.sourceLayer,w=this.sourceCaches[m];if(void 0===w)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const S=w.getSource().type;"geojson"===S&&y?this.fire(new b.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==S||y?(void 0===s.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),w.setFeatureState(y,s.id,h)):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(s,h){this._checkLoaded();const m=s.source,y=this.sourceCaches[m];if(void 0===y)return void this.fire(new b.ErrorEvent(new Error(`The source '${m}' does not exist in the map's style.`)));const w=y.getSource().type,S="vector"===w?s.sourceLayer:void 0;"vector"!==w||S?h&&"string"!=typeof s.id&&"number"!=typeof s.id?this.fire(new b.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):y.removeFeatureState(S,s.id,h):this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(s){this._checkLoaded();const h=s.source,m=s.sourceLayer,y=this.sourceCaches[h];if(void 0!==y)return"vector"!==y.getSource().type||m?(void 0===s.id&&this.fire(new b.ErrorEvent(new Error("The feature id parameter must be provided."))),y.getFeatureState(m,s.id)):void this.fire(new b.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new b.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return b.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return b.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:b.mapObject(this.sourceCaches,s=>s.serialize()),layers:this._serializeLayers(this._order)},s=>void 0!==s)}_updateLayer(s){this._updatedLayers[s.id]=!0,s.source&&!this._updatedSources[s.source]&&"raster"!==this.sourceCaches[s.source].getSource().type&&(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(s){const h=S=>"fill-extrusion"===this._layers[S].type,m={},y=[];for(let S=this._order.length-1;S>=0;S--){const I=this._order[S];if(h(I)){m[I]=S;for(const k of s){const R=k[I];if(R)for(const z of R)y.push(z)}}}y.sort((S,I)=>I.intersectionZ-S.intersectionZ);const w=[];for(let S=this._order.length-1;S>=0;S--){const I=this._order[S];if(h(I))for(let k=y.length-1;k>=0;k--){const R=y[k].feature;if(m[R.layer.id]{const ke=ae.featureSortOrder;if(ke){const Be=ke.indexOf(De.featureIndex);return ke.indexOf(Se.featureIndex)-Be}return Se.featureIndex-De.featureIndex});for(const De of we)ie.push(De)}}for(const ae in Q)Q[ae].forEach(_e=>{const ye=_e.feature,ie=k[S[ae].source].getFeatureState(ye.layer["source-layer"],ye.id);ye.source=ye.layer.source,ye.layer["source-layer"]&&(ye.sourceLayer=ye.layer["source-layer"]),ye.state=ie});return Q}(this._layers,this._serializedLayers,this.sourceCaches,s,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(w)}querySourceFeatures(s,h){h&&h.filter&&this._validate(b.validateStyle.filter,"querySourceFeatures.filter",h.filter,null,h);const m=this.sourceCaches[s];return m?function(y,w){const S=y.getRenderableIds().map(R=>y.getTileByID(R)),I=[],k={};for(let R=0;Rj.getTileByID(Q)).sort((Q,ee)=>ee.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(ee.tileID)?-1:1))}const L=this.crossTileSymbolIndex.addLayer(z,k[z.source],s.center.lng);S=S||L}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((w=w||this._layerOrderChanged||0===m)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(b.exported.now(),s.zoom))&&(this.pauseablePlacement=new Cr(s,this.map.terrain,this._order,w,h,m,y,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,k),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(b.exported.now()),I=!0),S&&this.pauseablePlacement.placement.setStale()),I||S)for(const R of this._order){const z=this._layers[R];"symbol"===z.type&&this.placement.updateLayerOpacities(z,k[z.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(b.exported.now())}_releaseSymbolFadeTiles(){for(const s in this.sourceCaches)this.sourceCaches[s].releaseSymbolFadeTiles()}getImages(s,h,m){this.imageManager.getImages(h.icons,m),this._updateTilesForChangedImages();const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,h.icons)}getGlyphs(s,h,m){this.glyphManager.getGlyphs(h.stacks,m);const y=this.sourceCaches[h.source];y&&y.setDependencies(h.tileID.key,h.type,[""])}getResource(s,h,m){return b.makeRequest(h,m)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(s,h={}){this._checkLoaded(),s&&this._validate(b.validateStyle.glyphs,"glyphs",s,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=s,this.glyphManager.entries={},this.glyphManager.setURL(s))}addSprite(s,h,m={},y){this._checkLoaded();const w=[{id:s,url:h}],S=[...hs(this.stylesheet.sprite),...w];this._validate(b.validateStyle.sprite,"sprite",S,null,m)||(this.stylesheet.sprite=S,this._loadSprite(w,!0,y))}removeSprite(s){this._checkLoaded();const h=hs(this.stylesheet.sprite);if(h.find(m=>m.id===s)){if(this._spritesImagesIds[s])for(const m of this._spritesImagesIds[s])this.imageManager.removeImage(m),this._changedImages[m]=!0;h.splice(h.findIndex(m=>m.id===s),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[s],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new b.Event("data",{dataType:"style"}))}else this.fire(new b.ErrorEvent(new Error(`Sprite "${s}" doesn't exists on this map.`)))}getSprite(){return hs(this.stylesheet.sprite)}setSprite(s,h={},m){this._checkLoaded(),s&&this._validate(b.validateStyle.sprite,"sprite",s,null,h)||(this.stylesheet.sprite=s,s?this._loadSprite(s,!0,m):(this._unloadSprite(),m(null)))}}Mt.getSourceType=function(g){return Pl[g]},Mt.setSourceType=function(g,s){Pl[g]=s},Mt.registerForPluginStateChange=b.registerForPluginStateChange;var Nl=b.createLayout([{name:"a_pos",type:"Int16",components:2}]),Ff="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const nt={prelude:wn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:wn("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wn("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying 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=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;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;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);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:wn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);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;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:wn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:wn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying 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:wn("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;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;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:wn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:wn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:wn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:wn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(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=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);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;}"),fillPattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);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:wn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:wn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(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=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;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 vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*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:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:wn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:wn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:wn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:wn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:wn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying 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=texture2D(u_image0,v_pos0);vec4 color1=texture2D(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:wn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);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:wn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float 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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;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:wn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);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=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;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:wn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Ff),terrainDepth:wn("varying 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() {gl_FragColor=pack(v_depth);}",Ff),terrainCoords:wn("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Ff)};function wn(g,s){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=s.match(/attribute ([\w]+) ([\w]+)/g),y=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=s.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),S=w?w.concat(y):y,I={};return{fragmentSource:g=g.replace(h,(k,R,z,L,j)=>(I[j]=!0,"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = u_${j};\n#endif\n`)),vertexSource:s=s.replace(h,(k,R,z,L,j)=>{const Q="float"===L?"vec2":"vec4",ee=j.match(/color/)?"color":Q;return I[j]?"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\nvarying ${z} ${L} ${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:"define"===R?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${z} ${Q} a_${j};\n#else\nuniform ${z} ${L} u_${j};\n#endif\n`:"vec4"===ee?`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = a_${j};\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n ${z} ${L} ${j} = unpack_mix_${ee}(a_${j}, u_${j}_t);\n#else\n ${z} ${L} ${j} = u_${j};\n#endif\n`}),staticAttributes:m,staticUniforms:S}}class $t{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(s,h,m,y,w,S,I,k,R){this.context=s;let z=this.boundPaintVertexBuffers.length!==y.length;for(let L=0;!z&&L>16,I>>16],u_pixel_coord_lower:[65535&S,65535&I]}}const Xh=(g,s,h,m)=>{const y=s.style.light,w=y.properties.get("position"),S=[w.x,w.y,w.z],I=(R=new b.ARRAY_TYPE(9),b.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,R);var R;"viewport"===y.properties.get("anchor")&&function(R,z){var L=Math.sin(z),j=Math.cos(z);R[0]=j,R[1]=L,R[2]=0,R[3]=-L,R[4]=j,R[5]=0,R[6]=0,R[7]=0,R[8]=1}(I,-s.transform.angle),function(R,z,L){var j=z[0],Q=z[1],ee=z[2];R[0]=j*L[0]+Q*L[3]+ee*L[6],R[1]=j*L[1]+Q*L[4]+ee*L[7],R[2]=j*L[2]+Q*L[5]+ee*L[8]}(S,S,I);const k=y.properties.get("color");return{u_matrix:g,u_lightpos:S,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[k.r,k.g,k.b],u_vertical_gradient:+h,u_opacity:m}},Nu=(g,s,h,m,y,w,S)=>b.extend(Xh(g,s,h,m),Of(w,s,S),{u_height_factor:-Math.pow(2,y.overscaledZ)/S.tileSize/8}),Yr=g=>({u_matrix:g}),Lc=(g,s,h,m)=>b.extend(Yr(g),Of(h,s,m)),Lf=(g,s)=>({u_matrix:g,u_world:s}),Io=(g,s,h,m,y)=>b.extend(Lc(g,s,h,m),{u_world:y}),Zo=(g,s,h,m)=>{const y=g.transform;let w,S;if("map"===m.paint.get("circle-pitch-alignment")){const I=Te(h,1,y.zoom);w=!0,S=[I,I]}else w=!1,S=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+("map"===m.paint.get("circle-pitch-scale")),u_matrix:g.translatePosMatrix(s.posMatrix,h,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_pitch_with_map:+w,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:S}},Yh=(g,s,h)=>{const m=Te(h,1,s.zoom),y=Math.pow(2,s.zoom-h.tileID.overscaledZ),w=h.tileID.overscaleFactor();return{u_matrix:g,u_camera_to_center_distance:s.cameraToCenterDistance,u_pixels_to_tile_units:m,u_extrude_scale:[s.pixelsToGLUnits[0]/(m*y),s.pixelsToGLUnits[1]/(m*y)],u_overscale_factor:w}},zu=(g,s,h=1)=>({u_matrix:g,u_color:s,u_overlay:0,u_overlay_scale:h}),Kh=g=>({u_matrix:g}),Nf=(g,s,h,m)=>({u_matrix:g,u_extrude_scale:Te(s,1,h),u_intensity:m});function Bu(g,s){const h=Math.pow(2,s.canonical.z),m=s.canonical.y;return[new b.MercatorCoordinate(0,m/h).toLngLat().lat,new b.MercatorCoordinate(0,(m+1)/h).toLngLat().lat]}const Vu=(g,s,h,m)=>{const y=g.transform;return{u_matrix:zl(g,s,h,m),u_ratio:1/Te(s,1,y.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/y.pixelsToGLUnits[0],1/y.pixelsToGLUnits[1]]}},Jh=(g,s,h,m,y)=>b.extend(Vu(g,s,h,y),{u_image:0,u_image_height:m}),Qh=(g,s,h,m,y)=>{const w=g.transform,S=Rn(s,w);return{u_matrix:zl(g,s,h,y),u_texsize:s.imageAtlasTexture.size,u_ratio:1/Te(s,1,w.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[S,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/w.pixelsToGLUnits[0],1/w.pixelsToGLUnits[1]]}},ji=(g,s,h,m,y,w)=>{const S=g.lineAtlas,I=Rn(s,g.transform),k="round"===h.layout.get("line-cap"),R=S.getDash(m.from,k),z=S.getDash(m.to,k),L=R.width*y.fromScale,j=z.width*y.toScale;return b.extend(Vu(g,s,h,w),{u_patternscale_a:[I/L,-R.height/2],u_patternscale_b:[I/j,-z.height/2],u_sdfgamma:S.width/(256*Math.min(L,j)*g.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:z.y,u_mix:y.t})};function Rn(g,s){return 1/Te(g,1,s.tileZoom)}function zl(g,s,h,m){return g.translatePosMatrix(m?m.posMatrix:s.tileID.posMatrix,s,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const M_=(g,s,h,m,y)=>{return{u_matrix:g,u_tl_parent:s,u_scale_parent:h,u_buffer_scale:1,u_fade_t:m.mix,u_opacity:m.opacity*y.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:y.paint.get("raster-brightness-min"),u_brightness_high:y.paint.get("raster-brightness-max"),u_saturation_factor:(S=y.paint.get("raster-saturation"),S>0?1-1/(1.001-S):-S),u_contrast_factor:(w=y.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:T_(y.paint.get("raster-hue-rotate"))};var w,S};function T_(g){g*=Math.PI/180;const s=Math.sin(g),h=Math.cos(g);return[(2*h+1)/3,(-Math.sqrt(3)*s-h+1)/3,(Math.sqrt(3)*s-h+1)/3]}const zt=(g,s,h,m,y,w,S,I,k,R)=>{const z=y.transform;return{u_is_size_zoom_constant:+("constant"===g||"source"===g),u_is_size_feature_constant:+("constant"===g||"camera"===g),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:z.width/z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:S,u_coord_matrix:I,u_is_text:+k,u_pitch_with_map:+m,u_texsize:R,u_texture:0}},zm=(g,s,h,m,y,w,S,I,k,R,z)=>{const L=y.transform;return b.extend(zt(g,s,h,m,y,w,S,I,k,R),{u_gamma_scale:m?Math.cos(L._pitch)*L.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:+z})},Di=(g,s,h,m,y,w,S,I,k,R)=>b.extend(zm(g,s,h,m,y,w,S,I,!0,k,!0),{u_texsize_icon:R,u_texture_icon:1}),Uu=(g,s,h)=>({u_matrix:g,u_opacity:s,u_color:h}),ed=(g,s,h,m,y,w)=>b.extend(function(S,I,k,R){const z=k.imageManager.getPattern(S.from.toString()),L=k.imageManager.getPattern(S.to.toString()),{width:j,height:Q}=k.imageManager.getPixelSize(),ee=Math.pow(2,R.tileID.overscaledZ),Y=R.tileSize*Math.pow(2,k.transform.tileZoom)/ee,ae=Y*(R.tileID.canonical.x+R.tileID.wrap*ee),_e=Y*R.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:L.tl,u_pattern_br_b:L.br,u_texsize:[j,Q],u_mix:I.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:L.displaySize,u_scale_a:I.fromScale,u_scale_b:I.toScale,u_tile_units_to_pixels:1/Te(R,1,k.transform.tileZoom),u_pixel_coord_upper:[ae>>16,_e>>16],u_pixel_coord_lower:[65535&ae,65535&_e]}}(m,w,h,y),{u_matrix:g,u_opacity:s}),Nc={fillExtrusion:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_lightpos:new b.Uniform3f(g,s.u_lightpos),u_lightintensity:new b.Uniform1f(g,s.u_lightintensity),u_lightcolor:new b.Uniform3f(g,s.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,s.u_vertical_gradient),u_opacity:new b.Uniform1f(g,s.u_opacity)}),fillExtrusionPattern:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_lightpos:new b.Uniform3f(g,s.u_lightpos),u_lightintensity:new b.Uniform1f(g,s.u_lightintensity),u_lightcolor:new b.Uniform3f(g,s.u_lightcolor),u_vertical_gradient:new b.Uniform1f(g,s.u_vertical_gradient),u_height_factor:new b.Uniform1f(g,s.u_height_factor),u_image:new b.Uniform1i(g,s.u_image),u_texsize:new b.Uniform2f(g,s.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,s.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,s.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,s.u_scale),u_fade:new b.Uniform1f(g,s.u_fade),u_opacity:new b.Uniform1f(g,s.u_opacity)}),fill:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix)}),fillPattern:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_image:new b.Uniform1i(g,s.u_image),u_texsize:new b.Uniform2f(g,s.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,s.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,s.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,s.u_scale),u_fade:new b.Uniform1f(g,s.u_fade)}),fillOutline:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_world:new b.Uniform2f(g,s.u_world)}),fillOutlinePattern:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_world:new b.Uniform2f(g,s.u_world),u_image:new b.Uniform1i(g,s.u_image),u_texsize:new b.Uniform2f(g,s.u_texsize),u_pixel_coord_upper:new b.Uniform2f(g,s.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,s.u_pixel_coord_lower),u_scale:new b.Uniform3f(g,s.u_scale),u_fade:new b.Uniform1f(g,s.u_fade)}),circle:(g,s)=>({u_camera_to_center_distance:new b.Uniform1f(g,s.u_camera_to_center_distance),u_scale_with_map:new b.Uniform1i(g,s.u_scale_with_map),u_pitch_with_map:new b.Uniform1i(g,s.u_pitch_with_map),u_extrude_scale:new b.Uniform2f(g,s.u_extrude_scale),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_matrix:new b.UniformMatrix4f(g,s.u_matrix)}),collisionBox:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_camera_to_center_distance:new b.Uniform1f(g,s.u_camera_to_center_distance),u_pixels_to_tile_units:new b.Uniform1f(g,s.u_pixels_to_tile_units),u_extrude_scale:new b.Uniform2f(g,s.u_extrude_scale),u_overscale_factor:new b.Uniform1f(g,s.u_overscale_factor)}),collisionCircle:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_inv_matrix:new b.UniformMatrix4f(g,s.u_inv_matrix),u_camera_to_center_distance:new b.Uniform1f(g,s.u_camera_to_center_distance),u_viewport_size:new b.Uniform2f(g,s.u_viewport_size)}),debug:(g,s)=>({u_color:new b.UniformColor(g,s.u_color),u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_overlay:new b.Uniform1i(g,s.u_overlay),u_overlay_scale:new b.Uniform1f(g,s.u_overlay_scale)}),clippingMask:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix)}),heatmap:(g,s)=>({u_extrude_scale:new b.Uniform1f(g,s.u_extrude_scale),u_intensity:new b.Uniform1f(g,s.u_intensity),u_matrix:new b.UniformMatrix4f(g,s.u_matrix)}),heatmapTexture:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_world:new b.Uniform2f(g,s.u_world),u_image:new b.Uniform1i(g,s.u_image),u_color_ramp:new b.Uniform1i(g,s.u_color_ramp),u_opacity:new b.Uniform1f(g,s.u_opacity)}),hillshade:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_image:new b.Uniform1i(g,s.u_image),u_latrange:new b.Uniform2f(g,s.u_latrange),u_light:new b.Uniform2f(g,s.u_light),u_shadow:new b.UniformColor(g,s.u_shadow),u_highlight:new b.UniformColor(g,s.u_highlight),u_accent:new b.UniformColor(g,s.u_accent)}),hillshadePrepare:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_image:new b.Uniform1i(g,s.u_image),u_dimension:new b.Uniform2f(g,s.u_dimension),u_zoom:new b.Uniform1f(g,s.u_zoom),u_unpack:new b.Uniform4f(g,s.u_unpack)}),line:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_ratio:new b.Uniform1f(g,s.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,s.u_units_to_pixels)}),lineGradient:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_ratio:new b.Uniform1f(g,s.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,s.u_units_to_pixels),u_image:new b.Uniform1i(g,s.u_image),u_image_height:new b.Uniform1f(g,s.u_image_height)}),linePattern:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_texsize:new b.Uniform2f(g,s.u_texsize),u_ratio:new b.Uniform1f(g,s.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_image:new b.Uniform1i(g,s.u_image),u_units_to_pixels:new b.Uniform2f(g,s.u_units_to_pixels),u_scale:new b.Uniform3f(g,s.u_scale),u_fade:new b.Uniform1f(g,s.u_fade)}),lineSDF:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_ratio:new b.Uniform1f(g,s.u_ratio),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_units_to_pixels:new b.Uniform2f(g,s.u_units_to_pixels),u_patternscale_a:new b.Uniform2f(g,s.u_patternscale_a),u_patternscale_b:new b.Uniform2f(g,s.u_patternscale_b),u_sdfgamma:new b.Uniform1f(g,s.u_sdfgamma),u_image:new b.Uniform1i(g,s.u_image),u_tex_y_a:new b.Uniform1f(g,s.u_tex_y_a),u_tex_y_b:new b.Uniform1f(g,s.u_tex_y_b),u_mix:new b.Uniform1f(g,s.u_mix)}),raster:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_tl_parent:new b.Uniform2f(g,s.u_tl_parent),u_scale_parent:new b.Uniform1f(g,s.u_scale_parent),u_buffer_scale:new b.Uniform1f(g,s.u_buffer_scale),u_fade_t:new b.Uniform1f(g,s.u_fade_t),u_opacity:new b.Uniform1f(g,s.u_opacity),u_image0:new b.Uniform1i(g,s.u_image0),u_image1:new b.Uniform1i(g,s.u_image1),u_brightness_low:new b.Uniform1f(g,s.u_brightness_low),u_brightness_high:new b.Uniform1f(g,s.u_brightness_high),u_saturation_factor:new b.Uniform1f(g,s.u_saturation_factor),u_contrast_factor:new b.Uniform1f(g,s.u_contrast_factor),u_spin_weights:new b.Uniform3f(g,s.u_spin_weights)}),symbolIcon:(g,s)=>({u_is_size_zoom_constant:new b.Uniform1i(g,s.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,s.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,s.u_size_t),u_size:new b.Uniform1f(g,s.u_size),u_camera_to_center_distance:new b.Uniform1f(g,s.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,s.u_pitch),u_rotate_symbol:new b.Uniform1i(g,s.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,s.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,s.u_fade_change),u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,s.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,s.u_coord_matrix),u_is_text:new b.Uniform1i(g,s.u_is_text),u_pitch_with_map:new b.Uniform1i(g,s.u_pitch_with_map),u_texsize:new b.Uniform2f(g,s.u_texsize),u_texture:new b.Uniform1i(g,s.u_texture)}),symbolSDF:(g,s)=>({u_is_size_zoom_constant:new b.Uniform1i(g,s.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,s.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,s.u_size_t),u_size:new b.Uniform1f(g,s.u_size),u_camera_to_center_distance:new b.Uniform1f(g,s.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,s.u_pitch),u_rotate_symbol:new b.Uniform1i(g,s.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,s.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,s.u_fade_change),u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,s.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,s.u_coord_matrix),u_is_text:new b.Uniform1i(g,s.u_is_text),u_pitch_with_map:new b.Uniform1i(g,s.u_pitch_with_map),u_texsize:new b.Uniform2f(g,s.u_texsize),u_texture:new b.Uniform1i(g,s.u_texture),u_gamma_scale:new b.Uniform1f(g,s.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,s.u_is_halo)}),symbolTextAndIcon:(g,s)=>({u_is_size_zoom_constant:new b.Uniform1i(g,s.u_is_size_zoom_constant),u_is_size_feature_constant:new b.Uniform1i(g,s.u_is_size_feature_constant),u_size_t:new b.Uniform1f(g,s.u_size_t),u_size:new b.Uniform1f(g,s.u_size),u_camera_to_center_distance:new b.Uniform1f(g,s.u_camera_to_center_distance),u_pitch:new b.Uniform1f(g,s.u_pitch),u_rotate_symbol:new b.Uniform1i(g,s.u_rotate_symbol),u_aspect_ratio:new b.Uniform1f(g,s.u_aspect_ratio),u_fade_change:new b.Uniform1f(g,s.u_fade_change),u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_label_plane_matrix:new b.UniformMatrix4f(g,s.u_label_plane_matrix),u_coord_matrix:new b.UniformMatrix4f(g,s.u_coord_matrix),u_is_text:new b.Uniform1i(g,s.u_is_text),u_pitch_with_map:new b.Uniform1i(g,s.u_pitch_with_map),u_texsize:new b.Uniform2f(g,s.u_texsize),u_texsize_icon:new b.Uniform2f(g,s.u_texsize_icon),u_texture:new b.Uniform1i(g,s.u_texture),u_texture_icon:new b.Uniform1i(g,s.u_texture_icon),u_gamma_scale:new b.Uniform1f(g,s.u_gamma_scale),u_device_pixel_ratio:new b.Uniform1f(g,s.u_device_pixel_ratio),u_is_halo:new b.Uniform1i(g,s.u_is_halo)}),background:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_opacity:new b.Uniform1f(g,s.u_opacity),u_color:new b.UniformColor(g,s.u_color)}),backgroundPattern:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_opacity:new b.Uniform1f(g,s.u_opacity),u_image:new b.Uniform1i(g,s.u_image),u_pattern_tl_a:new b.Uniform2f(g,s.u_pattern_tl_a),u_pattern_br_a:new b.Uniform2f(g,s.u_pattern_br_a),u_pattern_tl_b:new b.Uniform2f(g,s.u_pattern_tl_b),u_pattern_br_b:new b.Uniform2f(g,s.u_pattern_br_b),u_texsize:new b.Uniform2f(g,s.u_texsize),u_mix:new b.Uniform1f(g,s.u_mix),u_pattern_size_a:new b.Uniform2f(g,s.u_pattern_size_a),u_pattern_size_b:new b.Uniform2f(g,s.u_pattern_size_b),u_scale_a:new b.Uniform1f(g,s.u_scale_a),u_scale_b:new b.Uniform1f(g,s.u_scale_b),u_pixel_coord_upper:new b.Uniform2f(g,s.u_pixel_coord_upper),u_pixel_coord_lower:new b.Uniform2f(g,s.u_pixel_coord_lower),u_tile_units_to_pixels:new b.Uniform1f(g,s.u_tile_units_to_pixels)}),terrain:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_texture:new b.Uniform1i(g,s.u_texture),u_ele_delta:new b.Uniform1f(g,s.u_ele_delta)}),terrainDepth:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_ele_delta:new b.Uniform1f(g,s.u_ele_delta)}),terrainCoords:(g,s)=>({u_matrix:new b.UniformMatrix4f(g,s.u_matrix),u_texture:new b.Uniform1i(g,s.u_texture),u_terrain_coords_id:new b.Uniform1f(g,s.u_terrain_coords_id),u_ele_delta:new b.Uniform1f(g,s.u_ele_delta)})};class td{constructor(s,h,m){this.context=s;const y=s.gl;this.buffer=y.createBuffer(),this.dynamicDraw=Boolean(m),this.context.unbindVAO(),s.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(s){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,s.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const nd={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ja{constructor(s,h,m,y){this.length=h.length,this.attributes=m,this.itemSize=h.bytesPerElement,this.dynamicDraw=y,this.context=s;const w=s.gl;this.buffer=w.createBuffer(),s.bindVertexBuffer.set(this.buffer),w.bufferData(w.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?w.DYNAMIC_DRAW:w.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){if(s.length!==this.length)throw new Error(`Length of new data is ${s.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,s.arrayBuffer)}enableAttributes(s,h){for(let m=0;m0){const Ne=b.create(),ze=ke;b.mul(Ne,Se.placementInvProjMatrix,g.transform.glCoordMatrix),b.mul(Ne,Ne,Se.placementViewportMatrix),z.push({circleArray:Le,circleOffset:j,transform:ze,invTransform:Ne,coord:we}),L+=Le.length/4,j=L}Be&&R.draw(I,k.LINES,kt.disabled,cn.disabled,g.colorModeForRenderPass(),nn.disabled,Yh(ke,g.transform,De),g.style.map.terrain&&g.style.map.terrain.getTerrainData(we),h.id,Be.layoutVertexBuffer,Be.indexBuffer,Be.segments,null,g.transform.zoom,null,null,Be.collisionVertexBuffer)}if(!S||!z.length)return;const Q=g.useProgram("collisionCircle"),ee=new b.CollisionCircleLayoutArray;ee.resize(4*L),ee._trim();let Y=0;for(const ie of z)for(let we=0;we=0&&(ee[ae.associatedIconIndex]={shiftedAnchor:ft,angle:Pt})}else ue(ae.numGlyphs,j)}if(R){Q.clear();const Y=g.icon.placedSymbolArray;for(let ae=0;aeg.style.map.terrain.getElevation(Be,sh,ma):null,Wi="map"===h.layout.get("text-rotation-alignment");V(Ne,Be.posMatrix,g,y,Ii,Jo,ae,R,Wi,Qo)}const Fr=g.translatePosMatrix(Be.posMatrix,Le,w,S),dr=_e||y&&Se||Wl?cr:Ii,On=g.translatePosMatrix(Jo,Le,w,S,!0),Zi=Pt&&0!==h.paint.get(y?"text-halo-width":"icon-halo-width").constantOr(1);let Jr;Jr=Pt?Ne.iconsInText?Di(Nt.kind,An,ye,ae,g,Fr,dr,On,rn,Fo):zm(Nt.kind,An,ye,ae,g,Fr,dr,On,y,rn,!0):zt(Nt.kind,An,ye,ae,g,Fr,dr,On,y,rn);const rr={program:In,buffers:ze,uniformValues:Jr,atlasTexture:Fn,atlasTextureIcon:vr,atlasInterpolation:yn,atlasInterpolationIcon:yo,isSDF:Pt,hasHalo:Zi};if(ie&&Ne.canOverlap){we=!0;const Qo=ze.segments.get();for(const Wi of Qo)ke.push({segments:new b.SegmentVector([Wi]),sortKey:Wi.sortKey,state:rr,terrainData:Ht})}else ke.push({segments:ze.segments,sortKey:0,state:rr,terrainData:Ht})}we&&ke.sort((Be,Le)=>Be.sortKey-Le.sortKey);for(const Be of ke){const Le=Be.state;if(j.activeTexture.set(Q.TEXTURE0),Le.atlasTexture.bind(Le.atlasInterpolation,Q.CLAMP_TO_EDGE),Le.atlasTextureIcon&&(j.activeTexture.set(Q.TEXTURE1),Le.atlasTextureIcon&&Le.atlasTextureIcon.bind(Le.atlasInterpolationIcon,Q.CLAMP_TO_EDGE)),Le.isSDF){const Ne=Le.uniformValues;Le.hasHalo&&(Ne.u_is_halo=1,_r(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Ne,Be.terrainData)),Ne.u_is_halo=0}_r(Le.buffers,Be.segments,h,g,Le.program,De,z,L,Le.uniformValues,Be.terrainData)}}function _r(g,s,h,m,y,w,S,I,k,R){const z=m.context;y.draw(z,z.gl.TRIANGLES,w,S,I,nn.disabled,k,R,h.id,g.layoutVertexBuffer,g.indexBuffer,s,h.paint,m.transform.zoom,g.programConfigurations.get(h.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function Za(g,s,h,m,y){if(!h||!m||!m.imageAtlas)return;const w=m.imageAtlas.patternPositions;let S=w[h.to.toString()],I=w[h.from.toString()];if(!S||!I){const k=y.getPaintProperty(s);S=w[k],I=w[k]}S&&I&&g.setConstantPatternPositions(S,I)}function Wa(g,s,h,m,y,w,S){const I=g.context.gl,k="fill-pattern",R=h.paint.get(k),z=R&&R.constantOr(1),L=h.getCrossfadeParameters();let j,Q,ee,Y,ae;S?(Q=z&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",j=I.LINES):(Q=z?"fillPattern":"fill",j=I.TRIANGLES);const _e=R.constantOr(null);for(const ye of m){const ie=s.getTile(ye);if(z&&!ie.patternsLoaded())continue;const we=ie.getBucket(h);if(!we)continue;const De=we.programConfigurations.get(h.id),Se=g.useProgram(Q,De),ke=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ye);z&&(g.context.activeTexture.set(I.TEXTURE0),ie.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),De.updatePaintBuffers(L)),Za(De,k,_e,ie,h);const Be=ke?ye:null,Le=g.translatePosMatrix(Be?Be.posMatrix:ye.posMatrix,ie,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(S){Y=we.indexBuffer2,ae=we.segments2;const Ne=[I.drawingBufferWidth,I.drawingBufferHeight];ee="fillOutlinePattern"===Q&&z?Io(Le,g,L,ie,Ne):Lf(Le,Ne)}else Y=we.indexBuffer,ae=we.segments,ee=z?Lc(Le,g,L,ie):Yr(Le);Se.draw(g.context,j,y,g.stencilModeForClipping(ye),w,nn.disabled,ee,ke,h.id,we.layoutVertexBuffer,Y,ae,h.paint,g.transform.zoom,De)}}function Xt(g,s,h,m,y,w,S){const I=g.context,k=I.gl,R="fill-extrusion-pattern",z=h.paint.get(R),L=z.constantOr(1),j=h.getCrossfadeParameters(),Q=h.paint.get("fill-extrusion-opacity"),ee=z.constantOr(null);for(const Y of m){const ae=s.getTile(Y),_e=ae.getBucket(h);if(!_e)continue;const ye=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Y),ie=_e.programConfigurations.get(h.id),we=g.useProgram(L?"fillExtrusionPattern":"fillExtrusion",ie);L&&(g.context.activeTexture.set(k.TEXTURE0),ae.imageAtlasTexture.bind(k.LINEAR,k.CLAMP_TO_EDGE),ie.updatePaintBuffers(j)),Za(ie,R,ee,ae,h);const De=g.translatePosMatrix(Y.posMatrix,ae,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Se=h.paint.get("fill-extrusion-vertical-gradient"),ke=L?Nu(De,g,Se,Q,Y,j,ae):Xh(De,g,Se,Q);we.draw(I,I.gl.TRIANGLES,y,w,S,nn.backCCW,ke,ye,h.id,_e.layoutVertexBuffer,_e.indexBuffer,_e.segments,h.paint,g.transform.zoom,ie,g.style.map.terrain&&_e.centroidVertexBuffer)}}function Vc(g,s,h,m,y,w,S){const I=g.context,k=I.gl,R=h.fbo;if(!R)return;const z=g.useProgram("hillshade"),L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(s);I.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,R.colorAttachment.get()),z.draw(I,k.TRIANGLES,y,w,S,nn.disabled,((j,Q,ee,Y)=>{const ae=ee.paint.get("hillshade-shadow-color"),_e=ee.paint.get("hillshade-highlight-color"),ye=ee.paint.get("hillshade-accent-color");let ie=ee.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ee.paint.get("hillshade-illumination-anchor")&&(ie-=j.transform.angle);const we=!j.options.moving;return{u_matrix:Y?Y.posMatrix:j.transform.calculatePosMatrix(Q.tileID.toUnwrapped(),we),u_image:0,u_latrange:Bu(0,Q.tileID),u_light:[ee.paint.get("hillshade-exaggeration"),ie],u_shadow:ae,u_highlight:_e,u_accent:ye}})(g,h,m,L?s:null),L,m.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments)}function Xa(g,s,h,m,y,w){const S=g.context,I=S.gl,k=s.dem;if(k&&k.data){const R=k.dim,z=k.stride,L=k.getPixels();if(S.activeTexture.set(I.TEXTURE1),S.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||g.getTileTexture(z),s.demTexture){const Q=s.demTexture;Q.update(L,{premultiply:!1}),Q.bind(I.NEAREST,I.CLAMP_TO_EDGE)}else s.demTexture=new Gn(S,L,I.RGBA,{premultiply:!1}),s.demTexture.bind(I.NEAREST,I.CLAMP_TO_EDGE);S.activeTexture.set(I.TEXTURE0);let j=s.fbo;if(!j){const Q=new Gn(S,{width:R,height:R,data:null},I.RGBA);Q.bind(I.LINEAR,I.CLAMP_TO_EDGE),j=s.fbo=S.createFramebuffer(R,R,!0),j.colorAttachment.set(Q.texture)}S.bindFramebuffer.set(j.framebuffer),S.viewport.set([0,0,R,R]),g.useProgram("hillshadePrepare").draw(S,I.TRIANGLES,m,y,w,nn.disabled,((Q,ee)=>{const Y=ee.stride,ae=b.create();return b.ortho(ae,0,b.EXTENT,-b.EXTENT,0,0,1),b.translate(ae,ae,[0,-b.EXTENT,0]),{u_matrix:ae,u_image:1,u_dimension:[Y,Y],u_zoom:Q.overscaledZ,u_unpack:ee.getUnpackVector()}})(s.tileID,k),null,h.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments),s.needsHillshadePrepare=!1}}function Ya(g,s,h,m,y,w){const S=m.paint.get("raster-fade-duration");if(!w&&S>0){const I=b.exported.now(),k=(I-g.timeAdded)/S,R=s?(I-s.timeAdded)/S:-1,z=h.getSource(),L=y.coveringZoomLevel({tileSize:z.tileSize,roundZoom:z.roundZoom}),j=!s||Math.abs(s.tileID.overscaledZ-L)>Math.abs(g.tileID.overscaledZ-L),Q=j&&g.refreshedUponExpiration?1:b.clamp(j?k:1-R,0,1);return g.refreshedUponExpiration&&k>=1&&(g.refreshedUponExpiration=!1),s?{opacity:1,mix:1-Q}:{opacity:Q,mix:0}}return{opacity:1,mix:0}}const ha=new b.Color(1,0,0,1),ur=new b.Color(0,1,0,1),ho=new b.Color(0,0,1,1),Ka=new b.Color(1,0,1,1),Hr=new b.Color(0,1,1,1);function Yo(g,s,h,m){$n(g,0,s+h/2,g.transform.width,h,m)}function sd(g,s,h,m){$n(g,s-h/2,0,h,g.transform.height,m)}function $n(g,s,h,m,y,w){const S=g.context,I=S.gl;I.enable(I.SCISSOR_TEST),I.scissor(s*g.pixelRatio,h*g.pixelRatio,m*g.pixelRatio,y*g.pixelRatio),S.clear({color:w}),I.disable(I.SCISSOR_TEST)}function Um(g,s,h){const m=g.context,y=m.gl,w=h.posMatrix,S=g.useProgram("debug"),I=kt.disabled,k=cn.disabled,R=g.colorModeForRenderPass(),z="$debug",L=g.style.map.terrain&&g.style.map.terrain.getTerrainData(h);m.activeTexture.set(y.TEXTURE0),g.emptyTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE);const j=s.getTileByID(h.key).latestRawTileData,Q=Math.floor((j&&j.byteLength||0)/1024),ee=s.getTile(h).tileSize,Y=512/Math.min(ee,512)*(h.overscaledZ/g.transform.zoom)*.5;let ae=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(ae+=` => ${h.overscaledZ}`),function(_e,ye){_e.initDebugOverlayCanvas();const ie=_e.debugOverlayCanvas,we=_e.context.gl,De=_e.debugOverlayCanvas.getContext("2d");De.clearRect(0,0,ie.width,ie.height),De.shadowColor="white",De.shadowBlur=2,De.lineWidth=1.5,De.strokeStyle="white",De.textBaseline="top",De.font="bold 36px Open Sans, sans-serif",De.fillText(ye,5,5),De.strokeText(ye,5,5),_e.debugOverlayTexture.update(ie),_e.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}(g,`${ae} ${Q}kB`),S.draw(m,y.TRIANGLES,I,k,Lt.alphaBlended,nn.disabled,zu(w,b.Color.transparent,Y),null,z,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),S.draw(m,y.LINE_STRIP,I,k,R,nn.disabled,zu(w,b.Color.red),L,z,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function ad(g,s,h){const m=g.context,y=m.gl,w=g.colorModeForRenderPass(),S=new kt(y.LEQUAL,kt.ReadWrite,g.depthRangeFor3D),I=g.useProgram("terrain"),k=s.getTerrainMesh();m.bindFramebuffer.set(null),m.viewport.set([0,0,g.width,g.height]);for(const R of h){const z=g.renderToTexture.getTexture(R),L=s.getTerrainData(R.tileID);m.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,z.texture);const j={u_matrix:g.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_texture:0,u_ele_delta:s.getMeshFrameDelta(g.transform.zoom)};I.draw(m,y.TRIANGLES,S,cn.disabled,w,nn.backCCW,j,L,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}const Vs={symbol:function(g,s,h,m,y){if("translucent"!==g.renderPass)return;const w=cn.disabled,S=g.colorModeForRenderPass();h.layout.get("text-variable-anchor")&&function(I,k,R,z,L,j,Q){const ee=k.transform,Y="map"===L,ae="map"===j;for(const _e of I){const ye=z.getTile(_e),ie=ye.getBucket(R);if(!ie||!ie.text||!ie.text.segments.get().length)continue;const we=b.evaluateSizeForZoom(ie.textSizeData,ee.zoom),De=Te(ye,1,k.transform.zoom),Se=$r(_e.posMatrix,ae,Y,k.transform,De),ke="none"!==R.layout.get("icon-text-fit")&&ie.hasIconData();if(we){const Be=Math.pow(2,ee.zoom-ye.tileID.overscaledZ);ua(ie,Y,ae,Q,ee,Se,_e.posMatrix,Be,we,ke,k.style.map.terrain?(Le,Ne)=>k.style.map.terrain.getElevation(_e,Le,Ne):null)}}}(m,g,h,s,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),y),0!==h.paint.get("icon-opacity").constantOr(1)&&qi(g,s,h,m,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),w,S),0!==h.paint.get("text-opacity").constantOr(1)&&qi(g,s,h,m,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),w,S),s.map.showCollisionBoxes&&(Wt(g,s,h,m,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Wt(g,s,h,m,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(g,s,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("circle-opacity"),w=h.paint.get("circle-stroke-width"),S=h.paint.get("circle-stroke-opacity"),I=!h.layout.get("circle-sort-key").isConstant();if(0===y.constantOr(1)&&(0===w.constantOr(1)||0===S.constantOr(1)))return;const k=g.context,R=k.gl,z=g.depthModeForSublayer(0,kt.ReadOnly),L=cn.disabled,j=g.colorModeForRenderPass(),Q=[];for(let ee=0;eeee.sortKey-Y.sortKey);for(const ee of Q){const{programConfiguration:Y,program:ae,layoutVertexBuffer:_e,indexBuffer:ye,uniformValues:ie,terrainData:we}=ee.state;ae.draw(k,R.TRIANGLES,z,L,j,nn.disabled,ie,we,h.id,_e,ye,ee.segments,h.paint,g.transform.zoom,Y)}},heatmap:function(g,s,h,m){if(0!==h.paint.get("heatmap-opacity"))if("offscreen"===g.renderPass){const y=g.context,w=y.gl,S=cn.disabled,I=new Lt([w.ONE,w.ONE],b.Color.transparent,[!0,!0,!0,!0]);(function(k,R,z){const L=k.gl;k.activeTexture.set(L.TEXTURE1),k.viewport.set([0,0,R.width/4,R.height/4]);let j=z.heatmapFbo;if(j)L.bindTexture(L.TEXTURE_2D,j.colorAttachment.get()),k.bindFramebuffer.set(j.framebuffer);else{const Q=L.createTexture();L.bindTexture(L.TEXTURE_2D,Q),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MIN_FILTER,L.LINEAR),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_MAG_FILTER,L.LINEAR),j=z.heatmapFbo=k.createFramebuffer(R.width/4,R.height/4,!1),function(ee,Y,ae,_e){const ye=ee.gl;ye.texImage2D(ye.TEXTURE_2D,0,ye.RGBA,Y.width/4,Y.height/4,0,ye.RGBA,ee.extRenderToTextureHalfFloat?ee.extTextureHalfFloat.HALF_FLOAT_OES:ye.UNSIGNED_BYTE,null),_e.colorAttachment.set(ae)}(k,R,Q,j)}})(y,g,h),y.clear({color:b.Color.transparent});for(let k=0;k{const ee=b.create();b.ortho(ee,0,z.width,z.height,0,0,1);const Y=z.context.gl;return{u_matrix:ee,u_world:[Y.drawingBufferWidth,Y.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:L.paint.get("heatmap-opacity")}})(y,w),null,w.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,w.paint,y.transform.zoom)}(g,h))},line:function(g,s,h,m){if("translucent"!==g.renderPass)return;const y=h.paint.get("line-opacity"),w=h.paint.get("line-width");if(0===y.constantOr(1)||0===w.constantOr(1))return;const S=g.depthModeForSublayer(0,kt.ReadOnly),I=g.colorModeForRenderPass(),k=h.paint.get("line-dasharray"),R=h.paint.get("line-pattern"),z=R.constantOr(1),L=h.paint.get("line-gradient"),j=h.getCrossfadeParameters(),Q=z?"linePattern":k?"lineSDF":L?"lineGradient":"line",ee=g.context,Y=ee.gl;let ae=!0;for(const _e of m){const ye=s.getTile(_e);if(z&&!ye.patternsLoaded())continue;const ie=ye.getBucket(h);if(!ie)continue;const we=ie.programConfigurations.get(h.id),De=g.context.program.get(),Se=g.useProgram(Q,we),ke=ae||Se.program!==De,Be=g.style.map.terrain&&g.style.map.terrain.getTerrainData(_e),Le=R.constantOr(null);if(Le&&ye.imageAtlas){const ft=ye.imageAtlas,Pt=ft.patternPositions[Le.to.toString()],Nt=ft.patternPositions[Le.from.toString()];Pt&&Nt&&we.setConstantPatternPositions(Pt,Nt)}const Ne=Be?_e:null,ze=z?Qh(g,ye,h,j,Ne):k?ji(g,ye,h,k,j,Ne):L?Jh(g,ye,h,ie.lineClipsArray.length,Ne):Vu(g,ye,h,Ne);if(z)ee.activeTexture.set(Y.TEXTURE0),ye.imageAtlasTexture.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),we.updatePaintBuffers(j);else if(k&&(ke||g.lineAtlas.dirty))ee.activeTexture.set(Y.TEXTURE0),g.lineAtlas.bind(ee);else if(L){const ft=ie.gradients[h.id];let Pt=ft.texture;if(h.gradientVersion!==ft.version){let Nt=256;if(h.stepInterpolant){const mt=s.getSource().maxzoom,In=_e.canonical.z===mt?Math.ceil(1<256&&this.clearStencil(),m.setColorMode(Lt.disabled),m.setDepthMode(kt.disabled);const w=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const S of h){const I=this._tileClippingMaskIDs[S.key]=this.nextStencilID++,k=this.style.map.terrain&&this.style.map.terrain.getTerrainData(S);w.draw(m,y.TRIANGLES,kt.disabled,new cn({func:y.ALWAYS,mask:0},I,255,y.KEEP,y.KEEP,y.REPLACE),Lt.disabled,nn.disabled,Kh(S.posMatrix),k,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const s=this.nextStencilID++,h=this.context.gl;return new cn({func:h.NOTEQUAL,mask:255},s,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(s){const h=this.context.gl;return new cn({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(s){const h=this.context.gl,m=s.sort((S,I)=>I.overscaledZ-S.overscaledZ),y=m[m.length-1].overscaledZ,w=m[0].overscaledZ-y+1;if(w>1){this.currentStencilSource=void 0,this.nextStencilID+w>256&&this.clearStencil();const S={};for(let I=0;I=0;this.currentLayer--){const k=this.style._layers[m[this.currentLayer]],R=y[k.source],z=w[k.source];this._renderTileClippingMasks(k,z),this.renderLayer(this,R,k,z)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerae.source&&!ae.isHidden(z)?[R.sourceCaches[ae.source]]:[]),Q=j.filter(ae=>"vector"===ae.getSource().type),ee=j.filter(ae=>"vector"!==ae.getSource().type),Y=ae=>{(!L||L.getSource().maxzoomY(ae)),L||ee.forEach(ae=>Y(ae)),L}(this.style,this.transform.zoom);k&&Vs.debug(this,k,k.getVisibleCoordinates())}this.options.showPadding&&function(k){const R=k.transform.padding;Yo(k,k.transform.height-(R.top||0),3,ha),Yo(k,R.bottom||0,3,ur),sd(k,R.left||0,3,ho),sd(k,k.transform.width-(R.right||0),3,Ka);const z=k.transform.centerPoint;var L,j,Q,ee;$n(L=k,(j=z.x)-1,(Q=k.transform.height-z.y)-10,2,20,ee=Hr),$n(L,j-10,Q-1,20,2,ee)}(this),this.context.setDefault()}renderLayer(s,h,m,y){m.isHidden(this.transform.zoom)||("background"===m.type||"custom"===m.type||(y||[]).length)&&(this.id=m.id,this.gpuTimingStart(m),Vs[m.type](s,h,m,y,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(s){if(!this.options.gpuTiming)return;const h=this.context.extTimerQuery;let m=this.gpuTimers[s.id];m||(m=this.gpuTimers[s.id]={calls:0,cpuTime:0,query:h.createQueryEXT()}),m.calls++,h.beginQueryEXT(h.TIME_ELAPSED_EXT,m.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const s=this.context.extTimerQuery;s.endQueryEXT(s.TIME_ELAPSED_EXT)}collectGpuTimers(){const s=this.gpuTimers;return this.gpuTimers={},s}queryGpuTimers(s){const h={};for(const m in s){const y=s[m],w=this.context.extTimerQuery,S=w.getQueryObjectEXT(y.query,w.QUERY_RESULT_EXT)/1e6;w.deleteQueryEXT(y.query),h[m]=S}return h}translatePosMatrix(s,h,m,y,w){if(!m[0]&&!m[1])return s;const S=w?"map"===y?this.transform.angle:0:"viewport"===y?-this.transform.angle:0;if(S){const R=Math.sin(S),z=Math.cos(S);m=[m[0]*z-m[1]*R,m[0]*R+m[1]*z]}const I=[w?m[0]:Te(h,m[0],this.transform.zoom),w?m[1]:Te(h,m[1],this.transform.zoom),0],k=new Float32Array(16);return b.translate(k,s,I),k}saveTileTexture(s){const h=this._tileTextures[s.size[0]];h?h.push(s):this._tileTextures[s.size[0]]=[s]}getTileTexture(s){const h=this._tileTextures[s];return h&&h.length>0?h.pop():null}isPatternMissing(s){if(!s)return!1;if(!s.from||!s.to)return!0;const h=this.imageManager.getPattern(s.from.toString()),m=this.imageManager.getPattern(s.to.toString());return!h||!m}useProgram(s,h){this.cache=this.cache||{};const m=s+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[m]||(this.cache[m]=new Wh(this.context,s,nt[s],h,Nc[s],this._showOverdrawInspector,this.style.map.terrain)),this.cache[m]}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 s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Gn(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class ct{constructor(s,h){this.points=s,this.planes=h}static fromInvProjectionMatrix(s,h,m){const y=Math.pow(2,m),w=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(I=>{const k=1/(I=b.transformMat4([],I,s))[3]/h*y;return b.mul$1(I,I,[k,k,1/I[3],k])}),S=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const k=function(j,Q){var ee=Q[0],Y=Q[1],ae=Q[2],_e=ee*ee+Y*Y+ae*ae;return _e>0&&(_e=1/Math.sqrt(_e)),j[0]=Q[0]*_e,j[1]=Q[1]*_e,j[2]=Q[2]*_e,j}([],(j=[],Q=oo([],w[I[0]],w[I[1]]),ee=oo([],w[I[2]],w[I[1]]),Y=Q[0],ye=ee[0],j[0]=(ae=Q[1])*(we=ee[2])-(_e=Q[2])*(ie=ee[1]),j[1]=_e*ye-Y*we,j[2]=Y*ie-ae*ye,j)),R=-((z=k)[0]*(L=w[I[1]])[0]+z[1]*L[1]+z[2]*L[2]);var j,Q,ee,Y,ae,_e,ye,ie,we,z,L;return k.concat(R)});return new ct(w,S)}}class da{constructor(s,h){var m,y,w;this.min=s,this.max=h,this.center=function(m,y,w){return m[0]=.5*y[0],m[1]=.5*y[1],m[2]=.5*y[2],m}([],((m=[])[0]=(y=this.min)[0]+(w=this.max)[0],m[1]=y[1]+w[1],m[2]=y[2]+w[2],m))}quadrant(s){const h=[s%2==0,s<2],m=ta(this.min),y=ta(this.max);for(let w=0;w=0&&S++;if(0===S)return 0;S!==h.length&&(m=!1)}if(m)return 2;for(let y=0;y<3;y++){let w=Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let I=0;Ithis.max[y]-this.min[y])return 0}return 1}}class fo{constructor(s=0,h=0,m=0,y=0){if(isNaN(s)||s<0||isNaN(h)||h<0||isNaN(m)||m<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=h,this.left=m,this.right=y}interpolate(s,h,m){return null!=h.top&&null!=s.top&&(this.top=b.number(s.top,h.top,m)),null!=h.bottom&&null!=s.bottom&&(this.bottom=b.number(s.bottom,h.bottom,m)),null!=h.left&&null!=s.left&&(this.left=b.number(s.left,h.left,m)),null!=h.right&&null!=s.right&&(this.right=b.number(s.right,h.right,m)),this}getCenter(s,h){const m=b.clamp((this.left+s-this.right)/2,0,s),y=b.clamp((this.top+h-this.bottom)/2,0,h);return new b.pointGeometry(m,y)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new fo(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Er{constructor(s,h,m,y,w){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=void 0===w||!!w,this._minZoom=s||0,this._maxZoom=h||22,this._minPitch=m??0,this._maxPitch=y??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new b.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new fo,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const s=new Er(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return s.tileSize=this.tileSize,s.latRange=this.latRange,s.width=this.width,s.height=this.height,s._center=this._center,s._elevation=this._elevation,s.zoom=this.zoom,s.angle=this.angle,s._fov=this._fov,s._pitch=this._pitch,s._unmodified=this._unmodified,s._edgeInsets=this._edgeInsets.clone(),s._calcMatrices(),s}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(s){void 0===s?s=!0:null===s&&(s=!1),this._renderWorldCopies=s}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new b.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(s){const h=-b.wrap(s,-180,180)*Math.PI/180;var m;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(m=new b.ARRAY_TYPE(4),b.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m),function(m,y,w){var S=y[0],I=y[1],k=y[2],R=y[3],z=Math.sin(w),L=Math.cos(w);m[0]=S*L+k*z,m[1]=I*L+R*z,m[2]=S*-z+k*L,m[3]=I*-z+R*L}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){const h=b.clamp(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=s/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(s){const h=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(s){s.lat===this._center.lat&&s.lng===this._center.lng||(this._unmodified=!1,this._center=s,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(s){s!==this._elevation&&(this._elevation=s,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(s){this._edgeInsets.equals(s)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,s,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(s){return this._edgeInsets.equals(s)}interpolatePadding(s,h,m){this._unmodified=!1,this._edgeInsets.interpolate(s,h,m),this._constrain(),this._calcMatrices()}coveringZoomLevel(s){const h=(s.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/s.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(s){const h=[new b.UnwrappedTileID(0,s)];if(this._renderWorldCopies){const m=this.pointCoordinate(new b.pointGeometry(0,0)),y=this.pointCoordinate(new b.pointGeometry(this.width,0)),w=this.pointCoordinate(new b.pointGeometry(this.width,this.height)),S=this.pointCoordinate(new b.pointGeometry(0,this.height)),I=Math.floor(Math.min(m.x,y.x,w.x,S.x)),k=Math.floor(Math.max(m.x,y.x,w.x,S.x)),R=1;for(let z=I-R;z<=k+R;z++)0!==z&&h.push(new b.UnwrappedTileID(z,s))}return h}coveringTiles(s){var h,m;let y=this.coveringZoomLevel(s);const w=y;if(void 0!==s.minzoom&&ys.maxzoom&&(y=s.maxzoom);const S=this.pointCoordinate(this.getCameraPoint()),I=b.MercatorCoordinate.fromLngLat(this.center),k=Math.pow(2,y),R=[k*S.x,k*S.y,0],z=[k*I.x,k*I.y,0],L=ct.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,y);let j=s.minzoom||0;!s.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(j=y);const Q=s.terrain?2/Math.min(this.tileSize,s.tileSize)*this.tileSize:3,ee=ie=>({aabb:new da([ie*k,0,0],[(ie+1)*k,k,0]),zoom:0,x:0,y:0,wrap:ie,fullyVisible:!1}),Y=[],ae=[],_e=y,ye=s.reparseOverscaled?w:y;if(this._renderWorldCopies)for(let ie=1;ie<=3;ie++)Y.push(ee(-ie)),Y.push(ee(ie));for(Y.push(ee(0));Y.length>0;){const ie=Y.pop(),we=ie.x,De=ie.y;let Se=ie.fullyVisible;if(!Se){const ze=ie.aabb.intersects(L);if(0===ze)continue;Se=2===ze}const ke=s.terrain?R:z,Be=ie.aabb.distanceX(ke),Le=ie.aabb.distanceY(ke),Ne=Math.max(Math.abs(Be),Math.abs(Le));if(ie.zoom===_e||Ne>Q+(1<<_e-ie.zoom)-2&&ie.zoom>=j){const ze=_e-ie.zoom,ft=R[0]-.5-(we<>1),Nt=ie.zoom+1;let mt=ie.aabb.quadrant(ze);if(s.terrain){const In=new b.OverscaledTileID(Nt,ie.wrap,Nt,ft,Pt),An=s.terrain.getMinMaxElevation(In),Ht=null!==(h=An.minElevation)&&void 0!==h?h:this.elevation,rn=null!==(m=An.maxElevation)&&void 0!==m?m:this.elevation;mt=new da([mt.min[0],mt.min[1],Ht],[mt.max[0],mt.max[1],rn])}Y.push({aabb:mt,zoom:Nt,x:ft,y:Pt,wrap:ie.wrap,fullyVisible:Se})}}return ae.sort((ie,we)=>ie.distanceSq-we.distanceSq).map(ie=>ie.tileID)}resize(s,h){this.width=s,this.height=h,this.pixelsToGLUnits=[2/s,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){const h=b.clamp(s.lat,-this.maxValidLatitude,this.maxValidLatitude);return new b.pointGeometry(b.mercatorXfromLng(s.lng)*this.worldSize,b.mercatorYfromLat(h)*this.worldSize)}unproject(s){return new b.MercatorCoordinate(s.x/this.worldSize,s.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(s){this.freezeElevation||(this.elevation=s?this.getElevation(this._center,s):0)}getElevation(s,h){const m=b.MercatorCoordinate.fromLngLat(s),y=(1<S&&(y=S-ee)}if(this.lngRange){const Q=(I+k)/2,ee=b.wrap(L.x,Q-this.worldSize/2,Q+this.worldSize/2),Y=R.x/2;ee-Yk&&(m=k-Y)}void 0===m&&void 0===y||(this.center=this.unproject(new b.pointGeometry(void 0!==m?m:L.x,void 0!==y?y:L.y)).wrap()),this._unmodified=z,this._constraining=!1}_calcMatrices(){if(!this.height)return;const s=this.centerOffset,h=this.point.x,m=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=b.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let y=b.identity(new Float64Array(16));b.scale(y,y,[this.width/2,-this.height/2,1]),b.translate(y,y,[1,-1,0]),this.labelPlaneMatrix=y,y=b.identity(new Float64Array(16)),b.scale(y,y,[1,-1,1]),b.translate(y,y,[-1,-1,0]),b.scale(y,y,[2/this.width,2/this.height,1]),this.glCoordMatrix=y,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const w=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,S=Math.PI/2+this._pitch,I=this._fov*(.5+s.y/this.height),k=Math.sin(I)*w/Math.sin(b.clamp(Math.PI-S-I,.01,Math.PI-.01)),R=this.getHorizon(),z=2*Math.atan(R/this.cameraToCenterDistance)*(.5+s.y/(2*R)),L=Math.sin(z)*w/Math.sin(b.clamp(Math.PI-S-z,.01,Math.PI-.01)),j=Math.min(k,L),Q=1.01*(Math.cos(Math.PI/2-this._pitch)*j+w),ee=this.height/50;y=new Float64Array(16),b.perspective(y,this._fov,this.width/this.height,ee,Q),y[8]=2*-s.x/this.width,y[9]=2*s.y/this.height,b.scale(y,y,[1,-1,1]),b.translate(y,y,[0,0,-this.cameraToCenterDistance]),b.rotateX(y,y,this._pitch),b.rotateZ(y,y,this.angle),b.translate(y,y,[-h,-m,0]),this.mercatorMatrix=b.scale([],y,[this.worldSize,this.worldSize,this.worldSize]),b.scale(y,y,[1,1,this._pixelPerMeter]),this.pixelMatrix=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y),b.translate(y,y,[0,0,-this.elevation]),this.projMatrix=y,this.invProjMatrix=b.invert([],y),this.pixelMatrix3D=b.multiply(new Float64Array(16),this.labelPlaneMatrix,y);const Y=this.width%2/2,ae=this.height%2/2,_e=Math.cos(this.angle),ye=Math.sin(this.angle),ie=h-Math.round(h)+_e*Y+ye*ae,we=m-Math.round(m)+_e*ae+ye*Y,De=new Float64Array(y);if(b.translate(De,De,[ie>.5?ie-1:ie,we>.5?we-1:we,0]),this.alignedProjMatrix=De,y=b.invert(new Float64Array(16),this.pixelMatrix),!y)throw new Error("failed to invert matrix");this.pixelMatrixInverse=y,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const s=this.pointCoordinate(new b.pointGeometry(0,0)),h=[s.x*this.worldSize,s.y*this.worldSize,0,1];return b.transformMat4(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new b.pointGeometry(0,s))}getCameraQueryGeometry(s){const h=this.getCameraPoint();if(1===s.length)return[s[0],h];{let m=h.x,y=h.y,w=h.x,S=h.y;for(const I of s)m=Math.min(m,I.x),y=Math.min(y,I.y),w=Math.max(w,I.x),S=Math.max(S,I.y);return[new b.pointGeometry(m,y),new b.pointGeometry(w,y),new b.pointGeometry(w,S),new b.pointGeometry(m,S),new b.pointGeometry(m,y)]}}}class Bf{constructor(s){this._hashName=s&&encodeURIComponent(s),b.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(h,m){let y=!1,w=null;const S=()=>{w=null,y&&(h(),w=setTimeout(S,300),y=!1)};return()=>(y=!0,w||S(),w)}(this._updateHashUnthrottled.bind(this))}addTo(s){return this._map=s,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()),delete this._map,this}getHashString(s){const h=this._map.getCenter(),m=Math.round(100*this._map.getZoom())/100,y=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),w=Math.pow(10,y),S=Math.round(h.lng*w)/w,I=Math.round(h.lat*w)/w,k=this._map.getBearing(),R=this._map.getPitch();let z="";if(z+=s?`/${S}/${I}/${m}`:`${m}/${I}/${S}`,(k||R)&&(z+="/"+Math.round(10*k)/10),R&&(z+=`/${Math.round(R)}`),this._hashName){const L=this._hashName;let j=!1;const Q=window.location.hash.slice(1).split("&").map(ee=>{const Y=ee.split("=")[0];return Y===L?(j=!0,`${Y}=${z}`):ee}).filter(ee=>ee);return j||Q.push(`${L}=${z}`),`#${Q.join("&")}`}return`#${z}`}_getCurrentHash(){const s=window.location.hash.replace("#","");if(this._hashName){let h;return s.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(h=m)}),(h&&h[1]||"").split("/")}return s.split("/")}_onHashChange(){const s=this._getCurrentHash();if(s.length>=3&&!s.some(h=>isNaN(h))){const h=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:h,pitch:+(s[4]||0)}),!0}return!1}_updateHashUnthrottled(){const s=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,s)}catch{}}}const Xe={linearity:.3,easing:b.bezier(0,0,.3,1)},po=b.extend({deceleration:2500,maxSpeed:1400},Xe),ld=b.extend({deceleration:20,maxSpeed:1400},Xe),Zu=b.extend({deceleration:1e3,maxSpeed:360},Xe),Vl=b.extend({deceleration:1e3,maxSpeed:90},Xe);class Po{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:b.exported.now(),settings:s})}_drainInertiaBuffer(){const s=this._inertiaBuffer,h=b.exported.now();for(;s.length>0&&h-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new b.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:w}of this._inertiaBuffer)h.zoom+=w.zoomDelta||0,h.bearing+=w.bearingDelta||0,h.pitch+=w.pitchDelta||0,w.panDelta&&h.pan._add(w.panDelta),w.around&&(h.around=w.around),w.pinchAround&&(h.pinchAround=w.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(h.pan.mag()){const w=cd(h.pan.mag(),m,b.extend({},po,s||{}));y.offset=h.pan.mult(w.amount/h.pan.mag()),y.center=this._map.transform.center,Uc(y,w)}if(h.zoom){const w=cd(h.zoom,m,ld);y.zoom=this._map.transform.zoom+w.amount,Uc(y,w)}if(h.bearing){const w=cd(h.bearing,m,Zu);y.bearing=this._map.transform.bearing+b.clamp(w.amount,-179,179),Uc(y,w)}if(h.pitch){const w=cd(h.pitch,m,Vl);y.pitch=this._map.transform.pitch+w.amount,Uc(y,w)}if(y.zoom||y.bearing){const w=void 0===h.pinchAround?h.around:h.pinchAround;y.around=w?this._map.unproject(w):this._map.getCenter()}return this.clear(),b.extend(y,{noMoveStart:!0})}}function Uc(g,s){(!g.duration||g.durationh.unproject(k)),I=w.reduce((k,R,z,L)=>k.add(R.div(L.length)),new b.pointGeometry(0,0));super(s,{points:w,point:I,lngLats:S,lngLat:h.unproject(I),originalEvent:m}),this._defaultPrevented=!1}}class Vf extends b.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,h,m){super(s,{originalEvent:m}),this._defaultPrevented=!1}}class Uf{constructor(s,h){this._map=s,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(s){return this._firePreventable(new Vf(s.type,this._map,s))}mousedown(s,h){return this._mousedownPos=h,this._firePreventable(new Ro(s.type,this._map,s))}mouseup(s){this._map.fire(new Ro(s.type,this._map,s))}click(s,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new Ro(s.type,this._map,s))}dblclick(s){return this._firePreventable(new Ro(s.type,this._map,s))}mouseover(s){this._map.fire(new Ro(s.type,this._map,s))}mouseout(s){this._map.fire(new Ro(s.type,this._map,s))}touchstart(s){return this._firePreventable(new Ul(s.type,this._map,s))}touchmove(s){this._map.fire(new Ul(s.type,this._map,s))}touchend(s){this._map.fire(new Ul(s.type,this._map,s))}touchcancel(s){this._map.fire(new Ul(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class $f{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(s){this._map.fire(new Ro(s.type,this._map,s))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ro("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(s){this._delayContextMenu?this._contextMenuEvent=s:this._ignoreContextMenu||this._map.fire(new Ro(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class mo{constructor(s,h){this._map=s,this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,h){this.isEnabled()&&s.shiftKey&&0===s.button&&(Ie.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(s,h){if(!this._active)return;const m=h;if(this._lastPos.equals(m)||!this._box&&m.dist(this._startPos)w.fitScreenCoordinates(m,y,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",s)}keydown(s){this._active&&27===s.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",s))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Ie.remove(this._box),this._box=null),Ie.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(s,h){return this._map.fire(new b.Event(s,{originalEvent:h}))}}function Us(g,s){if(g.length!==s.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${s.length}`);const h={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=s.timeStamp),m.length===this.numTouches&&(this.centroid=function(y){const w=new b.pointGeometry(0,0);for(const S of y)w._add(S);return w.div(y.length)}(h),this.touches=Us(m,h)))}touchmove(s,h,m){if(this.aborted||!this.centroid)return;const y=Us(m,h);for(const w in this.touches){const S=y[w];(!S||S.dist(this.touches[w])>30)&&(this.aborted=!0)}}touchend(s,h,m){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),0===m.length){const y=!this.aborted&&this.centroid;if(this.reset(),y)return y}}}class Wu{constructor(s){this.singleTap=new $m(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(s,h,m){this.singleTap.touchstart(s,h,m)}touchmove(s,h,m){this.singleTap.touchmove(s,h,m)}touchend(s,h,m){const y=this.singleTap.touchend(s,h,m);if(y){const w=s.timeStamp-this.lastTime<500,S=!this.lastTap||this.lastTap.dist(y)<30;if(w&&S||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}}}class jf{constructor(){this._zoomIn=new Wu({numTouches:1,numTaps:2}),this._zoomOut=new Wu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,h,m){this._zoomIn.touchstart(s,h,m),this._zoomOut.touchstart(s,h,m)}touchmove(s,h,m){this._zoomIn.touchmove(s,h,m),this._zoomOut.touchmove(s,h,m)}touchend(s,h,m){const y=this._zoomIn.touchend(s,h,m),w=this._zoomOut.touchend(s,h,m);return y?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()+1,around:S.unproject(y)},{originalEvent:s})}):w?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:S=>S.easeTo({duration:300,zoom:S.getZoom()-1,around:S.unproject(w)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $l{constructor(s){this._enabled=!!s.enable,this._moveStateManager=s.moveStateManager,this._clickTolerance=s.clickTolerance||1,this._moveFunction=s.move,this._activateOnStart=!!s.activateOnStart,s.assignEvents(this),this.reset()}reset(s){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(s)}_move(...s){const h=this._moveFunction(...s);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(s,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(s)&&(this._moveStateManager.startMove(s),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(s,h){if(!this.isEnabled())return;const m=this._lastPoint;if(!m)return;if(s.preventDefault(),!this._moveStateManager.isValidMoveEvent(s))return void this.reset(s);const y=h.length?h[0]:h;return!this._moved&&y.dist(m){g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=function(s){s.preventDefault()}},ud=({enable:g,clickTolerance:s,bearingDegreesPerPixelMoved:h=.8})=>{const m=new go({checkCorrectEvent:y=>0===Ie.mouseButton(y)&&y.ctrlKey||2===Ie.mouseButton(y)});return new $l({clickTolerance:s,move:(y,w)=>({bearingDelta:(w.x-y.x)*h}),moveStateManager:m,enable:g,assignEvents:$c})},Xu=({enable:g,clickTolerance:s,pitchDegreesPerPixelMoved:h=-.5})=>{const m=new go({checkCorrectEvent:y=>0===Ie.mouseButton(y)&&y.ctrlKey||2===Ie.mouseButton(y)});return new $l({clickTolerance:s,move:(y,w)=>({pitchDelta:(w.y-y.y)*h}),moveStateManager:m,enable:g,assignEvents:$c})};class Yu{constructor(s,h){this._minTouches=s.cooperativeGestures?2:1,this._clickTolerance=s.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new b.pointGeometry(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(s,h,m){return this._calculateTransform(s,h,m)}touchmove(s,h,m){if(this._map._cooperativeGestures&&(2===this._minTouches&&m.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(s,!1,m.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(m.length0&&(this._active=!0);const y=Us(m,h),w=new b.pointGeometry(0,0),S=new b.pointGeometry(0,0);let I=0;for(const R in y){const z=y[R],L=this._touches[R];L&&(w._add(z),S._add(z.sub(L)),I++,y[R]=z)}if(this._touches=y,IMath.abs(g.x)}class fd extends hd{constructor(s){super(),this._map=s}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(s,h,m){super.touchstart(s,h,m),this._currentTouchCount=m.length}_start(s){this._lastPoints=s,Ja(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,h,m){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const y=s[0].sub(this._lastPoints[0]),w=s[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(y,w,m.timeStamp),this._valid?(this._lastPoints=s,this._active=!0,{pitchDelta:(y.y+w.y)/2*-.5}):void 0}gestureBeginsVertically(s,h,m){if(void 0!==this._valid)return this._valid;const y=s.mag()>=2,w=h.mag()>=2;if(!y&&!w)return;if(!y||!w)return void 0===this._firstMove&&(this._firstMove=m),m-this._firstMove<100&&void 0;const S=s.y>0==h.y>0;return Ja(s)&&Ja(h)&&S}}const pd={panStep:100,bearingStep:15,pitchStep:10};class Si{constructor(){const s=pd;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let h=0,m=0,y=0,w=0,S=0;switch(s.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:s.shiftKey?m=-1:(s.preventDefault(),w=-1);break;case 39:s.shiftKey?m=1:(s.preventDefault(),w=1);break;case 38:s.shiftKey?y=1:(s.preventDefault(),S=-1);break;case 40:s.shiftKey?y=-1:(s.preventDefault(),S=1);break;default:return}return this._rotationDisabled&&(m=0,y=0),{cameraAnimation:I=>{const k=I.getZoom();I.easeTo({duration:300,easeId:"keyboardHandler",easing:jc,zoom:h?Math.round(k)+h*(s.shiftKey?2:1):k,bearing:I.getBearing()+m*this._bearingStep,pitch:I.getPitch()+y*this._pitchStep,offset:[-w*this._panStep,-S*this._panStep],center:I.getCenter()},{originalEvent:s})}}}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 jc(g){return g*(2-g)}const Ko=4.000244140625;class md{constructor(s,h){this._map=s,this._el=s.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,b.bindAll(["_onTimeout"],this)}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=s&&"center"===s.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(s){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;s.preventDefault()}let h=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY;const m=b.exported.now(),y=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,0!==h&&h%Ko==0?this._type="wheel":0!==h&&Math.abs(h)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(y*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),s.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=s,this._delta-=h,this._active||this._start(s)),s.preventDefault()}_onTimeout(s){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)}_start(s){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 h=Ie.mousePos(this._el,s);this._around=b.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(h)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const s=this._map.transform;if(0!==this._delta){const I="wheel"===this._type&&Math.abs(this._delta)>Ko?this._wheelZoomRate:this._defaultZoomRate;let k=2/(1+Math.exp(-Math.abs(this._delta*I)));this._delta<0&&0!==k&&(k=1/k);const R="number"==typeof this._targetZoom?s.zoomScale(this._targetZoom):s.scale;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(R*k))),"wheel"===this._type&&(this._startZoom=s.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h="number"==typeof this._targetZoom?this._targetZoom:s.zoom,m=this._startZoom,y=this._easing;let w,S=!1;if("wheel"===this._type&&m&&y){const I=Math.min((b.exported.now()-this._lastWheelEventTime)/200,1),k=y(I);w=b.number(m,h,k),I<1?this._frameId||(this._frameId=!0):S=!0}else w=h,S=!0;return this._active=!0,S&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!S,zoomDelta:w-s.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let h=b.ease;if(this._prevEase){const m=this._prevEase,y=(b.exported.now()-m.start)/m.duration,w=m.easing(y+.01)-m.easing(y),S=.27/Math.sqrt(w*w+1e-4)*.01,I=Math.sqrt(.0729-S*S);h=b.bezier(S,I,.25,1)}return this._prevEase={start:b.exported.now(),duration:s,easing:h},h}reset(){this._active=!1}}class Ku{constructor(s,h){this._clickZoom=s,this._tapZoom=h}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 Tn{constructor(){this.reset()}reset(){this._active=!1}dblclick(s,h){return s.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:m.getZoom()+(s.shiftKey?-1:1),around:m.unproject(h)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dr{constructor(){this._tap=new Wu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(s,h,m){this._swipePoint||(this._tapTime&&s.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?m.length>0&&(this._swipePoint=h[0],this._swipeTouch=m[0].identifier):this._tap.touchstart(s,h,m))}touchmove(s,h,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const y=h[0],w=y.y-this._swipePoint.y;return this._swipePoint=y,s.preventDefault(),this._active=!0,{zoomDelta:w/128}}}else this._tap.touchmove(s,h,m)}touchend(s,h,m){this._tapTime?this._swipePoint&&0===m.length&&this.reset():this._tap.touchend(s,h,m)&&(this._tapTime=s.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hf{constructor(s,h,m){this._el=s,this._mousePan=h,this._touchPan=m}enable(s){this._inertiaOptions=s||{},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 Qa{constructor(s,h,m){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=h,this._mousePitch=m}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ju{constructor(s,h,m,y){this._el=s,this._touchZoom=h,this._touchRotate=m,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),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()}}const Hc=g=>g.zoom||g.drag||g.pitch||g.rotate;class Sr extends b.Event{}function Gc(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta}class Qu{constructor(s,h){this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Po(s),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h),b.bindAll(["handleEvent","handleWindowEvent"],this);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[window,"blur",void 0]];for(const[y,w,S]of this._listeners)Ie.addEventListener(y,w,y===document?this.handleWindowEvent:this.handleEvent,S)}destroy(){for(const[s,h,m]of this._listeners)Ie.removeEventListener(s,h,s===document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(s){const h=this._map,m=h.getCanvasContainer();this._add("mapEvent",new Uf(h,s));const y=h.boxZoom=new mo(h,s);this._add("boxZoom",y);const w=new jf,S=new Tn;h.doubleClickZoom=new Ku(S,w),this._add("tapZoom",w),this._add("clickZoom",S);const I=new Dr;this._add("tapDragZoom",I);const k=h.touchPitch=new fd(h);this._add("touchPitch",k);const R=ud(s),z=Xu(s);h.dragRotate=new Qa(s,R,z),this._add("mouseRotate",R,["mousePitch"]),this._add("mousePitch",z,["mouseRotate"]);const L=(({enable:_e,clickTolerance:ye})=>{const ie=new go({checkCorrectEvent:we=>0===Ie.mouseButton(we)&&!we.ctrlKey});return new $l({clickTolerance:ye,move:(we,De)=>({around:De,panDelta:De.sub(we)}),activateOnStart:!0,moveStateManager:ie,enable:_e,assignEvents:$c})})(s),j=new Yu(s,h);h.dragPan=new Hf(m,L,j),this._add("mousePan",L),this._add("touchPan",j,["touchZoom","touchRotate"]);const Q=new yt,ee=new _s;h.touchZoomRotate=new Ju(m,ee,Q,I),this._add("touchRotate",Q,["touchPan","touchZoom"]),this._add("touchZoom",ee,["touchPan","touchRotate"]);const Y=h.scrollZoom=new md(h,this);this._add("scrollZoom",Y,["mousePan"]);const ae=h.keyboard=new Si;this._add("keyboard",ae),this._add("blockableMapEvent",new $f(h));for(const _e of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])s.interactive&&s[_e]&&h[_e].enable(s[_e])}_add(s,h,m){this._handlers.push({handlerName:s,handler:h,allowed:m}),this._handlersById[s]=h}stop(s){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[]}}isActive(){for(const{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Hc(this._eventsInProgress))||this.isZooming()}_blockedByActive(s,h,m){for(const y in s)if(y!==m&&(!h||h.indexOf(y)<0))return!0;return!1}handleWindowEvent(s){this.handleEvent(s,`${s.type}Window`)}_getMapTouches(s){const h=[];for(const m of s)this._el.contains(m.target)&&h.push(m);return h}handleEvent(s,h){if("blur"===s.type)return void this.stop(!0);this._updatingCamera=!0;const m="renderFrame"===s.type?void 0:s,y={needsRenderFrame:!1},w={},S={},I=s.touches,k=I?this._getMapTouches(I):void 0,R=k?Ie.touchPos(this._el,k):Ie.mousePos(this._el,s);for(const{handlerName:j,handler:Q,allowed:ee}of this._handlers){if(!Q.isEnabled())continue;let Y;this._blockedByActive(S,ee,j)?Q.reset():Q[h||s.type]&&(Y=Q[h||s.type](s,R,k),this.mergeHandlerResult(y,w,Y,j,m),Y&&Y.needsRenderFrame&&this._triggerRenderFrame()),(Y||Q.isActive())&&(S[j]=Q)}const z={};for(const j in this._previousActiveHandlers)S[j]||(z[j]=m);this._previousActiveHandlers=S,(Object.keys(z).length||Gc(y))&&(this._changes.push([y,w,z]),this._triggerRenderFrame()),(Object.keys(S).length||Gc(y))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:L}=y;L&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],L(this._map))}mergeHandlerResult(s,h,m,y,w){if(!m)return;b.extend(s,m);const S={handlerName:y,originalEvent:m.originalEvent||w};void 0!==m.zoomDelta&&(h.zoom=S),void 0!==m.panDelta&&(h.drag=S),void 0!==m.pitchDelta&&(h.pitch=S),void 0!==m.bearingDelta&&(h.rotate=S)}_applyChanges(){const s={},h={},m={};for(const[y,w,S]of this._changes)y.panDelta&&(s.panDelta=(s.panDelta||new b.pointGeometry(0,0))._add(y.panDelta)),y.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+y.pitchDelta),void 0!==y.around&&(s.around=y.around),void 0!==y.pinchAround&&(s.pinchAround=y.pinchAround),y.noInertia&&(s.noInertia=y.noInertia),b.extend(h,w),b.extend(m,S);this._updateMapTransform(s,h,m),this._changes=[]}_updateMapTransform(s,h,m){const y=this._map,w=y.transform,S=y.terrain;if(!(Gc(s)||S&&this._terrainMovement))return this._fireEvents(h,m,!0);let{panDelta:I,zoomDelta:k,bearingDelta:R,pitchDelta:z,around:L,pinchAround:j}=s;void 0!==j&&(L=j),y._stop(!0),L=L||y.transform.centerPoint;const Q=w.pointLocation(I?L.sub(I):L);R&&(w.bearing+=R),z&&(w.pitch+=z),k&&(w.zoom+=k),S?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?w.center=w.pointLocation(w.centerPoint.sub(I)):w.setLocationAtPoint(Q,L):(this._terrainMovement=!0,w.freezeElevation=!0,w.setLocationAtPoint(Q,L),this._map.once("moveend",()=>{w.freezeElevation=!1,this._terrainMovement=!1,w.recalculateZoom(y.terrain)})):w.setLocationAtPoint(Q,L),this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(h,m,!0)}_fireEvents(s,h,m){const y=Hc(this._eventsInProgress),w=Hc(s),S={};for(const z in s){const{originalEvent:L}=s[z];this._eventsInProgress[z]||(S[`${z}start`]=L),this._eventsInProgress[z]=s[z]}!y&&w&&this._fireEvent("movestart",w.originalEvent);for(const z in S)this._fireEvent(z,S[z]);w&&this._fireEvent("move",w.originalEvent);for(const z in s){const{originalEvent:L}=s[z];this._fireEvent(z,L)}const I={};let k;for(const z in this._eventsInProgress){const{handlerName:L,originalEvent:j}=this._eventsInProgress[z];this._handlersById[L].isActive()||(delete this._eventsInProgress[z],k=h[L]||j,I[`${z}end`]=k)}for(const z in I)this._fireEvent(z,I[z]);const R=Hc(this._eventsInProgress);if(m&&(y||w)&&!R){this._updatingCamera=!0;const z=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),L=j=>0!==j&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Sr("renderFrame",{timeStamp:s})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const jl={extend:(g,...s)=>b.extend(g,...s),run(g){g()},logToElement(g,s=!1,h="log"){const m=window.document.getElementById(h);m&&(s&&(m.innerHTML=""),m.innerHTML+=`
${g}`)}};class Mi extends b.Evented{constructor(s,h){super(),this._moving=!1,this._zooming=!1,this.transform=s,this._bearingSnap=h.bearingSnap,b.bindAll(["_renderFrameCallback"],this)}getCenter(){return new b.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(s,h){return this.jumpTo({center:s},h)}panBy(s,h,m){return s=b.pointGeometry.convert(s).mult(-1),this.panTo(this.transform.center,b.extend({offset:s},h),m)}panTo(s,h,m){return this.easeTo(b.extend({center:s},h),m)}getZoom(){return this.transform.zoom}setZoom(s,h){return this.jumpTo({zoom:s},h),this}zoomTo(s,h,m){return this.easeTo(b.extend({zoom:s},h),m)}zoomIn(s,h){return this.zoomTo(this.getZoom()+1,s,h),this}zoomOut(s,h){return this.zoomTo(this.getZoom()-1,s,h),this}getBearing(){return this.transform.bearing}setBearing(s,h){return this.jumpTo({bearing:s},h),this}getPadding(){return this.transform.padding}setPadding(s,h){return this.jumpTo({padding:s},h),this}rotateTo(s,h,m){return this.easeTo(b.extend({bearing:s},h),m)}resetNorth(s,h){return this.rotateTo(0,b.extend({duration:1e3},s),h),this}resetNorthPitch(s,h){return this.easeTo(b.extend({bearing:0,pitch:0,duration:1e3},s),h),this}snapToNorth(s,h){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=b.number(y,k,Se)),this._rotating&&(m.bearing=b.number(w,R,Se)),this._pitching&&(m.pitch=b.number(S,z,Se)),this._padding&&(m.interpolatePadding(I,L,Se),Q=m.centerPoint.add(j)),this.terrain&&!s.freezeElevation&&this._updateElevation(Se),ie)m.setLocationAtPoint(ie,we);else{const ke=m.zoomScale(m.zoom-y),Be=k>y?Math.min(2,ye):Math.max(.5,ye),Le=Math.pow(Be,1-Se),Ne=m.unproject(ae.add(_e.mult(Se*Le)).mult(ke));m.setLocationAtPoint(m.renderWorldCopies?Ne.wrap():Ne,Q)}this._fireMoveEvents(h)},Se=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,Se)},s),this}_prepareEase(s,h,m={}){this._moving=!0,h||m.moving||this.fire(new b.Event("movestart",s)),this._zooming&&!m.zooming&&this.fire(new b.Event("zoomstart",s)),this._rotating&&!m.rotating&&this.fire(new b.Event("rotatestart",s)),this._pitching&&!m.pitching&&this.fire(new b.Event("pitchstart",s))}_prepareElevation(s){this._elevationCenter=s,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(s,this.terrain),this.transform.freezeElevation=!0}_updateElevation(s){const h=this.transform.getElevation(this._elevationCenter,this.terrain);if(s<1&&h!==this._elevationTarget){const m=this._elevationTarget-this._elevationStart;this._elevationStart+=s*(m-(h-(m*s+this._elevationStart))/(1-s)),this._elevationTarget=h}this.transform.elevation=b.number(this._elevationStart,this._elevationTarget,s)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_fireMoveEvents(s){this.fire(new b.Event("move",s)),this._zooming&&this.fire(new b.Event("zoom",s)),this._rotating&&this.fire(new b.Event("rotate",s)),this._pitching&&this.fire(new b.Event("pitch",s))}_afterEase(s,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const m=this._zooming,y=this._rotating,w=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new b.Event("zoomend",s)),y&&this.fire(new b.Event("rotateend",s)),w&&this.fire(new b.Event("pitchend",s)),this.fire(new b.Event("moveend",s))}flyTo(s,h){if(!s.essential&&b.exported.prefersReducedMotion){const mt=b.pick(s,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mt,h)}this.stop(),s=b.extend({offset:[0,0],speed:1.2,curve:1.42,easing:b.ease},s);const m=this.transform,y=this.getZoom(),w=this.getBearing(),S=this.getPitch(),I=this.getPadding(),k="zoom"in s?b.clamp(+s.zoom,m.minZoom,m.maxZoom):y,R="bearing"in s?this._normalizeBearing(s.bearing,w):w,z="pitch"in s?+s.pitch:S,L="padding"in s?s.padding:m.padding,j=m.zoomScale(k-y),Q=b.pointGeometry.convert(s.offset);let ee=m.centerPoint.add(Q);const Y=m.pointLocation(ee),ae=b.LngLat.convert(s.center||Y);this._normalizeCenter(ae);const _e=m.project(Y),ye=m.project(ae).sub(_e);let ie=s.curve;const we=Math.max(m.width,m.height),De=we/j,Se=ye.mag();if("minZoom"in s){const mt=b.clamp(Math.min(s.minZoom,y,k),m.minZoom,m.maxZoom),In=we/m.zoomScale(mt-y);ie=Math.sqrt(In/Se*2)}const ke=ie*ie;function Be(mt){const In=(De*De-we*we+(mt?-1:1)*ke*ke*Se*Se)/(2*(mt?De:we)*ke*Se);return Math.log(Math.sqrt(In*In+1)-In)}function Le(mt){return(Math.exp(mt)-Math.exp(-mt))/2}function Ne(mt){return(Math.exp(mt)+Math.exp(-mt))/2}const ze=Be(0);let ft=function(mt){return Ne(ze)/Ne(ze+ie*mt)},Pt=function(mt){return we*((Ne(ze)*(Le(In=ze+ie*mt)/Ne(In))-Le(ze))/ke)/Se;var In},Nt=(Be(1)-ze)/ie;if(Math.abs(Se)<1e-6||!isFinite(Nt)){if(Math.abs(we-De)<1e-6)return this.easeTo(s,h);const mt=Des.maxDuration&&(s.duration=0),this._zooming=!0,this._rotating=w!==R,this._pitching=z!==S,this._padding=!m.isPaddingEqual(L),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(ae),this._ease(mt=>{const In=mt*Nt,An=1/ft(In);m.zoom=1===mt?k:y+m.scaleZoom(An),this._rotating&&(m.bearing=b.number(w,R,mt)),this._pitching&&(m.pitch=b.number(S,z,mt)),this._padding&&(m.interpolatePadding(I,L,mt),ee=m.centerPoint.add(Q)),this.terrain&&!s.freezeElevation&&this._updateElevation(mt);const Ht=1===mt?ae:m.unproject(_e.add(ye.mult(Pt(In))).mult(An));m.setLocationAtPoint(m.renderWorldCopies?Ht.wrap():Ht,ee),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(s,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,h)}if(!s){const m=this.handlers;m&&m.stop(!1)}return this}_ease(s,h,m){!1===m.animate||0===m.duration?(s(1),h()):(this._easeStart=b.exported.now(),this._easeOptions=m,this._onEaseFrame=s,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const s=Math.min((b.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(s,h){s=b.wrap(s,-180,180);const m=Math.abs(s-h);return Math.abs(s-360-h)180?-360:m<-180?360:0}}class eh{constructor(s={}){this.options=s,b.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(s){return this._map=s,this._compact=this.options&&this.options.compact,this._container=Ie.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Ie.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Ie.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(){Ie.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(s,h){const m=this._map._getUIString(`AttributionControl.${h}`);s.title=m,s.setAttribute("aria-label",m)}_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")))}_updateData(s){!s||"metadata"!==s.sourceDataType&&"visibility"!==s.sourceDataType&&"style"!==s.dataType&&"terrain"!==s.type||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let s=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=s.concat(this.options.customAttribution.map(y=>"string"!=typeof y?"":y)):"string"==typeof this.options.customAttribution&&s.push(this.options.customAttribution)),this._map.style.stylesheet){const y=this._map.style.stylesheet;this.styleOwner=y.owner,this.styleId=y.id}const h=this._map.style.sourceCaches;for(const y in h){const w=h[y];if(w.used||w.usedForTerrain){const S=w.getSource();S.attribution&&s.indexOf(S.attribution)<0&&s.push(S.attribution)}}s=s.filter(y=>String(y).trim()),s.sort((y,w)=>y.length-w.length),s=s.filter((y,w)=>{for(let S=w+1;S=0)return!1;return!0});const m=s.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,s.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")}}class Hl{constructor(s={}){this.options=s,b.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(s){this._map=s,this._compact=this.options&&this.options.compact,this._container=Ie.create("div","maplibregl-ctrl");const h=Ie.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Ie.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const s=this._container.children;if(s.length){const h=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&h.classList.add("maplibregl-compact"):h.classList.remove("maplibregl-compact")}}}class fa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){const h=++this._id;return this._queue.push({callback:s,id:h,cancelled:!1}),h}remove(s){const h=this._currentlyRunning,m=h?this._queue.concat(h):this._queue;for(const y of m)if(y.id===s)return void(y.cancelled=!0)}run(s=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const m of h)if(!m.cancelled&&(m.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Ti={"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":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var gd=b.createLayout([{name:"a_pos3d",type:"Int16",components:3}]);class Gl extends b.Evented{constructor(s){super(),this.sourceCache=s,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,s.usedForTerrain=!0,s.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(s,h){this.sourceCache.update(s,h),this._renderableTilesKeys=[];const m={};for(const y of s.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))m[y.key]=!0,this._renderableTilesKeys.push(y.key),this._tiles[y.key]||(y.posMatrix=new Float64Array(16),b.ortho(y.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),this._tiles[y.key]=new jt(y,this.tileSize));for(const y in this._tiles)m[y]||delete this._tiles[y]}freeRtt(s){for(const h in this._tiles){const m=this._tiles[h];(!s||m.tileID.equals(s)||m.tileID.isChildOf(s)||s.isChildOf(m.tileID))&&(m.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(s=>this.getTileByID(s))}getTileByID(s){return this._tiles[s]}getTerrainCoords(s){const h={};for(const m of this._renderableTilesKeys){const y=this._tiles[m].tileID;if(y.canonical.equals(s.canonical)){const w=s.clone();w.posMatrix=new Float64Array(16),b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),h[m]=w}else if(y.canonical.isChildOf(s.canonical)){const w=s.clone();w.posMatrix=new Float64Array(16);const S=y.canonical.z-s.canonical.z,I=y.canonical.x-(y.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,R,0,R,0,1),b.translate(w.posMatrix,w.posMatrix,[-I*R,-k*R,0]),h[m]=w}else if(s.canonical.isChildOf(y.canonical)){const w=s.clone();w.posMatrix=new Float64Array(16);const S=s.canonical.z-y.canonical.z,I=s.canonical.x-(s.canonical.x>>S<>S<>S;b.ortho(w.posMatrix,0,b.EXTENT,0,b.EXTENT,0,1),b.translate(w.posMatrix,w.posMatrix,[I*R,k*R,0]),b.scale(w.posMatrix,w.posMatrix,[1/2**S,1/2**S,0]),h[m]=w}}return h}getSourceTile(s,h){const m=this.sourceCache._source;let y=s.overscaledZ-this.deltaZoom;if(y>m.maxzoom&&(y=m.maxzoom),y=m.minzoom&&(!w||!w.dem);)w=this.sourceCache.getTileByID(s.scaledTo(y--).key);return w}tilesAfterTime(s=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=s)}}class th{constructor(s,h,m){this.painter=s,this.sourceCache=new Gl(h),this.options=m,this.exaggeration="number"==typeof m.exaggeration?m.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(s,h,m,y=b.EXTENT){if(!(h>=0&&h=0&&ms.canonical.z&&(s.canonical.z>=y?w=s.canonical.z-y:b.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const S=s.canonical.x-(s.canonical.x>>w<>w<>8<<4|w>>8,h[S+3]=0;const m=new b.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),y=new Gn(s,m,s.gl.RGBA,{premultiply:!1});return y.bind(s.gl.NEAREST,s.gl.CLAMP_TO_EDGE),this._coordsTexture=y,y}pointCoordinate(s){const h=new Uint8Array(4),m=this.painter.context,y=m.gl;m.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),y.readPixels(s.x,this.painter.height/devicePixelRatio-s.y-1,1,1,y.RGBA,y.UNSIGNED_BYTE,h),m.bindFramebuffer.set(null);const w=h[0]+(h[2]>>4<<8),S=h[1]+((15&h[2])<<8),I=this.coordsIndex[255-h[3]],k=I&&this.sourceCache.getTileByID(I);if(!k)return null;const R=this._coordsTextureSize,z=(1<s.id!==h),this._recentlyUsed.push(s.id)}stampObject(s){s.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const s=this._createObject(this._objects.length);return this._objects.push(s),s}freeObject(s){s.inUse=!1}freeAllObjects(){for(const s of this._objects)this.freeObject(s)}isFull(){return!(this._objects.length!s.inUse)}}const $s={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ql{constructor(s,h){this.painter=s,this.terrain=h,this.pool=new vs(s.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(s){return this.pool.getObjectForId(s.rtt[this._stacks.length-1].id).texture}prepareForRender(s,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=s._order.filter(m=>!s._layers[m].isHidden(h)),this._coordsDescendingInv={};for(const m in s.sourceCaches){this._coordsDescendingInv[m]={};const y=s.sourceCaches[m].getVisibleCoordinates();for(const w of y){const S=this.terrain.sourceCache.getTerrainCoords(w);for(const I in S)this._coordsDescendingInv[m][I]||(this._coordsDescendingInv[m][I]=[]),this._coordsDescendingInv[m][I].push(S[I])}}this._coordsDescendingInvStr={};for(const m of s._order){const y=s._layers[m],w=y.source;if($s[y.type]&&!this._coordsDescendingInvStr[w]){this._coordsDescendingInvStr[w]={};for(const S in this._coordsDescendingInv[w])this._coordsDescendingInvStr[w][S]=this._coordsDescendingInv[w][S].map(I=>I.key).sort().join()}}for(const m of this._renderableTiles)for(const y in this._coordsDescendingInvStr){const w=this._coordsDescendingInvStr[y][m.tileID.key];w&&w!==m.rttCoords[y]&&(m.rtt=[])}}renderLayer(s){if(s.isHidden(this.painter.transform.zoom))return!1;const h=s.type,m=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===s.id;if($s[h]&&(this._prevType&&$s[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(s.id),!y))return!0;if($s[this._prevType]||$s[h]&&y){this._prevType=h;const w=this._stacks.length-1,S=this._stacks[w]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(ad(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[w]){const R=this.pool.getObjectForId(I.rtt[w].id);if(R.stamp===I.rtt[w].stamp){this.pool.useObject(R);continue}}const k=this.pool.getOrCreateFreeObject();this.pool.useObject(k),this.pool.stampObject(k),I.rtt[w]={id:k.id,stamp:k.stamp},m.context.bindFramebuffer.set(k.fbo.framebuffer),m.context.clear({color:b.Color.transparent});for(let R=0;R{g.touchstart=g.dragStart,g.touchmoveWindow=g.dragMove,g.touchend=g.dragEnd},_d={showCompass:!0,showZoom:!0,visualizePitch:!1};class Gf{constructor(s,h,m=!1){this._clickTolerance=10;const y=s.dragRotate._mouseRotate.getClickTolerance(),w=s.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=ud({clickTolerance:y,enable:!0}),this.touchRotate=(({enable:S,clickTolerance:I,bearingDegreesPerPixelMoved:k=.8})=>{const R=new hr;return new $l({clickTolerance:I,move:(z,L)=>({bearingDelta:(L.x-z.x)*k}),moveStateManager:R,enable:S,assignEvents:yd})})({clickTolerance:y,enable:!0}),this.map=s,m&&(this.mousePitch=Xu({clickTolerance:w,enable:!0}),this.touchPitch=(({enable:S,clickTolerance:I,pitchDegreesPerPixelMoved:k=-.5})=>{const R=new hr;return new $l({clickTolerance:I,move:(z,L)=>({pitchDelta:(L.y-z.y)*k}),moveStateManager:R,enable:S,assignEvents:yd})})({clickTolerance:w,enable:!0})),b.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Ie.addEventListener(h,"mousedown",this.mousedown),Ie.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),Ie.addEventListener(h,"touchcancel",this.reset)}startMouse(s,h){this.mouseRotate.dragStart(s,h),this.mousePitch&&this.mousePitch.dragStart(s,h),Ie.disableDrag()}startTouch(s,h){this.touchRotate.dragStart(s,h),this.touchPitch&&this.touchPitch.dragStart(s,h),Ie.disableDrag()}moveMouse(s,h){const m=this.map,{bearingDelta:y}=this.mouseRotate.dragMove(s,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.mousePitch){const{pitchDelta:w}=this.mousePitch.dragMove(s,h)||{};w&&m.setPitch(m.getPitch()+w)}}moveTouch(s,h){const m=this.map,{bearingDelta:y}=this.touchRotate.dragMove(s,h)||{};if(y&&m.setBearing(m.getBearing()+y),this.touchPitch){const{pitchDelta:w}=this.touchPitch.dragMove(s,h)||{};w&&m.setPitch(m.getPitch()+w)}}off(){const s=this.element;Ie.removeEventListener(s,"mousedown",this.mousedown),Ie.removeEventListener(s,"touchstart",this.touchstart,{passive:!1}),Ie.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Ie.removeEventListener(window,"touchend",this.touchend),Ie.removeEventListener(s,"touchcancel",this.reset),this.offTemp()}offTemp(){Ie.enableDrag(),Ie.removeEventListener(window,"mousemove",this.mousemove),Ie.removeEventListener(window,"mouseup",this.mouseup),Ie.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Ie.removeEventListener(window,"touchend",this.touchend)}mousedown(s){this.startMouse(b.extend({},s,{ctrlKey:!0,preventDefault:()=>s.preventDefault()}),Ie.mousePos(this.element,s)),Ie.addEventListener(window,"mousemove",this.mousemove),Ie.addEventListener(window,"mouseup",this.mouseup)}mousemove(s){this.moveMouse(s,Ie.mousePos(this.element,s))}mouseup(s){this.mouseRotate.dragEnd(s),this.mousePitch&&this.mousePitch.dragEnd(s),this.offTemp()}touchstart(s){1!==s.targetTouches.length?this.reset():(this._startPos=this._lastPos=Ie.touchPos(this.element,s.targetTouches)[0],this.startTouch(s,this._startPos),Ie.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Ie.addEventListener(window,"touchend",this.touchend))}touchmove(s){1!==s.targetTouches.length?this.reset():(this._lastPos=Ie.touchPos(this.element,s.targetTouches)[0],this.moveTouch(s,this._lastPos))}touchend(s){0===s.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const m=h.locationPoint(g);if(m.x>=0&&m.y>=0&&m.x<=h.width&&m.y<=h.height)break;g.lng>h.center.lng?g.lng-=360:g.lng+=360}return g}const qc={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 bd(g,s,h){const m=g.classList;for(const y in qc)m.remove(`maplibregl-${h}-anchor-${y}`);m.add(`maplibregl-${h}-anchor-${s}`)}class rh extends b.Evented{constructor(s,h){if(super(),(s instanceof HTMLElement||h)&&(s=b.extend({element:s},h)),b.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&"auto"!==s.pitchAlignment?s.pitchAlignment:this._rotationAlignment,s&&s.element)this._element=s.element,this._offset=b.pointGeometry.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=Ie.create("div"),this._element.setAttribute("aria-label","Map marker");const m=Ie.createNS("http://www.w3.org/2000/svg","svg"),y=41,w=27;m.setAttributeNS(null,"display","block"),m.setAttributeNS(null,"height",`${y}px`),m.setAttributeNS(null,"width",`${w}px`),m.setAttributeNS(null,"viewBox",`0 0 ${w} ${y}`);const S=Ie.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"stroke","none"),S.setAttributeNS(null,"stroke-width","1"),S.setAttributeNS(null,"fill","none"),S.setAttributeNS(null,"fill-rule","evenodd");const I=Ie.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill-rule","nonzero");const k=Ie.createNS("http://www.w3.org/2000/svg","g");k.setAttributeNS(null,"transform","translate(3.0, 29.0)"),k.setAttributeNS(null,"fill","#000000");const R=[{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 ye of R){const ie=Ie.createNS("http://www.w3.org/2000/svg","ellipse");ie.setAttributeNS(null,"opacity","0.04"),ie.setAttributeNS(null,"cx","10.5"),ie.setAttributeNS(null,"cy","5.80029008"),ie.setAttributeNS(null,"rx",ye.rx),ie.setAttributeNS(null,"ry",ye.ry),k.appendChild(ie)}const z=Ie.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"fill",this._color);const L=Ie.createNS("http://www.w3.org/2000/svg","path");L.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"),z.appendChild(L);const j=Ie.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"fill","#000000");const Q=Ie.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"),j.appendChild(Q);const ee=Ie.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ee.setAttributeNS(null,"fill","#FFFFFF");const Y=Ie.createNS("http://www.w3.org/2000/svg","g");Y.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ae=Ie.createNS("http://www.w3.org/2000/svg","circle");ae.setAttributeNS(null,"fill","#000000"),ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"cx","5.5"),ae.setAttributeNS(null,"cy","5.5"),ae.setAttributeNS(null,"r","5.4999962");const _e=Ie.createNS("http://www.w3.org/2000/svg","circle");_e.setAttributeNS(null,"fill","#FFFFFF"),_e.setAttributeNS(null,"cx","5.5"),_e.setAttributeNS(null,"cy","5.5"),_e.setAttributeNS(null,"r","5.4999962"),Y.appendChild(ae),Y.appendChild(_e),I.appendChild(k),I.appendChild(z),I.appendChild(j),I.appendChild(ee),I.appendChild(Y),m.appendChild(I),m.setAttributeNS(null,"height",y*this._scale+"px"),m.setAttributeNS(null,"width",w*this._scale+"px"),this._element.appendChild(m),this._offset=b.pointGeometry.convert(s&&s.offset||[0,-14])}this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",m=>{m.preventDefault()}),this._element.addEventListener("mousedown",m=>{m.preventDefault()}),bd(this._element,this._anchor,"marker"),this._popup=null}addTo(s){return this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._update),s.on("moveend",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("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),Ie.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(s){return this._lngLat=b.LngLat.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){const y=Math.sqrt(Math.pow(13.5,2)/2);s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[y,-1*(24.6+y)],"bottom-right":[-y,-1*(24.6+y)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=s,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(s){const h=s.code,m=s.charCode||s.keyCode;"Space"!==h&&"Enter"!==h&&32!==m&&13!==m||this.togglePopup()}_onMapClick(s){const h=s.originalEvent.target,m=this._element;this._popup&&(h===m||m.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const s=this._popup;return s?(s.isOpen()?s.remove():s.addTo(this._map),this):this}_update(s){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=vd(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?h=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?m="rotateX(0deg)":"map"===this._pitchAlignment&&(m=`rotateX(${this._map.getPitch()}deg)`),s&&"moveend"!==s.type||(this._pos=this._pos.round()),Ie.setTransform(this._element,`${qc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${h}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const y=this._map.unproject(this._pos),w=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=y.distanceTo(this._lngLat)>20*w?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(s){return this._offset=b.pointGeometry.convert(s),this._update(),this}_onMove(s){if(!this._isDragging){const h=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=h}this._isDragging&&(this._pos=s.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new b.Event("dragstart"))),this.fire(new b.Event("drag")))}_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),"active"===this._state&&this.fire(new b.Event("dragend")),this._state="inactive"}_addDragHandler(s){this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.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))}setDraggable(s){return this._draggable=!!s,this._map&&(s?(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(s){return this._rotation=s||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(s){return this._rotationAlignment=s||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(s){return this._pitchAlignment=s&&"auto"!==s?s:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const He={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let en,Zl=0,el=!1;const Rr={maxWidth:100,unit:"metric"};function ih(g,s,h){const m=h&&h.maxWidth||100,y=g._container.clientHeight/2,w=g.unproject([0,y]),S=g.unproject([m,y]),I=w.distanceTo(S);if(h&&"imperial"===h.unit){const k=3.2808*I;k>5280?js(s,m,k/5280,g._getUIString("ScaleControl.Miles")):js(s,m,k,g._getUIString("ScaleControl.Feet"))}else h&&"nautical"===h.unit?js(s,m,I/1852,g._getUIString("ScaleControl.NauticalMiles")):I>=1e3?js(s,m,I/1e3,g._getUIString("ScaleControl.Kilometers")):js(s,m,I,g._getUIString("ScaleControl.Meters"))}function js(g,s,h,m){const y=function(w){const S=Math.pow(10,`${Math.floor(w)}`.length-1);let I=w/S;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(k){const R=Math.pow(10,Math.ceil(-Math.log(k)/Math.LN10));return Math.round(k*R)/R}(I),S*I}(h);g.style.width=s*(y/h)+"px",g.innerHTML=`${y} ${m}`}const bs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},xd=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function oh(g){if(g){if("number"==typeof g){const s=Math.round(Math.sqrt(.5*Math.pow(g,2)));return{center:new b.pointGeometry(0,0),top:new b.pointGeometry(0,g),"top-left":new b.pointGeometry(s,s),"top-right":new b.pointGeometry(-s,s),bottom:new b.pointGeometry(0,-g),"bottom-left":new b.pointGeometry(s,-s),"bottom-right":new b.pointGeometry(-s,-s),left:new b.pointGeometry(g,0),right:new b.pointGeometry(-g,0)}}if(g instanceof b.pointGeometry||Array.isArray(g)){const s=b.pointGeometry.convert(g);return{center:s,top:s,"top-left":s,"top-right":s,bottom:s,"bottom-left":s,"bottom-right":s,left:s,right:s}}return{center:b.pointGeometry.convert(g.center||[0,0]),top:b.pointGeometry.convert(g.top||[0,0]),"top-left":b.pointGeometry.convert(g["top-left"]||[0,0]),"top-right":b.pointGeometry.convert(g["top-right"]||[0,0]),bottom:b.pointGeometry.convert(g.bottom||[0,0]),"bottom-left":b.pointGeometry.convert(g["bottom-left"]||[0,0]),"bottom-right":b.pointGeometry.convert(g["bottom-right"]||[0,0]),left:b.pointGeometry.convert(g.left||[0,0]),right:b.pointGeometry.convert(g.right||[0,0])}}return oh(new b.pointGeometry(0,0))}const pa={supported:wr,setRTLTextPlugin:b.setRTLTextPlugin,getRTLTextPluginStatus:b.getRTLTextPluginStatus,Map:class extends Mi{constructor(g){var s;if(b.PerformanceUtils.mark(b.PerformanceMarkers.create),null!=(g=b.extend({},nh,g)).minZoom&&null!=g.maxZoom&&g.minZoom>g.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=g.minPitch&&null!=g.maxPitch&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=g.minPitch&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=g.maxPitch&&g.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Er(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies),{bearingSnap:g.bearingSnap}),this._interactive=g.interactive,this._cooperativeGestures=g.cooperativeGestures,this._maxTileCacheSize=g.maxTileCacheSize,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new fa,this._controls=[],this._mapId=b.uniqueId(),this._locale=b.extend({},Ti,g.locale),this._clickTolerance=g.clickTolerance,this._pixelRatio=null!==(s=g.pixelRatio)&&void 0!==s?s:devicePixelRatio,this._imageQueueHandle=si.addThrottleControl(()=>this.isMoving()),this._requestManager=new kc(g.transformRequest),"string"==typeof g.container){if(this._container=document.getElementById(g.container),!this._container)throw new Error(`Container '${g.container}' not found.`)}else{if(!(g.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}g.maxBounds&&this.setMaxBounds(g.maxBounds),b.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),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)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Qu(this,g),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=g.hash&&new Bf("string"==typeof g.hash&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,b.extend({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new eh({customAttribution:g.customAttribution})),g.maplibreLogo&&this.addControl(new Hl,g.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",h=>{this._update("style"===h.dataType),this.fire(new b.Event(`${h.dataType}data`,h))}),this.on("dataloading",h=>{this.fire(new b.Event(`${h.dataType}dataloading`,h))}),this.on("dataabort",h=>{this.fire(new b.Event("sourcedataabort",h))})}_getMapId(){return this._mapId}addControl(g,s){if(void 0===s&&(s=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=g.onAdd(this);this._controls.push(g);const m=this._controlPositions[s];return-1!==s.indexOf("bottom")?m.insertBefore(h,m.firstChild):m.appendChild(h),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new b.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const s=this._controls.indexOf(g);return s>-1&&this._controls.splice(s,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}calculateCameraOptionsFromTo(g,s,h,m){return null==m&&this.terrain&&(m=this.transform.getElevation(h,this.terrain)),super.calculateCameraOptionsFromTo(g,s,h,m)}resize(g){const s=this._containerDimensions(),h=s[0],m=s[1];this._resizeCanvas(h,m,this.getPixelRatio()),this.transform.resize(h,m),this.painter.resize(h,m,this.getPixelRatio());const y=!this._moving;return y&&(this.stop(),this.fire(new b.Event("movestart",g)).fire(new b.Event("move",g))),this.fire(new b.Event("resize",g)),y&&this.fire(new b.Event("moveend",g)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(g){const[s,h]=this._containerDimensions();this._pixelRatio=g,this._resizeCanvas(s,h,g),this.painter.resize(s,h,g)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(b.LngLatBounds.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),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)return this.transform.minPitch=g,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),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.renderWorldCopies=g,this._update()}project(g){return this.transform.locationPoint(b.LngLat.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.pointLocation(b.pointGeometry.convert(g),this.terrain)}isMoving(){var g;return this._moving||(null===(g=this.handlers)||void 0===g?void 0:g.isMoving())}isZooming(){var g;return this._zooming||(null===(g=this.handlers)||void 0===g?void 0:g.isZooming())}isRotating(){var g;return this._rotating||(null===(g=this.handlers)||void 0===g?void 0:g.isRotating())}_createDelegatedListener(g,s,h){if("mouseenter"===g||"mouseover"===g){let m=!1;return{layer:s,listener:h,delegates:{mousemove:w=>{const S=this.getLayer(s)?this.queryRenderedFeatures(w.point,{layers:[s]}):[];S.length?m||(m=!0,h.call(this,new Ro(g,this,w.originalEvent,{features:S}))):m=!1},mouseout:()=>{m=!1}}}}if("mouseleave"===g||"mouseout"===g){let m=!1;return{layer:s,listener:h,delegates:{mousemove:S=>{(this.getLayer(s)?this.queryRenderedFeatures(S.point,{layers:[s]}):[]).length?m=!0:m&&(m=!1,h.call(this,new Ro(g,this,S.originalEvent)))},mouseout:S=>{m&&(m=!1,h.call(this,new Ro(g,this,S.originalEvent)))}}}}{const m=y=>{const w=this.getLayer(s)?this.queryRenderedFeatures(y.point,{layers:[s]}):[];w.length&&(y.features=w,h.call(this,y),delete y.features)};return{layer:s,listener:h,delegates:{[g]:m}}}}on(g,s,h){if(void 0===h)return super.on(g,s);const m=this._createDelegatedListener(g,s,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(m);for(const y in m.delegates)this.on(y,m.delegates[y]);return this}once(g,s,h){if(void 0===h)return super.once(g,s);const m=this._createDelegatedListener(g,s,h);for(const y in m.delegates)this.once(y,m.delegates[y]);return this}off(g,s,h){return void 0===h?super.off(g,s):(this._delegatedListeners&&this._delegatedListeners[g]&&(m=>{const y=this._delegatedListeners[g];for(let w=0;wthis._updateStyle(g,s));const h=this.style&&s.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new Mt(this,s||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof g?this.style.loadURL(g,s,h):this.style.loadJSON(g,s,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Mt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,s){if("string"==typeof g){const h=this._requestManager.transformRequest(g,fn.Style);b.getJSON(h,(m,y)=>{m?this.fire(new b.ErrorEvent(m)):y&&this._updateDiff(y,s)})}else"object"==typeof g&&this._updateDiff(g,s)}_updateDiff(g,s){try{this.style.setState(g,s)&&this._update(!0)}catch(h){b.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(g,s)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():b.warnOnce("There is no style added to the map.")}addSource(g,s){return this._lazyInitEmptyStyle(),this.style.addSource(g,s),this._update(!0)}isSourceLoaded(g){const s=this.style&&this.style.sourceCaches[g];if(void 0!==s)return s.loaded();this.fire(new b.ErrorEvent(new Error(`There is no source with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){const s=this.style.sourceCaches[g.source];if(!s)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);this.terrain=new th(this.painter,s,g),this.painter.renderToTexture=new ql(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=h=>{"style"===h.dataType?this.terrain.sourceCache.freeRtt():"source"===h.dataType&&h.tile&&(h.sourceId===g.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.updateElevation(this.terrain);return this.fire(new b.Event("terrain",{terrain:g})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){const g=this.style&&this.style.sourceCaches;for(const s in g){const h=g[s]._tiles;for(const m in h){const y=h[m];if("loaded"!==y.state&&"errored"!==y.state)return!1}}return!0}addSourceType(g,s,h){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,s,h)}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}addImage(g,s,{pixelRatio:h=1,sdf:m=!1,stretchX:y,stretchY:w,content:S}={}){if(this._lazyInitEmptyStyle(),s instanceof HTMLImageElement||b.isImageBitmap(s)){const{width:I,height:k,data:R}=b.exported.getImageData(s);this.style.addImage(g,{data:new b.RGBAImage({width:I,height:k},R),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0})}else{if(void 0===s.width||void 0===s.height)return this.fire(new b.ErrorEvent(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:I,height:k,data:R}=s,z=s;this.style.addImage(g,{data:new b.RGBAImage({width:I,height:k},new Uint8Array(R)),pixelRatio:h,stretchX:y,stretchY:w,content:S,sdf:m,version:0,userImage:z}),z.onAdd&&z.onAdd(this,g)}}}updateImage(g,s){const h=this.style.getImage(g);if(!h)return this.fire(new b.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const m=s instanceof HTMLImageElement||b.isImageBitmap(s)?b.exported.getImageData(s):s,{width:y,height:w,data:S}=m;if(void 0===y||void 0===w)return this.fire(new b.ErrorEvent(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(y!==h.data.width||w!==h.data.height)return this.fire(new b.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(s instanceof HTMLImageElement||b.isImageBitmap(s));h.data.replace(S,I),this.style.updateImage(g,h)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new b.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g,s){si.getImage(this._requestManager.transformRequest(g,fn.Image),s)}listImages(){return this.style.listImages()}addLayer(g,s){return this._lazyInitEmptyStyle(),this.style.addLayer(g,s),this._update(!0)}moveLayer(g,s){return this.style.moveLayer(g,s),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}setLayerZoomRange(g,s,h){return this.style.setLayerZoomRange(g,s,h),this._update(!0)}setFilter(g,s,h={}){return this.style.setFilter(g,s,h),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,s,h,m={}){return this.style.setPaintProperty(g,s,h,m),this._update(!0)}getPaintProperty(g,s){return this.style.getPaintProperty(g,s)}setLayoutProperty(g,s,h,m={}){return this.style.setLayoutProperty(g,s,h,m),this._update(!0)}getLayoutProperty(g,s){return this.style.getLayoutProperty(g,s)}setGlyphs(g,s={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,s),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,s,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,s,h,m=>{m||this._update(!0)}),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,s={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,s,h=>{h||this._update(!0)}),this}setLight(g,s={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,s),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(g,s){return this.style.setFeatureState(g,s),this._update()}removeFeatureState(g,s){return this.style.removeFeatureState(g,s),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,s=0;return this._container&&(g=this._container.clientWidth||400,s=this._container.clientHeight||300),[g,s]}_setupContainer(){const g=this._container;g.classList.add("maplibregl-map");const s=this._canvasContainer=Ie.create("div","maplibregl-canvas-container",g);this._interactive&&s.classList.add("maplibregl-interactive"),this._canvas=Ie.create("canvas","maplibregl-canvas",s),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const h=this._containerDimensions();this._resizeCanvas(h[0],h[1],this.getPixelRatio());const m=this._controlContainer=Ie.create("div","maplibregl-control-container",g),y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(w=>{y[w]=Ie.create("div",`maplibregl-ctrl-${w} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const g=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=Ie.create("div","maplibregl-cooperative-gesture-screen",g);let s="Control",h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(h="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",s="Meta"),this._cooperativeGesturesScreen.innerHTML=`\n
${h}
\n
${"boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
\n `,document.addEventListener("keydown",m=>{m.key===s&&(this._metaPress=!0)}),document.addEventListener("keyup",m=>{m.key===s&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",m=>{this._onCooperativeGesture(m,this._metaPress,1)},!1),this._canvasContainer.classList.remove("maplibregl-touch-drag-pan")}_resizeCanvas(g,s,h){this._canvas.width=h*g,this._canvas.height=h*s,this._canvas.style.width=`${g}px`,this._canvas.style.height=`${s}px`}_setupPainter(){const g=b.extend({},wr.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1});let s=null;this._canvas.addEventListener("webglcontextcreationerror",m=>{s={requestedAttributes:g},m&&(s.statusMessage=m.statusMessage,s.type=m.type)},{once:!0});const h=this._canvas.getContext("webgl",g)||this._canvas.getContext("experimental-webgl",g);if(!h){const m="Failed to initialize WebGL";throw s?(s.message=m,new Error(JSON.stringify(s))):new Error(m)}this.painter=new gs(h,this.transform),Bi.testSupport(h)}_contextLost(g){g.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new b.Event("webglcontextlost",{originalEvent:g}))}_contextRestored(g){this._setupPainter(),this.resize(),this._update(),this.fire(new b.Event("webglcontextrestored",{originalEvent:g}))}_onMapScroll(g){if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(g,s,h){return!s&&h<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style?(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){let s,h=0;const m=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(s=m.createQueryEXT(),m.beginQueryEXT(m.TIME_ELAPSED_EXT,s),h=b.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let y=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const S=this.transform.zoom,I=b.exported.now();this.style.zoomHistory.update(S,I);const k=new b.EvaluationParameters(S,{now:I,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=k.crossFadingFactor();1===R&&R===this._crossFadingFactor||(y=!0,this._crossFadingFactor=R),this.style.update(k)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._imageQueueDirty=si.processQueue()>0,this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new b.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.load),this.fire(new b.Event("load"))),this.style&&(this.style.hasTransitions()||y)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const S=b.exported.now()-h;m.endQueryEXT(m.TIME_ELAPSED_EXT,s),setTimeout(()=>{const I=m.getQueryObjectEXT(s,m.QUERY_RESULT_EXT)/1e6;m.deleteQueryEXT(s),this.fire(new b.Event("gpu-timing-frame",{cpuTime:S,gpuTime:I}))},50)}if(this.listens("gpu-timing-layer")){const S=this.painter.collectGpuTimers();setTimeout(()=>{const I=this.painter.queryGpuTimers(S);this.fire(new b.Event("gpu-timing-layer",{layerTimes:I}))},50)}const w=this._sourcesDirty||this._styleDirty||this._placementDirty||this._imageQueueDirty;return w||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new b.Event("idle")),!this._loaded||this._fullyLoaded||w||(this._fullyLoaded=!0,b.PerformanceUtils.mark(b.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const s of this._controls)s.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1)),si.removeThrottleControl(this._imageQueueHandle);const g=this.painter.context.gl.getExtension("WEBGL_lose_context");g&&g.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Ie.remove(this._canvasContainer),Ie.remove(this._controlContainer),this._cooperativeGestures&&Ie.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map"),b.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new b.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=b.exported.frame(g=>{b.PerformanceUtils.frame(g),this._frame=null,this._render(g)}))}_onWindowOnline(){this._update()}_onWindowResize(g){this._trackResize&&this.resize({originalEvent:g})._update()}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"3.0.0-pre.4"}getCameraTargetElevation(){return this.transform.elevation}},NavigationControl:class{constructor(g){this.options=b.extend({},_d,g),this._container=Ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",s=>s.preventDefault()),this.options.showZoom&&(b.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",s=>this._map.zoomIn({},{originalEvent:s})),Ie.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",s=>this._map.zoomOut({},{originalEvent:s})),Ie.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(b.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass",s=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:s}):this._map.resetNorth({},{originalEvent:s})}),this._compassIcon=Ie.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const g=this._map.getZoom(),s=g===this._map.getMaxZoom(),h=g===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=h,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",h.toString())}_rotateCompassArrow(){const g=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=g}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._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Gf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Ie.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._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(g,s){const h=Ie.create("button",g,this._container);return h.type="button",h.addEventListener("click",s),h}_setButtonTitle(g,s){const h=this._map._getUIString(`NavigationControl.${s}`);g.title=h,g.setAttribute("aria-label",h)}},GeolocateControl:class extends b.Evented{constructor(g){super(),this.options=b.extend({},He,g),b.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(g){var s;return this._map=g,this._container=Ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),s=this._setupUI,void 0!==en?s(en):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then(h=>{en="denied"!==h.state,s(en)}):(en=!!window.navigator.geolocation,s(en)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),Ie.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Zl=0,el=!1}_isOutOfMapMaxBounds(g){const s=this._map.getMaxBounds(),h=g.coords;return s&&(h.longitudes.getEast()||h.latitudes.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(g){if(this._map){if(this._isOutOfMapMaxBounds(g))return this._setErrorState(),this.fire(new b.Event("outofmaxbounds",g)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=g,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(g),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(g),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new b.Event("geolocate",g)),this._finish()}}_updateCamera(g){const s=new b.LngLat(g.coords.longitude,g.coords.latitude),h=g.coords.accuracy,m=this._map.getBearing(),y=b.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(h),y,{geolocateSource:!0})}_updateMarker(g){if(g){const s=new b.LngLat(g.coords.longitude,g.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=g.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const g=this._map._container.clientHeight/2,s=this._map.unproject([0,g]),h=this._map.unproject([1,g]),m=s.distanceTo(h),y=Math.ceil(2*this._accuracy/m);this._circleElement.style.width=`${y}px`,this._circleElement.style.height=`${y}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(g){if(this._map){if(this.options.trackUserLocation)if(1===g.code){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 s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===g.code&&el)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new b.Event("error",g)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(g){if(this._container.addEventListener("contextmenu",s=>s.preventDefault()),this._geolocateButton=Ie.create("button","maplibregl-ctrl-geolocate",this._container),Ie.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===g){b.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ie.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rh(this._dotElement),this._circleElement=Ie.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rh({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",s=>{s.geolocateSource||"ACTIVE_LOCK"!==this._watchState||s.originalEvent&&"resize"===s.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new b.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return b.warnOnce("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 b.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Zl--,el=!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 b.Event("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 b.Event("trackuserlocationstart"));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("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Zl++,Zl>1?(g={maximumAge:6e5,timeout:0},el=!0):(g=this.options.positionOptions,el=!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)}},AttributionControl:eh,LogoControl:Hl,ScaleControl:class{constructor(g){this.options=b.extend({},Rr,g),b.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){ih(this._map,this._container,this.options)}onAdd(g){return this._map=g,this._container=Ie.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Ie.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(g){this.options.unit=g,ih(this._map,this._container,this.options)}},FullscreenControl:class extends b.Evented{constructor(g={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===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:b.warnOnce("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=Ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Ie.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const g=this._fullscreenButton=Ie.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Ie.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.fire(new b.Event(this._fullscreen?"fullscreenstart":"fullscreenend"))}_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()}},TerrainControl:class{constructor(g){this.options=g,b.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(g){return this._map=g,this._container=Ie.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Ie.create("button","maplibregl-ctrl-terrain",this._container),Ie.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(){Ie.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends b.Evented{constructor(g){super(),this.options=b.extend(Object.create(bs),g),b.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}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 b.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&Ie.remove(this._content),this._container&&(Ie.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),delete this._map),this.fire(new b.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=b.LngLat.convert(g),this._pos=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._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 s=document.createDocumentFragment(),h=document.createElement("body");let m;for(h.innerHTML=g;m=h.firstChild,m;)s.appendChild(m);return this.setDOMContent(s)}getMaxWidth(){return this._container&&this._container.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=Ie.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){this._container&&this._container.classList.add(g)}removeClassName(g){this._container&&this._container.classList.remove(g)}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}_createCloseButton(){this.options.closeButton&&(this._closeButton=Ie.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(g){this._update(g.point)}_onMouseMove(g){this._update(g.point)}_onDrag(g){this._update(g.point)}_update(g){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=Ie.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Ie.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(w=>this._container.classList.add(w)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=vd(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!g))return;const s=this._pos=this._trackPointer&&g?g:this._map.project(this._lngLat);let h=this.options.anchor;const m=oh(this.options.offset);if(!h){const w=this._container.offsetWidth,S=this._container.offsetHeight;let I;I=s.y+m.bottom.ythis._map.transform.height-S?["bottom"]:[],s.xthis._map.transform.width-w/2&&I.push("right"),h=0===I.length?"bottom":I.join("-")}const y=s.add(m[h]).round();Ie.setTransform(this._container,`${qc[h]} translate(${y.x}px,${y.y}px)`),bd(this._container,h,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const g=this._container.querySelector(xd);g&&g.focus()}_onClose(){this.remove()}},Marker:rh,Style:Mt,LngLat:b.LngLat,LngLatBounds:b.LngLatBounds,Point:b.pointGeometry,MercatorCoordinate:b.MercatorCoordinate,Evented:b.Evented,AJAXError:b.AJAXError,config:b.config,CanvasSource:Ui,GeoJSONSource:Na,ImageSource:Vn,RasterDEMTileSource:Pe,RasterTileSource:tr,VectorTileSource:yr,VideoSource:ds,prewarm:function(){Fc().acquire(ra)},clearPrewarmedResources:function(){const g=Nn;g&&(g.isPreloaded()&&1===g.numActive()?(g.release(ra),Nn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"3.0.0-pre.4"},get workerCount(){return ao.workerCount},set workerCount(g){ao.workerCount=g},get maxParallelImageRequests(){return b.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(g){b.config.MAX_PARALLEL_IMAGE_REQUESTS=g},workerUrl:"",addProtocol(g,s){b.config.REGISTERED_PROTOCOLS[g]=s},removeProtocol(g){delete b.config.REGISTERED_PROTOCOLS[g]}};return jl.extend(pa,{isSafari:b.isSafari,getPerformanceMetrics:b.PerformanceUtils.getPerformanceMetrics}),pa}),ar}()}},Lm=>{Lm(Lm.s=751)}]); \ No newline at end of file